Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Again: Dialog box in ASP.NET app?


Message #1 by Romy Jarr <romyjarr@t...> on Tue, 15 Oct 2002 22:15:29 +0800
Hello there,

This is regarding my previous question.  I still can't solve it.  Pls enlighten me a bit more.  The code is as follows:

<asp:TableRow ID="AddNewControlsRow" Visible="false">
    <asp:TableCell>
         <asp:Image ImageURL="./Images/imgSpacer.gif" Width="15px" Height="1px" runat="server" />
         <asp:LinkButton ID="AddNew" runat="server" Text="<img border=0 src=./Images/imgOK.gif Alt='Add new list'>"
OnClick="AddNew_Click" />
         <asp:Image ImageURL="./Images/imgSpacer.gif" Width="15px" Height="1px" runat="server" />
         <asp:LinkButton ID="CancelAddNew" runat="server" CausesValidation="false" Text="<img border=0
src=./Images/imgCancel.gif Alt='Cancel editing mode'>" OnClick="CancelAddNew_Click" /> 
    </asp:TableCell>

Based on the above code, I would like to add a function that will ask the user for an input confirmation.  Where and How do I use a
dialog box as for the first LinkButton server control?  Once the user click on the LinkButton control, the AddNew_Click( ) function
(which resides in the code-behind file) will execute.  How do I include a dialog box here to be used as a confirmation mechanism? 
The AddNew_Click( ) function shall be executed once the user has choose "yes" in the dialog box.  If the user choose "No", the
AddNew_Click( ) function will not execute and it will return back to the original .aspx page to indicate that the user has changed
his mind.

Pls help me.

Thanks a lot in advance.

Regards,
Romy
Kuala Lumpur,
Malaysia.

----- Original Message ----- 
From: "Manishk_agarwalla" <Manishk_agarwalla@i...>
To: "ASP+" <aspx@p...>
Cc: <romyjarr@t...>
Sent: Tuesday, October 15, 2002 1:34 PM
Subject: RE: [aspx] Dialog box in ASP.NET app?


> Hi Romy,
> I dont think that will behave differently in aspx.
> Its same old javascript. It has to be in aspx only.
> Try the below code. 
> Thanks & Regards,
> Manish
> 
> if (confirm("My Message"))
> {
> }
> else { }
> 
> -----Original Message-----
> From: Romy Jarr [mailto:romyjarr@t...]
> Sent: Tuesday, October 15, 2002 10:40 AM
> To: ASP+
> Subject: [aspx] Dialog box in ASP.NET app?
>  
> Hello/Hi guys,
> 
> I'm currently developing an ASP.NET application using C#.  I'm wondering if there is a way to have dialog boxes in the
application.  These dialog boxes shall be used to ask input confirmation from user.  As we know, it's easy to do so in the
traditional ASP (e.g: by merely embedding Javascript function).  But how this can be done in ASP.NET?  What will be the code?  Do we
need to include it in the ASPX page or in the code-behind file?  Show me.
> 
> Your assistance is greatly appreciated.
> 
> Kindly regards,
> Romy
> Kuala Lumpur,
> Malaysia. 

Message #2 by "Marl Atkins" <marl@s...> on Tue, 15 Oct 2002 10:40:12 -0400
You need to redesign your code to not just abandon client side code.

Use regular HTML:

<HTML>
<BODY>
<SCRIPT Language="Javascript">

function AddNew_Click()
{
	window.open("MyNewPage.aspx", "MyDialogBox");
}
</SCRIPT>
<table>
	<tr>
		<td><input type=button value"Click Me" OnClick="AddNew_Click();"></td>
	</tr>
</table>
</BODY>
</HTML>

Notice that in this case (just to prove a point) I'm using NO server side
controls or code.
You can mix server w/  client just like before. I think that's what you need
to do.

-----Original Message-----
From: Romy Jarr [mailto:romyjarr@t...]
Sent: Tuesday, October 15, 2002 10:15 AM
To: ASP+
Cc: Manishk_agarwalla
Subject: [aspx] Again: Dialog box in ASP.NET app?


Hello there,

This is regarding my previous question.  I still can't solve it.  Pls
enlighten me a bit more.  The code is as follows:

<asp:TableRow ID="AddNewControlsRow" Visible="false">
    <asp:TableCell>
         <asp:Image ImageURL="./Images/imgSpacer.gif" Width="15px"
Height="1px" runat="server" />
         <asp:LinkButton ID="AddNew" runat="server" Text="<img border=0
src=./Images/imgOK.gif Alt='Add new list'>" OnClick="AddNew_Click" />
         <asp:Image ImageURL="./Images/imgSpacer.gif" Width="15px"
Height="1px" runat="server" />
         <asp:LinkButton ID="CancelAddNew" runat="server"
CausesValidation="false" Text="<img border=0 src=./Images/imgCancel.gif
Alt='Cancel editing mode'>" OnClick="CancelAddNew_Click" />
    </asp:TableCell>

Based on the above code, I would like to add a function that will ask the
user for an input confirmation.  Where and How do I use a dialog box as for
the first LinkButton server control?  Once the user click on the LinkButton
control, the AddNew_Click( ) function (which resides in the code-behind
file) will execute.  How do I include a dialog box here to be used as a
confirmation mechanism?  The AddNew_Click( ) function shall be executed once
the user has choose "yes" in the dialog box.  If the user choose "No", the
AddNew_Click( ) function will not execute and it will return back to the
original .aspx page to indicate that the user has changed his mind.

Pls help me.

Thanks a lot in advance.

Regards,
Romy
Kuala Lumpur,
Malaysia.

----- Original Message -----
From: "Manishk_agarwalla" <Manishk_agarwalla@i...>
To: "ASP+" <aspx@p...>
Cc: <romyjarr@t...>
Sent: Tuesday, October 15, 2002 1:34 PM
Subject: RE: [aspx] Dialog box in ASP.NET app?


> Hi Romy,
> I dont think that will behave differently in aspx.
> Its same old javascript. It has to be in aspx only.
> Try the below code.
> Thanks & Regards,
> Manish
>
> if (confirm("My Message"))
> {
> }
> else { }
>
> -----Original Message-----
> From: Romy Jarr [mailto:romyjarr@t...]
> Sent: Tuesday, October 15, 2002 10:40 AM
> To: ASP+
> Subject: [aspx] Dialog box in ASP.NET app?
>
> Hello/Hi guys,
>
> I'm currently developing an ASP.NET application using C#.  I'm wondering
if there is a way to have dialog boxes in the application.  These dialog
boxes shall be used to ask input confirmation from user.  As we know, it's
easy to do so in the traditional ASP (e.g: by merely embedding Javascript
function).  But how this can be done in ASP.NET?  What will be the code?  Do
we need to include it in the ASPX page or in the code-behind file?  Show me.
>
> Your assistance is greatly appreciated.
>
> Kindly regards,
> Romy
> Kuala Lumpur,
> Malaysia.


---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.

---

Message #3 by "Dev" <devendra_vyawahare@p...> on Wed, 16 Oct 2002 12:52:30 +0530
put the following code in Page_Load event of ur web form.

AddNew.Attributes.Add("onClick", "return confirm('Are you sure you want to
Add?');")



----- Original Message -----
From: "Romy Jarr" <romyjarr@t...>
To: "ASP+" <aspx@p...>
Cc: "Manishk_agarwalla" <Manishk_agarwalla@i...>
Sent: Tuesday, October 15, 2002 7:45 PM
Subject: [aspx] Again: Dialog box in ASP.NET app?


> Hello there,
>
> This is regarding my previous question.  I still can't solve it.  Pls
enlighten me a bit more.  The code is as follows:
>
> <asp:TableRow ID="AddNewControlsRow" Visible="false">
>     <asp:TableCell>
>          <asp:Image ImageURL="./Images/imgSpacer.gif" Width="15px"
Height="1px" runat="server" />
>          <asp:LinkButton ID="AddNew" runat="server" Text="<img border=0
src=./Images/imgOK.gif Alt='Add new list'>" OnClick="AddNew_Click" />
>          <asp:Image ImageURL="./Images/imgSpacer.gif" Width="15px"
Height="1px" runat="server" />
>          <asp:LinkButton ID="CancelAddNew" runat="server"
CausesValidation="false" Text="<img border=0 src=./Images/imgCancel.gif
Alt='Cancel editing mode'>" OnClick="CancelAddNew_Click" />
>     </asp:TableCell>
>
> Based on the above code, I would like to add a function that will ask the
user for an input confirmation.  Where and How do I use a dialog box as for
the first LinkButton server control?  Once the user click on the LinkButton
control, the AddNew_Click( ) function (which resides in the code-behind
file) will execute.  How do I include a dialog box here to be used as a
confirmation mechanism?  The AddNew_Click( ) function shall be executed once
the user has choose "yes" in the dialog box.  If the user choose "No", the
AddNew_Click( ) function will not execute and it will return back to the
original .aspx page to indicate that the user has changed his mind.
>
> Pls help me.
>
> Thanks a lot in advance.
>
> Regards,
> Romy
> Kuala Lumpur,
> Malaysia.
>
> ----- Original Message -----
> From: "Manishk_agarwalla" <Manishk_agarwalla@i...>
> To: "ASP+" <aspx@p...>
> Cc: <romyjarr@t...>
> Sent: Tuesday, October 15, 2002 1:34 PM
> Subject: RE: [aspx] Dialog box in ASP.NET app?
>
>
> > Hi Romy,
> > I dont think that will behave differently in aspx.
> > Its same old javascript. It has to be in aspx only.
> > Try the below code.
> > Thanks & Regards,
> > Manish
> >
> > if (confirm("My Message"))
> > {
> > }
> > else { }
> >
> > -----Original Message-----
> > From: Romy Jarr [mailto:romyjarr@t...]
> > Sent: Tuesday, October 15, 2002 10:40 AM
> > To: ASP+
> > Subject: [aspx] Dialog box in ASP.NET app?
> >
> > Hello/Hi guys,
> >
> > I'm currently developing an ASP.NET application using C#.  I'm wondering
if there is a way to have dialog boxes in the application.  These dialog
boxes shall be used to ask input confirmation from user.  As we know, it's
easy to do so in the traditional ASP (e.g: by merely embedding Javascript
function).  But how this can be done in ASP.NET?  What will be the code?  Do
we need to include it in the ASPX page or in the code-behind file?  Show me.
> >
> > Your assistance is greatly appreciated.
> >
> > Kindly regards,
> > Romy
> > Kuala Lumpur,
> > Malaysia.
>
>
> ---
>
> ASP.NET 1.0 Namespace Reference with C#
> http://www.wrox.com/acon11.asp?ISBN=1861007442
>
> ASP.NET 1.0 Namespace Reference with VB.NET
> http://www.wrox.com/acon11.asp?ISBN=1861007450
>
> These books are a complete reference to the ASP.NET namespaces
> for developers who are already familiar with using ASP.NET.
> There is no trivial introductory material or useless .NET
> hype and the presentation of the namespaces, in an easy-to use
> alphabetical order ensures a user-friendly reference format.
> We provide in-depth coverage of all the major ASP.NET classes,
> giving you those real-world tips that the documentation doesn't
> offer, and demonstrating complex techniques with simple
> examples.
>
> ---


  Return to Index