how to give javascript message from asp.net

Posted by Abdulazeem_it under ASP.NET on 6/7/2009 | Views : 3141 | Status : [Member] | Replies : 5
Hi,

how to give javascript message from asp.net

Thanks
-abdul




Responses

Posted by: Majith on: 6/8/2009 [Member] Starter

Up
0
Down
Greetings Abdulazeem,

try this,

 Response.Write("<script>" + "alert('Sample Message');" + "</script>");


Thanks

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

Posted by: Vuyiswamb on: 6/8/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Abdulazeem_it

Majith is correct , but there is a Catch 22 if your uses have Disabled Javascript from their browser. it is better to Display messages through label controls than Alert as demostrated , because the application might bring the undesired results.

Thank you for using DotnetFunda


Vuyiswa Maseko



Thank you for posting at Dotnetfunda
[Administrator]

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

Posted by: Abdulazeem_it on: 6/8/2009 [Member] Starter

Up
0
Down
Thanks for the respons guys

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

Posted by: Vikranth4u on: 6/8/2009 [Member] Starter

Up
0
Down
Hi Abdul,

try any one of these tow

ScriptManager.RegisterClientScriptBlock(Page,typeof(Page),"clentscript","alert('hi')",true)

( OR)
ClientScript.RegisterClientScriptBlock(typeof(Page),"clentscript","alert('hi')",true)


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

Posted by: Abdulazeem_it on: 6/9/2009 [Member] Starter

Up
0
Down
Thanks, it worked out.

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

Login to post response