Click here to Skip to main content
16,007,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i m working in asp.net .i found this difficultes. how to give default button as finishnavigatetemplate finish button of Wizard Control in asp.net4.0.even i tried this one but never got expected result.
C#
Page.Form.DefaultButton = Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("btnFinish").UniqueID;
Posted
Updated 19-Jul-12 1:29am
v2

1 solution

The DefaultButton (as you can set in your form tag <form id="form1" runat="server" DefaultButton="btnFinished">) will determine which buttons click event will be fired on a default submit. (like if a user hits enter while in a textbox)

You can attach events to all your buttons. If you attach an event to your btnFinish-button that event will trigger when you click that specific button.


HTML
<form id="form1" runat="server" DefaultButton="btnFinish">
<!-- the rest of your form... -->
<asp:Button runat="server" value="I'm done. Send my data" id="btnFinish" OnClick="btnFinish_Click"/>
</form>

C#
protected void btnFinish_Click(object sender, EventArgs e)
{
    // Save your data from wizard and move on..
}
 
Share this answer
 
v2
Comments
Espen Harlinn 19-Jul-12 9:25am    
Good reply :-D
StianSandberg 19-Jul-12 10:15am    
:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900