Hi, i am newbie in ASP
I try to redirect this form after submit to another page....what should i do?
Strings of form :
Code to submit :
I try to redirect this form after submit to another page....what should i do?
Strings of form :
Code:
<%@ Page Language="C#" Debug="False" %> <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <%@ import Namespace="System.Web.Mail" %> <script runat="server"> public void Page_Load() { if (!IsPostBack) content_form.Visible = true ; else { content_result.Visible = true ; content_form.Visible = false ; } } void submit_click(object sender, ImageClickEventArgs e) { content_form.Visible = false ; MailMessage msg = new MailMessage(); string recipient = "ajimenez@yahoo.com" ; msg.To = recipient ; msg.Subject = "Kaba Web Site E-Plex Software reg (Access Control)" ; msg.BodyFormat = MailFormat.Html ; string message = "Please process as required. Thank You. <br>" ; message += "----------------------------------------------------------- <br><br>"; // message += "Reason you are contacting us?" + type_of_info.SelectedValue +" <br><br>" ; message += "Name: " + firstname.Text + " <br><br><br>" ; message += "Company: " + companyname.Text + " <br>" ; if( title.SelectedItem.Value != "" ) message += "Title : " + title.SelectedItem.Value.ToString() + " <br><br><br><br>"; message += "Email : " + email.Text + " <br>" ; message += "City : " + city.Text + " <br>" ; message += "State/Province : " + state_province.SelectedItem.Value + " <br> "; if ( zip.Text != "" ) message += "Zip/Postal Code: " + zip.Text + " <br> "; if( phone.Text != "" ) message += "Phone : " + phone.Text + " <br>"; if( fax.Text != "" ) message += "Fax : " + fax.Text + " <br>"; String yes_wants_more_information_on_kaa = Request.Form["yes_wants_more_information_on_kaa"]; String yes_mailinglist = Request.Form["yes_mailinglist"]; message += "<b>Wants this (if listed): </b><br>"; if (yes_wants_more_information_on_kaa != "") message += yes_wants_more_information_on_kaa + "<br>"; if (yes_mailinglist != "") message += yes_mailinglist + "<br>"; if( comments.Text != "" ) message += "Additional details/comments: <br>" ; message += "<p class=\"content_site\" >" + comments.Text + " </p><br>" ; msg.From = email.Text; msg.Body = message ; SmtpMail.SmtpServer="10.254.250.48" ; SmtpMail.Send(msg) ; // *** NEED TO REDIRECT WITH SPECIAL CODE? // Response.redirect "http://www.yahoo.com" content_result.Text = ""; content_result.Visible = true ; } </script>
Code to submit :
Code:
<asp:ImageButton id="submit" onclick="submit_click" runat="server" AlternateText="SUBMIT" ImageAlign="left" ImageUrl="/common/submit.gif"></asp:ImageButton>
Comment