This is a migrated thread and some comments may be shown as answers.

Real time html update with RadTextBox fails

1 Answer 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 2
George asked on 13 Nov 2014, 07:38 PM
I am attempting to make a page that creates a form using Rad controls.  This involves creating the html in code and then updating the innerhtml of a div to display the form.  This is not seem to work with rad controls.

In my asp page there is a div
<div id="JoinFormTable" runat="server"></div>

The div is updated to two ways,
one in the asp page called by on a ajax return call with some html
function GroupFromRowColumnResponse(response) {
   var data = response.d;
   $('#<%= JoinFormTable.ClientID%>').html(data.formHtml);
}
The other in the page load of the asp
protected void Page_Load(object sender, EventArgs e)
{
....
JoinFormTable.InnerHtml = group.GetJoinFormDesignHtml();
....
}

And the form html with one textbox look likes this
<table  class='FTable'><tbody><tr><td class='FColLbl'><label class='FColLblLbl'>Hours</label></td><td class='FColCtrl'><telerik:RadTextBox InputType ='Text' ID='Hours'  EmptyMessage='Hours' Runat='server'></telerik:RadTextBox></td></tr></tbody></table>

If I put this html in the asp it works fine, inserting it fails on the RadTextBox, only the Hours label shows.

When updating real time from javascript using the html function only the Hours label shows up, no errors.

When the Page_Load creates the form table on div.innerHtml, this error occurs in Chrome
Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: RadTextBox 

Can Rad controls be added in an html string in real time?

Thanks,
George

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 18 Nov 2014, 11:31 AM
Hi George,

UI for ASP.NET AJAX is a suite that offers server controls and due to the way that server control works in general in the ASP.NET AJAX framework, it is not possible to created such controls on client-side by generating HTML.

If you need to create a form dynamically, you will need to create the controls in the code-behind.


Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
George
Top achievements
Rank 2
Answers by
Konstantin Dikov
Telerik team
Share this question
or