Nov 10, 2011

How to register the JavaScript function at Code-Behind


Use ResterStartupScript
this.Page.ClientScript.RegisterStartupScript(this.GetType(),"alert","<script>alert(‘hello’);</script>");
Use Literal control,
private void Button2_Click(object sender, System.EventArgs e)
{
    string str;
    str="<script language='JavaScript'>";       
    str+="selectRange()";
        str+="<script>";
    Literal1.Text=str;
}
Related posts:

0 comments:

Post a Comment

Your comments:

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More