myButton.Attributes.Add("onClick", "alert(document.theForm." + myText.ID +
".value);");
Instead of an alert you can call your function.
--
Derek Davis
ddavis76@gmail.com
"Morten" <morten_skovgaard@hotmail.com> wrote in message
news:OX2H$t3yFHA.2960@tk2msftngp13.phx.gbl...[color=blue]
> Hi!
>
> I'm trying to have a button open a Window using javascript. I want to open
> a window pointing to a specific URL and close it imediately afterwards.
> I've registered a javascript block in my code-behind file and used this
> code:
>
> Button1.Attributes.Add("onclick", "javascript
:popup()");
> to have the button execute the script. Now my problem is that I need to
> specify a parameter for the javascript function. More precisely I want the
> content of a textbox to be sent to the javascript
:
>
> Button1.Attributes.Add("onclick", "javascript
:popup(TextBox1.Text)");
> but I can't figure out how to do this.
>
> Hope someone can help.
>
> Morten
>
>[/color]