Passing arguments to JavaScript function from code-behind

前端 未结 9 2025
孤街浪徒
孤街浪徒 2020-12-03 17:54

I would like to call a javascript function from an aspx control. For instance, suppose I had:


    

        
9条回答
  •  执笔经年
    2020-12-03 18:39

    
    
        Call java script function on Code behind
        
    
    

    cs code

    protected void Page_Load(object sender, EventArgs e)
    {
        TextBox2.Attributes.Add("onkeypress", "return abc();");
    }
    

    try this

提交回复
热议问题