Need to find a way to call a function from my submit button

C

Chumley Walrus

I have a function that is sending a value via querystring to another
page by hitting a submit button:

private void btnSubmit_Click(object sender, System.EventArgs e)
{
Response.Redirect("destination.aspx?txtstuff=" +
this.txtstuff.Text);
}

I'm just not sure how to config the submit button here. I know its
something basic that I'm overlooking:

<asp:button id="btnSubmit" runat="server" Text="Submit"></asp:button>

thanks
chum
 
P

Peter Rilling

You might want to to use JavaScript. Just output the URL that you want to
navigate to to some JavaScript variable. Then hook the onclick event for
the button and use JavaScript navigation commands.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top