I have web part with link buttons.

How do I open a new page when I click on a link button and also use a query string for sending my variable id?

1 Answer 1


Will this work for you?

<asp:LinkButton runat="server" ID="lbJan" OnClick="lbMonth_Click" Text="ClickMe' CommandArgument="1" >

protected void lbMonth_Click(object sender, EventArgs e)
  string redirect = "<script>window.open('/Pages/Page1.aspx?sID=" + e.CommandArgument.ToString() + "' );</script>"; 
  • Great wimdp. Please mark as answer so other users know Jun 11, 2014 at 15:01

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.