Question

<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

Was it helpful?

Solution

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?

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top