jeeunit02
jeeunit02

Reputation: 155

Can I use <asp:textbox> in innerHTML?

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>

Upvotes: 1

Views: 1357

Answers (1)

Jakub Konecki
Jakub Konecki

Reputation: 46008

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.

Upvotes: 3

Related Questions