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
Post a Comment