I need to Bind “JobRefNo” to the query string.Above binding gives an error.what is the correct way?
<asp:LinkButton ID="MoreLinkButton" PostBackUrl="/real/Coordinator/Home.aspx?JobRefNo="'<%# Bind("JobRefNo") %>' runat="server">Go To Job...</asp:LinkButton>
Link Button is inside a DataList control.Error says
“Call to Bind must be assigned to a property of a control inside a template”
Bit of an odd one there — you’ve ended the PostBackUrl property and then started an unmatched binding:
aspx?JobRefNo="'<It would probably be better to compose your value in the model in the code behind and then eval the whole lot into the postback url:
Code behind:
On page:
<asp:LinkButton ID="MoreLinkButton" PostBackUrl='<%= JobRefPostback %>' runat="server">Go To Job...</asp:LinkButton>Hope that helps!