سؤال

<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