Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2004, 12:34 AM
Authorized User
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks everybody!
 
Old April 6th, 2004, 01:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

DOES this Thanks means that u solve ur problem?!

Always:),
Hovik Melkomian.
 
Old April 6th, 2004, 05:46 AM
Registered User
 
Join Date: Oct 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The easiest way to show a msgbox in asp.net is the next:
Response.Write("<script>alert('Text')</script>")

You can use a msgbox object but it has some problems.

 
Old April 6th, 2004, 06:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Its fine, but depends to the button!
What about the times when there is no button?!

Always:),
Hovik Melkomian.
 
Old April 7th, 2004, 03:01 AM
Authorized User
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i have tested, if button, you can use "Response.Write("<script>alert('Text')</script>")", if no button, such as in your edit column of a datagrid, i think you can use "button.Attributes.Add("onclick", "window.alert('text');")",but i have not tested.
 
Old April 7th, 2004, 04:32 AM
Registered User
 
Join Date: Oct 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use Response.Write(...) with button and without button.

If you want to show your message by clicking on your datagrid
column you only have to catch the event and show the message with response.write(....). You don´t need to add de attribute.

greetings:D



 
Old May 4th, 2004, 03:25 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

brzhang:

To validate you can use next to your textbox....
<asp:RequiredFieldValidator id="NameOfTheID" runat="server" ErrorMessage="'The username can't be NULL!"></asp:RequiredFieldValidator>

 
Old June 7th, 2004, 06:47 AM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have always used this for displaying a messagebox
Works fine !

Public Sub AlertUser(ByVal strMessage As String)
   Dim strScript As String

   strScript = "<script>"
   strScript = strScript & "alert('" & strMessage & "');"
   strScript = strScript & "</script>"

   Page.RegisterStartupScript("ClientScript", strScript)
End Sub

 
Old March 20th, 2008, 01:23 PM
Registered User
 
Join Date: Mar 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ScepterMT Send a message via Yahoo to ScepterMT
Default

The best way I've found to do this is to create a static class MessageBox with a static method Show(), which will give you the ablility to to still use the syntax MessageBox.Show("Your Message"); and convert it into window.alert("Your Message");.

The javascript alert() function is limited as it doesn't provide any overloads for changing the caption of the MessageBox, but it still works nicely.

I've written a how to on my blog at: http://sceptermt.blogspot.com/2008/0...lass-in-c.html that shows the source code that I used in C# for my web application and details on how it works.

You could also write overloads for the static show() method to allow the class to do a javascript confirm() or a prompt(). I haven't needed that functionality yet so I've just kept it simple.

Check This out: http://www.sceptermarketingtechnologies.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Msgbox Help darrenb Access VBA 2 June 8th, 2007 12:53 AM
MsgBox prabodh_mishra Pro VB 6 1 December 29th, 2006 11:51 AM
msgbox Ramakrishna.G General .NET 3 September 14th, 2004 02:17 AM
help with Msgbox helmekki Excel VBA 2 June 25th, 2004 08:24 AM
msgbox bph Access VBA 2 February 6th, 2004 03:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.