[Last Call] Learn how to a build a cloud-first strategyRegister Now


Need asp form to redirect after submit in Expression c#

Posted on 2008-11-06
Medium Priority
Last Modified: 2010-04-21
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.
Question by:pn944
  • 2
LVL 10

Accepted Solution

jinn_hnnl earned 2000 total points
ID: 22894723
You have the register.aspx page or whatever, inside that page you have several controls TextBox, dropdown ...

In asp.net 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

LVL 10

Expert Comment

ID: 22894769
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



Author Closing Comment

ID: 31513866
Thanks for the quick response, sorted now, thanks again

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month17 days, 19 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question