<asp:Button runat="server" ID="Button1" Text="Create" OnClick="Create_Click" CssClass="FadeOutOnEdit"/>

This runs the Create_Click method in the aspx.cs page.(Which adds data to the DB)

I would like to run this method and also navigate to a different page when the btn is clicked. I have been trying:

NavigateUrl="~/Invoices/List.aspx"
 ContinueDestinationPageUrl="~/Default.aspx"

any suggestions Thank ye

有帮助吗?

解决方案

If you don't need to represent the destination URL in markup, why not use Server.Transfer or Response.Redirect in the code for Create_Click?

其他提示

I imagine that what you're after is callbacks, though postback would be fine here.

Here is a really good article explaining the concept and giving sample code: http://msdn.microsoft.com/en-us/magazine/cc163941.aspx

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top