javascript alert on dropdown change event

Posted by RohiK under ASP.NET on 11/4/2011 | Points: 10 | Views : 2191 | Status : [Member] | Replies : 2
Hi and good morning,

I want to display javascript alert or some message like validation after dropdown selection changed.
I have to do some calculations on code behind side and then throw an javascript alert
I am using asp.net with language vb

currently I am doing like on dropdown selected index changed event

Dim strMessage = "alert message"
Dim jscript As String
jscript = "<script language=JavaScript>alert('" + strMessage + "')<" & "/" & "script>"
'RegisterClientScriptBlock("scr", jscript)
Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "scr", jscript)


but this will come first and then the page gets loaded.
I want to show like notification or message not like this which will stop remaining execution.

how to do that?

Happy Programming!!
Rohi



Responses

Posted by: Blessyjees on: 11/4/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

Where you are putting this code. is it after the C# code .

Blessy Baby
Digitalmesh Softech pvt Ltd
https://blessybaby.wordpress.com/

RohiK, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RohiK on: 11/8/2011 [Member] Starter | Points: 25

Up
0
Down
hi,

thanks for your reply.
I am using vb.net. I use this code in custom validation function.

Happy Programming!!
Rohi

RohiK, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response