Getting ID from asp.net runat server in jQuery

后端 未结 7 2271
执笔经年
执笔经年 2020-12-01 17:17

I\'m trying make some stuff in jQuery using ASP.NET. But the ID from runat=\"server\" is not the same as the id used in HTML.

I used to use this to get

7条回答
  •  遥遥无期
    2020-12-01 17:43

    In WebForm / HTML Page....

      
    

    In Jquery

    var UserName = $("[id*=txtUserName]").val();
    alert(UserName);
    

    100% Sure its Working for me....

提交回复
热议问题