string s = "document.getElementById('" + infoTextBox.ClientID + ".select();"
Page.ClientScriptBlock.RegisterStartupScript(Page. GetType(),
infoTextBox.ClientID, s);
By putting the JavaScript execution code outside of a function declaration,
it is called as soon as it is parsed.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"sajithkahawatta" <sa*************@gmail.comwrote in message
news:11*********************@d30g2000prg.googlegro ups.com...
>i want to call a java script function from code behind.
in page1.aspx page i placed script'
<script language="javascript">
function SetSelected()
{
infoTextBox.select();
}
</script>
i want to highlight text in infotextbox in some cases. so i want to
call this function within code behind.(within if statment).
how can i call this function .i tried with RegisterClientScriptBlock()
but i could not do it .but i think it can be used. can u tell me how a
java script function is called.