开发者

Can I use <asp:textbox> in innerHTML?

开发者 https://www.devze.com 2023-04-11 19:09 出处:网络
I have dropdownlist and I have added javascript to show the contents(e.g.开发者_运维知识库 person 1, person 2 etc).

I have dropdownlist and I have added javascript to show the contents(e.g.开发者_运维知识库 person 1, person 2 etc). I used below the code but textbox wasn't displayed.

innerHtml = innerHtml + <asp:TextBox runat=server ID=txtName3 MaxLength=100 Text=''></asp:TextBox>


No, you cannot, as ASP.NET controls are executed on the server, not on the client.

You can add HTML input tag instead.

What you probably want to do is to use UpdatePanel to refresh part of your page after changing selection in dropdown.

0

精彩评论

暂无评论...
验证码 换一张
取 消