Real time html update with RadTextBox fails

2 posts, 1 answers
  1. George
    George avatar
    70 posts
    Member since:
    Oct 2014

    Posted 13 Nov 2014 Link to this post

    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?

  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    1744 posts

    Posted 18 Nov 2014 Link to this post

    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

    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.

  3. DevCraft R3 2016 release webinar banner
Back to Top