Jump to content

How To Get The Value In Page_load


Guest rohan

Recommended Posts

Hi to all,I created a method outside the page_load.Now I want the value of that variable which is defined in the method, in Page_load.thanks.....

Link to comment
Share on other sites

Since you haven't responded I'll take a wild guess as to want you are looking for. You can define a class variable and manipulate it's value in another method.

private string myVariable;protected void Page_Load() {  myVariable = "page load";  Response.Write(myVariable); //page load  someMethod();  Response.Write(myVariable); //some method}private void someMethod() {  myVariable = "some method";}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...