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?

1 Answer 1


use escape entities like \"

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

  • can you form it ? Commented Nov 29, 2014 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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