0

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

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>"; 
  Response.Write(redirect);
}
  • Great wimdp. Please mark as answer so other users know – Colbs Jun 11 '14 at 15:01

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.