i have link button inside gridview. can some one help me to form proper URL for this

  <asp:TemplateField HeaderText="View" >
<ItemTemplate><asp:LinkButton runat="server" ID="lnkView" OnClientClick="OpenDialog('/SitePages/View%20Booking.aspx?','','');return false;" ><%#Eval("Booking Name") %></asp:LinkButton>



if i use above, than popup opens fine on link button click but if append parameter as shown below, it throws error on load itself.

<asp:LinkButton runat="server" ID="lnkView" OnClientClick="OpenDialog('/SitePages/View%20Booking.aspx?BID="+ Eval("ID")+"','','');return false;" ><%#Eval("Booking Name") %></asp:LinkButton>

can some one help to form proper URL?


use escape entities like \"

or you don't need to use quotes for the query string values it will work without that also

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.