Groups | Blog | Home
all groups > asp.net > november 2003 >

asp.net : Passing a text string from the server side to a client side function


ken busse
11/23/2003 8:26:20 PM
I would like to be able to write a string value to a
variable on the server side and have it passed to the
client side for display in an alert box.
I've tried writing to a Server control label and reading
it in client side script but can't get it working.
I've tried passing a form variable that has the residing
label but that doesn't work.
Do you have any suggestions?
Raj
11/23/2003 8:43:05 PM
Well You can store the string message in a Hidden
Field . This hidden variable can be access using a
scripts .

HTH
Raj

[quoted text, click to view]
lukezhan NO[at]SPAM online.microsoft.com
11/24/2003 8:18:46 AM
Hi Ken,

You may write some script like:

<Scrip>

alert("hello");

</Script>

to client side with the method registerclientscriptblock. For more
information on it, you may refer to:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.asp

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
AddThis Social Bookmark Button