Hi all,
<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
asp:button onClick='navigate + run method'
Page 1 of 13 Replies - 614 Views - Last Post: 17 January 2013 - 08:29 AM
Replies To: asp:button onClick='navigate + run method'
#2
Re: asp:button onClick='navigate + run method'
Posted 17 January 2013 - 08:12 AM
Moving to ASP.NET.
#3
Re: asp:button onClick='navigate + run method'
Posted 17 January 2013 - 08:17 AM
NavigateUrl="~/Invoices/List.aspx" ContinueDestinationPageUrl="~/Default.aspx"
What are those? String variables? Properties? Where do you think the execution would be if you just set a string variable?
Instead try and look for something that might take action - a method or a function usually, right?
So that being said - the method 'redirect' from the 'response' class typically works best.
Response.Redirect("page3.aspx");
http://msdn.microsof...=vs.100%29.aspx
#4
Re: asp:button onClick='navigate + run method'
Posted 17 January 2013 - 08:29 AM
You're already doing work in the Create_Click method in code behind, so why go back to the control and try to execute behavior from its attributes? Take modi123_1's solution and add it to the end of the behavior executed by your event handler.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote







|