Dynamically create controls using AJAX
-
hi all, anyone please help me to dynamically create a server control in the form using Microsoft AJAX toolkit dll. For eg: i will type a number in a textbox, say 10, and when i click on a button called "create" 10 text boxes must be created on the form, is there any way using ajax toolkit, i have done it in post back, but i have to avoid post back. Thanks. Ali
-
hi all, anyone please help me to dynamically create a server control in the form using Microsoft AJAX toolkit dll. For eg: i will type a number in a textbox, say 10, and when i click on a button called "create" 10 text boxes must be created on the form, is there any way using ajax toolkit, i have done it in post back, but i have to avoid post back. Thanks. Ali
AJAX does a postback, so you'd do the same thing, just wrap your button in ATLAS stuff so it uses AJAX.
Christian Graus - C++ MVP
-
hi all, anyone please help me to dynamically create a server control in the form using Microsoft AJAX toolkit dll. For eg: i will type a number in a textbox, say 10, and when i click on a button called "create" 10 text boxes must be created on the form, is there any way using ajax toolkit, i have done it in post back, but i have to avoid post back. Thanks. Ali
Hi, You said you done it in postback, then you can call code behind method (which have your control creation code) using ajax. Search for AjaxPro dll file. Regards, Pavan.
-
AJAX does a postback, so you'd do the same thing, just wrap your button in ATLAS stuff so it uses AJAX.
Christian Graus - C++ MVP
Graus i know ajax does post back, but it does not do complete post back of the web form, i just wanna post back only the part of the webform with newly created textboxes, which component in the toolkit i should use?
-
Graus i know ajax does post back, but it does not do complete post back of the web form, i just wanna post back only the part of the webform with newly created textboxes, which component in the toolkit i should use?
You would just add the textboxes to the controls collection, surely ? Add a control to act as a placeholder, and add the textboxes to it. If that doesn't work, then I don't know if you can do it ( at least, not with viewstate support, you can easily return the HTML to show textboxes and add it to the page using AJAX ).
Christian Graus - C++ MVP
-
You would just add the textboxes to the controls collection, surely ? Add a control to act as a placeholder, and add the textboxes to it. If that doesn't work, then I don't know if you can do it ( at least, not with viewstate support, you can easily return the HTML to show textboxes and add it to the page using AJAX ).
Christian Graus - C++ MVP
Hi friend i'l tel u wat exactly is going on. i created aspx text boxes and buttons using code behind, as u said in a placeholder. and i know to create html textboxes and buttons using ajax dll ( using dynamic populate component), but i cannot wrap button click event for this dynamically created html button ( button1_serverclick) because dynamic populate only returns a string corresponds to html tag. if i could create button click event using dynamic populate, i wouldnt have gone for an alternate solution. but, i couldnt. thats why i am looking to create aspx buttons. hope u got the idea now. thanks Ali