ASP.NET 2.0 Wizard Control

G

Guest

Is there anyway to get a javascript confirm button on the wizard control so
that when a user clicks "cancel" it can prompt something like... "Are you
sure you want to cancel? Your changes will not be saved."
 
S

Steven Cheng[MSFT]

Hi Nt32msngns,

Welcome to ASPNET newsgroup.
From your description, you'd like to add a certain submit button inside the
ASP.NET 2.0's Wizard control , when user click it , it will popup a confirm
dialog to ask user whether to continue the processing(post back) ,yes?

As for this question, I have some thing confused that where do you want the
button be placed inside the Wizard control,?Currently for the ASP.NET 2.0's
Wizard control, it has provided Wizard Steps , and HeaderTemplate,
SideBarTemplate....., we can put that button in a certain Step's template
or in the wizard's other global template. Anyway, no matter where do we put
this button, we can use button's OnInit event to register the clientside
jscript code for it, for example, suppose we put the button in the Wizard
control's HeaderTemplate:

<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0">
<HeaderTemplate>
<asp:Button ID="btnHeader" runat="server" Text="Header Button"
OnInit="Wizard1Header_Init" />
</HeaderTemplate>
.......................


the "Wizard1Header_Init" function is defined in the page's c ode behind
like:

protected void Wizard1Header_Init(object sender, EventArgs e)
{
Button btnHeader = sender as Button;
if (btnHeader != null)
{
btnHeader.Attributes["onclick"] = @"
if(!confirm('Are you sure to continue?')){return false;}
";
}
}


And you can also register a Click event handler for this button so that
when the user confirm to postback, you can do your serverside operations in
the click evenet handler.

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)






--------------------
| Thread-Topic: ASP.NET 2.0 Wizard Control
| thread-index: AcXEmV6ZwQiF/i/4S8Wp9oDmqESmfQ==
| X-WBNR-Posting-Host: 12.203.208.14
| From: "=?Utf-8?B?Tmljaw==?=" <[email protected]>
| Subject: ASP.NET 2.0 Wizard Control
| Date: Wed, 28 Sep 2005 18:59:04 -0700
| Lines: 3
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:127848
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Is there anyway to get a javascript confirm button on the wizard control
so
| that when a user clicks "cancel" it can prompt something like... "Are
you
| sure you want to cancel? Your changes will not be saved."
|
 
S

Steven Cheng[MSFT]

Hi Nt32msngns,

How are you going on this issue, does the suggestions in my last reply
helps a little?
If there're anything else we can help, please feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| X-Tomcat-ID: 125097590
| References: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Thu, 29 Sep 2005 07:55:08 GMT
| Subject: RE: ASP.NET 2.0 Wizard Control
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 76
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:127892
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Nt32msngns,
|
| Welcome to ASPNET newsgroup.
| From your description, you'd like to add a certain submit button inside
the
| ASP.NET 2.0's Wizard control , when user click it , it will popup a
confirm
| dialog to ask user whether to continue the processing(post back) ,yes?
|
| As for this question, I have some thing confused that where do you want
the
| button be placed inside the Wizard control,?Currently for the ASP.NET
2.0's
| Wizard control, it has provided Wizard Steps , and HeaderTemplate,
| SideBarTemplate....., we can put that button in a certain Step's template
| or in the wizard's other global template. Anyway, no matter where do we
put
| this button, we can use button's OnInit event to register the clientside
| jscript code for it, for example, suppose we put the button in the Wizard
| control's HeaderTemplate:
|
| <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0">
| <HeaderTemplate>
| <asp:Button ID="btnHeader" runat="server" Text="Header
Button"
| OnInit="Wizard1Header_Init" />
| </HeaderTemplate>
| ......................
|
|
| the "Wizard1Header_Init" function is defined in the page's c ode behind
| like:
|
| protected void Wizard1Header_Init(object sender, EventArgs e)
| {
| Button btnHeader = sender as Button;
| if (btnHeader != null)
| {
| btnHeader.Attributes["onclick"] = @"
| if(!confirm('Are you sure to continue?')){return false;}
| ";
| }
| }
|
|
| And you can also register a Click event handler for this button so that
| when the user confirm to postback, you can do your serverside operations
in
| the click evenet handler.
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
|
|
|
| --------------------
| | Thread-Topic: ASP.NET 2.0 Wizard Control
| | thread-index: AcXEmV6ZwQiF/i/4S8Wp9oDmqESmfQ==
| | X-WBNR-Posting-Host: 12.203.208.14
| | From: "=?Utf-8?B?Tmljaw==?=" <[email protected]>
| | Subject: ASP.NET 2.0 Wizard Control
| | Date: Wed, 28 Sep 2005 18:59:04 -0700
| | Lines: 3
| | Message-ID: <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet:127848
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Is there anyway to get a javascript confirm button on the wizard
control
| so
| | that when a user clicks "cancel" it can prompt something like... "Are
| you
| | sure you want to cancel? Your changes will not be saved."
| |
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top