asp.net - Eval() showing null value -


i using <%#eval("sectionid") %> data binding expression bind data code-in-front. setting sectionid in code behinde using following code,

public partial class productdetails : system.web.ui.page     {         private string sectionid = string.empty;                     protected void page_load(object sender, eventargs e)         {             if (!page.ispostback)             {                 if (request.querystring.count > 0)                 {                     if (request.querystring["secid"] != null || request.querystring["prodid"] != null)                     {                         sectionid = request.querystring["secid"].tostring();                      }                 }             }         }     } 

where in .aspx page have code this,

<a href="sectionwiseproduct.aspx?secid=<%#eval("sectionid") %>">enviro section</a> 

every time value sectionid set in code behinde not reflected in ui page.every time getting link like,

sectionwiseproduct.aspx?secid= 

can please suggest doing right or there other way that. , page_load calls twice,is because of eval ?

make change in code work

public string sectionid = string.empty;    

hope helps !!!


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -