c# - how to access page load methods in other methods of a same class in asp.net -


i have method in page load:

protected void page_load(object sender, eventargs e) {     if (!ispostback)     {         ienumerable<int> ids = getids();      } } public ienumerable<int> getids() {     ienumerable<int> ids;     using ()     {         //query data end     }     return ids; } 

how can use page load ids list in other method of same class?is possible?

actually trying load data of end @ once on page load , use them in different methods of same class.

declare global variable in class.

ienumerable<int> ids; protected void page_load(object sender, eventargs e)         {              if (!ispostback)             {                  ids = getids();               }     }  public ienumerable<int> getids()    {         ienumerable<int> idstoreturn;         using ()         {                //here can ids;                  //query data end         }         return idstoreturn;     } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -