Configuring submit button in C#

  • Thread starter Thread starter Chumley Walrus
  • Start date Start date
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
 
Don't forget to add the code below to the InitializeComponent() method:

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