Configuring submit button in C#

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
 
G

Guest

Don't forget to add the code below to the InitializeComponent() method:

private void InitializeComponent()
{
this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
...
}
 

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

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,113
Latest member
Vinay KumarNevatia
Top