Home All Groups Group Topic Archive Search About
Author
2 Jul 2005 6:03 PM
Amelyan
Button btn = new Button();
btn.Attributes.Add("onClick", "prompt(\"Enter name\")");
btn.Click += new EventHandler(this.ProcessName);


How do I access string returned by javascript prompt function from inside of
my ProcessName event handler?

Author
3 Jul 2005 3:36 PM
Alvin Bruney [MVP - ASP.NET]
So this event handling occurs on the server right. But the script code
executes on the client. Even though it seems to be in the same line of code,
the two events occur across an internet boundary. So what you are asking is
really how to get the script value back on the server after the script has
fired on the client. One approach is to catch the value on the client and
assign it to a server side control so that it is submitted to the server as
part of viewstate.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
Show quoteHide quote
"Amelyan" <bamel***@wi.rr.com> wrote in message
news:uRfoMBzfFHA.3912@tk2msftngp13.phx.gbl...
> Button btn = new Button();
> btn.Attributes.Add("onClick", "prompt(\"Enter name\")");
> btn.Click += new EventHandler(this.ProcessName);
>
>
> How do I access string returned by javascript prompt function from inside
> of my ProcessName event handler?
>
>