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 Answer 1

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);
}
1
  • Great wimdp. Please mark as answer so other users know Commented 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.