If you want to alert some thing then this will be very useful to you.:
Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "javascript:alert('sss');", true);
If you want to call a javascript function then this will be very useful to you.:
In code behind page:(aspx.cs)
Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "myJavaScriptFunction()", true);
In (aspx):
<script type="text/javascript">
function myJavaScriptFunction()
{
//Do your javascript here
}
</script>
Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "javascript:alert('sss');", true);
If you want to call a javascript function then this will be very useful to you.:
In code behind page:(aspx.cs)
Page.ClientScript.RegisterStartupScript(this.GetType(), "Call my function", "myJavaScriptFunction()", true);
In (aspx):
<script type="text/javascript">
function myJavaScriptFunction()
{
//Do your javascript here
}
</script>
Hi,
ReplyDeleteIf this post is helpful to you then please rate this.
Thanks
Sibasis
Thanks for your sharing.
ReplyDelete