How to show javascript alert message from asp.net code behind

Javascript is one of the most important language for webdevelopement. We need to build the interactive websites. For the desktop application Messagebox are very important thing for building interactive websites. But from server side (asp.net) we can not display messageboxes and other things. But with the help of java script we can display the alert(Messagebox) messages on our websites.

I have found a great link on this. Here is the link:

http://www.devnewz.com/devnewz-3-20061129JavaScriptAlertShowmessagefromASPNETCodebehind.html


 

Published Monday, January 28, 2008 8:03 PM by Jalpesh P. Vadgama
Filed under: , ,

Comments

# re: How to show javascript alert message from asp.net code behind

Saturday, February 23, 2008 8:02 AM by rajesh

alert message from code behind of c#

# re: How to show javascript alert message from asp.net code behind

Tuesday, March 03, 2009 4:51 AM by HsvsRsvsesv

<a href="antibiotic-guide.blogspot.com/.../a>

# re: How to show javascript alert message from asp.net code behind

Tuesday, March 03, 2009 3:50 PM by HsvsRsvsesv

<a href="antiviral-therapy.blogspot.com/.../a>

# re: How to show javascript alert message from asp.net code behind

Tuesday, March 03, 2009 9:32 PM by HsvsRsvsesv

<a href="birth-control-s.blogspot.com/">Ortho Evra</a>

# re: How to show javascript alert message from asp.net code behind

Tuesday, October 13, 2009 3:36 AM by Chaitanyaa Varma

Hi from server side showing a message box is working but i want the message box header to be changed from Microsoft Internet Explorer to some text i want .

please do throw me some light to fix this...

Thanks in advance

Veeru

# re: How to show javascript alert message from asp.net code behind

Saturday, November 27, 2010 12:17 AM by Hero

<a href= gambarlucahpramugari.xxereria.in >gambar lucah pramu

# re: How to show javascript alert message from asp.net code behind

Thursday, January 13, 2011 7:39 AM by aspdotnetexample

how to use javascript alert messange from asp.net code behind

# re: How to show javascript alert message from asp.net code behind

Thursday, August 04, 2011 2:38 AM by raaghav123

Use the Following Code:

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Public Shared Sub ShowAlertMessage(ByVal msg As String)

'Display javascript-alert

Dim page As Page = TryCast(HttpContext.Current.Handler, Page)

If page IsNot Nothing Then

msg = msg.Replace("'", "\")

ScriptManager.RegisterStartupScript(page, page.GetType(), "err_msg", "alert('" & msg & "');", True)

End If

End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

CALL THE CODE BY FOLLOWING WAY...

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

ShowAlertMessage("Your Error Message Here")

Leave a Comment

(required) 
(required) 
(optional)
(required)