protected void btnSubmit_Click(object sender, EventArgs e) { <!--- Here goes your contact code---> Response.Redirect("thankyou.aspx"); }
but be sure that thankyou page is in your umbraco backoffice. One more suggestion, if you want to show message within the usercontrol (without navigating to thank you page), better use wizard control.
You can also use the umbraco node factory and use the node Id of the page, that way if someone changes the name, then it will still go to the correct page (where 1111 is your NodeId):
protectedvoid btnSubmit_Click(object sender,EventArgs e) { <!---Here goes your contact code---> Response.Redirect( new umbraco.NodeFactory.Node(1111).NiceUrl); }
Also, if you don't want to go to a new page, you can just do panels on your ascx control rather than the wizard and just set the form panel to hidden when they have submitted and the thank you panel to visible to visible.
So your aspx page would have:
<asp:Panel ID="pnlForm" runat="server" DefaultButton="formButton"> <!-- all your form fields--> </asp:Panel>
<asp:Panel ID="pnlThankYou" runat="server" Visible="false"> <asp:Label runat="server" Text="Thank you for submitting your form" /> </asp:Panel>
moving to another page on button click
Hello everyone,
I am newbie to umbraco.i have made a "contact us" form usercontrol which is working fine.
But now i want that after click on submit button, a message like "Thanks for contact us" display on next page in umbraco.
Hi Sachin
I believe you can do that in your user control on the button_click event, which you're probably already using...
in there you can make a check on your button to see if it has been clicked or not.
If it has been clicked you can choose to display a text.
Does it make sense or do you need a code sample? :-)
/Jan
Thanks for reply jan,
its better if u plz provide a code sample...
thanks pasang brother.....
You can also use the umbraco node factory and use the node Id of the page, that way if someone changes the name, then it will still go to the correct page (where 1111 is your NodeId):
Also, if you don't want to go to a new page, you can just do panels on your ascx control rather than the wizard and just set the form panel to hidden when they have submitted and the thank you panel to visible to visible.
So your aspx page would have:
Then in your code behind
is working on a reply...