|
-
Dec 1st, 2004, 03:14 AM
#1
Thread Starter
Fanatic Member
Newbie - how to create client side's message box
Dear all,
I am very new with ASP.NET .. how to create client side's message box? .. please help
TIA
Regards
Winanjaya
-
Dec 1st, 2004, 11:40 AM
#2
Fanatic Member
use javascript. basically, use an alert function within the body of the page itself.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Dec 1st, 2004, 12:42 PM
#3
Code:
<script language="JavaScript">
alert('Hello Cruel World!');
</script>
Of course, there are many places you'd use it. Like the onClick event of a button, or page load event, etc.
-
Dec 1st, 2004, 06:21 PM
#4
Thread Starter
Fanatic Member
So there is no ASP.NET code for doing this? ..
please advise
Regards
Winanjaya
-
Dec 1st, 2004, 11:42 PM
#5
It depends. Where and when do you want this shown?
-
Dec 2nd, 2004, 12:38 AM
#6
Thread Starter
Fanatic Member
I want to show it at client side.. any idea?
thanks
-
Dec 2nd, 2004, 12:59 AM
#7
VB Code:
Button1.Attributes.Add("onClick", "javascript:alert('Hello');")
Or make it a call to an existing function.
-
Dec 2nd, 2004, 01:18 AM
#8
Thread Starter
Fanatic Member
Where should I put them? .. in Page_load or what? .. please advise .. sorry I am very new with this..
thanks a lot in advance
-
Dec 2nd, 2004, 01:34 AM
#9
Sure, put it in page load. That vb.net code above adds this:
<input type="button" value="Click me!" onClick="javascript:alert('hello');>
-
Dec 4th, 2004, 12:40 AM
#10
New Member
Re: Newbie - how to create client side's message box
hi,
you could do a little futher on that, you could do it in an event doing something like this
dim sScript as string="<script language=javascript>"
sScript +="alert(""" your message variable or otherwise """");"
sScript +="</script>"
If not Page.IsStartupScriptRegistered("nameofyourscript") then
page.registerstartupscript("nameofyourscript",sScript)
end if
end sub
Just be aware that when you try to find the isstartupscriptregistered and the registerstartupscript with the inteligicence you wouldn't find then so you have to type them all
Hope this helps a little bit more
Ben
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|