1
Answer

Convert code from VB to C#

r_keya

r_keya

20y
1.8k
1
Convert code from VB to C# Module ABCD Public sALArr(16) As strAlways Public Structure strAlways Dim sTable As String Dim sField As String Dim sValue As String End Structure End Module ---------------------------------------------------------------------------- I have the following but it does not work: GmClass { public class sALArr { public static string []strAlways = new string[16]; } public struct strAlways { string sTable; string sField; string sValue; } }//end of class ----------------------------------------------------------------- I need to be able to do the following: string sVal = sr.ReadLine(); GmClass.sALArr.strAlways[9].sTable = sVal; PLEASE HELP ME ASAP. I AM WORKING ON A FORM AND I HAVE MADE A CLASS FOR ALL MY GLOBAL VARIABLES. SO I NEED TO DO THE ABOVE IN THE FORM AND CALL THE VARIABLES FROM THE CLASS. DON'T KNOW HOW TO DO THIS IN C#. Thankx in advance.. Keya
Answers (1)
0
Vikram
NA 319 262.4k 14y
Hi yashwant,
  
    Just Define variable in the Markup it consider as Global.

e.g
  
   <script type='text/javascript>
       var Navigateurl="~/block/abc.aspx";
         function pageLoad()
         {
                 //do something
         }

         function otherFunction()
        {
            var newurl = Navigateurl;
        }

</script>
This way you can declare the global variable in the markup.

Hope this will help you.

Regards,
 Vikram