From: aspfun via DotNetMonster.com on
How to convert a javascripts below to use in code behind form?

<script type="text/javascript">
document.getElementById('Ok').disabled = true;
setTimeout(function(){
document.getElementById('Ok').disabled = false;
}, 15000);
</script>

Convert to:

Dim strJScript As New StringBuilder
strJScript.Append("document.getElementById('" + Ok.ClientID + "').disabled
=true;")

//help to convert below code:

------

setTimeout(function(){
document.getElementById('Ok').disabled = false;
}, 15000);


------
ClientScript.RegisterStartupScript(Me.GetType(), "myCode", strJScript.
ToString(), True)

--
Message posted via http://www.dotnetmonster.com

From: Scott M. on
Just do exactly what you did with the first chunk of code, embed it as a
string in a StringBuilder and then send it to the client. There's really no
"conversion" here at all, just sending client code to the client from the
server.

-Scott


"aspfun via DotNetMonster.com" <u53138(a)uwe> wrote in message
news:a42b47f47991d(a)uwe...
> How to convert a javascripts below to use in code behind form?
>
> <script type="text/javascript">
> document.getElementById('Ok').disabled = true;
> setTimeout(function(){
> document.getElementById('Ok').disabled = false;
> }, 15000);
> </script>
>
> Convert to:
>
> Dim strJScript As New StringBuilder
> strJScript.Append("document.getElementById('" + Ok.ClientID + "').disabled
> =true;")
>
> //help to convert below code:
>
> ------
>
> setTimeout(function(){
> document.getElementById('Ok').disabled = false;
> }, 15000);
>
>
> ------
> ClientScript.RegisterStartupScript(Me.GetType(), "myCode", strJScript.
> ToString(), True)
>
> --
> Message posted via http://www.dotnetmonster.com
>


From: Alexey Smirnov on
On Feb 25, 5:47 pm, "aspfun via DotNetMonster.com" <u53138(a)uwe> wrote:
> How to convert a javascripts below to use in code behind form?
>
> <script type="text/javascript">
> document.getElementById('Ok').disabled = true;
> setTimeout(function(){
>   document.getElementById('Ok').disabled = false;}, 15000);
>
> </script>
>
> Convert to:
>
> Dim strJScript As New StringBuilder
> strJScript.Append("document.getElementById('" + Ok.ClientID + "').disabled
> =true;")
>
> //help to convert below code:
>
> ------
>
> setTimeout(function(){
>   document.getElementById('Ok').disabled = false;
>
> }, 15000);
>
> ------
> ClientScript.RegisterStartupScript(Me.GetType(), "myCode", strJScript.
> ToString(), True)
>
> --
> Message posted viahttp://www.dotnetmonster.com

Dim strJScript As String
strJScript = "setTimeout(function()
{document.getElementById('Ok').disabled = false;}15000);"