문제

<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