开发者

How to retrieve values of dynamically created controls in code behind?

I intend to use Javascript to dynamically create a group of html elements (input boxes, select list, radio button, etc.) each time the user clicks "Add More" button.

I have found the Javascript that does that here:

  • http://viralpatel.net/blogs/2009/01/dynamic-add-textbox-input-button-radio-element-html-javascript.html
  • htt开发者_如何学编程p://forums.asp.net/p/1611284/4118564.aspx

So how do I get the values of these dynamically created HTML elements from code-behind? Is there a JQuery way which is better?

Thank you.


I think you'd may be able to do it with a callback/async postback to your ASP.NET page to update the control tree as you update. Not sure how the ViewState is updated/affected by this.

Otherwise, because your messing with the ViewState, so you'll need to revert to accessing them by the Request.Form object.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜