Saturday, 15 August 2015

global variable in c# and call between pages using asp.net -



global variable in c# and call between pages using asp.net -

i have 1 page i.e default.aspx , in main root , have folder has file name of test.aspx . means test file => folder->test.aspx .

now can help me how can declare string variable in main file ( default.aspx ) , phone call or alter value in test.aspx file .

i tryed code didnt result :-

thank you

in default.cs

public static class globalvar { public static string test="null"; }

in folder->test.cs

class programme { public static void main() { globalvar.test = "arash"; } }

why don´t utilize session state?

in default.cs

public void setsessionvalue (string value) { session["test"] = value; }

and on other page:

in folder->test.cs

public string getsessionvalue () { homecoming session["test"]; }

c#

No comments:

Post a Comment