Jump to content
Sign in to follow this  
Guest rohan

How To Get The Value In Page_load

Recommended Posts

Guest rohan

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.....

Share this post


Link to post
Share on other sites
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.....
Hello,You should give us more info, because it's not very clear what do you want to do.Regards

Share this post


Link to post
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";}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...