Page 1 of 1

Need Help with Button Function

Posted: Mon Nov 16, 2015 12:58 pm
by ZPCAC
Hello :

I have a link that opens up into a popup that uses will submit info and then click the submit button to turn in their information.
if the user has properly filled the form out, the webpage will be redierected to another product page. Ideally we would like the page to close after the user submits their info.

Below is a snippet of code from the redirect (.aspx.cs)

EmailClient.Send(mailMessage);
//MessageLabel.Text = _successMessage;
//MessageLabel.ForeColor = System.Drawing.Color.Red;
Response.Redirect("~/Human-Resource-Build-a-Folder-7281-Series-P2984.aspx");

Below is a snippet of code from the button itself (.aspx)

<asp:Button ID="Submit" runat="server" Text="Submit Tab Titles/Colors" OnClick="Submit_Click" ValidationGroup="ContactUs" />
&nbsp;&nbsp;&nbsp;<asp:Button ID="reset" OnClientClick="document.location.href=document.location.href;" Text="Reset" runat="server" />

again we would like the users information to submit and the window to close once the submit button has been clicked.

Thank you !

Re: Need Help with Button Function

Posted: Tue Nov 17, 2015 3:46 pm
by AbleMods
You haven't really said what isn't working. Have you run the visual studio debugger to see what is happening?

If the redirect is actually happening, the popup will automatically disappear when the new page is rendered. If that isn't the case, then your code isn't reaching the redirect line.