Display alert box from aspx.vb page (code behind)

910 views
Skip to first unread message

prats786

unread,
Mar 3, 2010, 7:31:40 AM3/3/10
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi All,

I have a aspx page. My code behind is in aspx.vb
I need to invoke the DB and compare the values and if the values are
not equal then i have to pop up a alert box.
I got the values and the comparision is done. I am unable to call the
alert box through aspx.vb.
1) Is there any way to directly pop up a message box
2) Is it possible to call a javascript through aspx.vb. If yes can u
give me a hint on how to call?

Can any one help me on this regard,
This would be of great help!!!!!!!

Cognizanti

unread,
Mar 4, 2010, 10:44:46 AM3/4/10
to dotnetde...@googlegroups.com
Page.RegisterStartupScript
(
"
ScriptDescription", _
"<script type=""text/javascript"">
alert('Login Failed. " & _

"Please try again');</script>"
)

vamsi

unread,
Mar 4, 2010, 11:39:24 AM3/4/10
to dotnetde...@googlegroups.com
This worked for me

string script = "<SCRIPT LANGUAGE='JavaScript'> ";
script += "alert(\" Successful " "\");";
script += "</SCRIPT>";
Page.RegisterClientScriptBlock("ClientScript", script);


Regards,
Vamsi.

Reply all
Reply to author
Forward
0 new messages