Need asp form to redirect after submit in Expression c#

Have managed to create an aspx page in Expression web using a few tutorials, with validators etc and everything is working OK but I need to know how to get the page to redirect to a thank you/confirmation page once the submit button is pressed. Have used some instruction from jimcobooks to create the form in C# but I have no knowledge of this programming language so struggling as you could imagine. I would also like to make the email take data form some of the text boxes in the form and use this as the subject of the email. Any help greatly appreciated.
Who is Participating?
jinn_hnnlConnect With a Mentor Commented:
You have the register.aspx page or whatever, inside that page you have several controls TextBox, dropdown ...

In 2.0 the principle of each page submit is the page postback to itself. And 1 aspx page should only have 1 form.

When the page is posted back, you can access server control (which have property runat="server") and its property.

<asp:TextBox ID="tbName" runat="server" />
<asp:Button ID="btSubmit" runat="server" OnClick="btSubmit_Click" />

protected void btSubmit_Click(object sender, EventArgs e)
        string name = tbName.Text;
       //get all  your data and send email
      Response.Redirect("successpage.aspx"); //this is to redirect to the success page

Hope this give you some idea

If you want example to send email using C#, take a look at this, it's ready to run example. Copy and try it out

pn944Author Commented:
Thanks for the quick response, sorted now, thanks again
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.