What you want to do is not directly possible. You'll have to develop a
"proxy" page or something that executes the client side java script to
retrieve the values that you want and stores the results in a hidden field
and automatically posts (see form.submit()) the form back to the server
which, in turn stores the values of the hidden fields in (most likely) a
session object then redirects the user to the page with which s/he will
interact.
If you are trying to just place a timestamp when the user posts the form,
you wouldn't need a proxy page, you could just add a client side submit
event handler that executes the code you want and saves it in a hidden
field. Never underestimate the power of DHTML.
--
Dave Fancher
http://davefancher.blogspot.com
"ACaunter" <Ad****@hotmail.com> wrote in message
news:D4**********************************@microsof t.com...
thanks for the reply...
I'm trying to get the user's time (hours and minutes).. and my code is in
the page load, not a button (sorry),... how can i call this function , not
to
show it in a messagebox, but to just store it... like:
dim x as string = javafunction()
i have 2 seperate function , 1 for hour and 1 for minute...
"Dave Fancher" wrote:
In your Page_Load event you can add a line such as the following:
[C#]
button.Attributes["onclick"] = "alert(myFunc());";
or
button.Attributes.Add("onclick", "alert(MyFunc());");
This will manipulate the HTML output to include the client side event
handler.
HTH
----
Dave Fancher
http://davefancher.blogspot.com
"ACaunter" wrote:
> Hi there,
> Is there a way to call a javascript function and return its value, from
> inside an asp.net button ??
>
> --
> Ad****@hotmail.com