Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4247312
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:05:27+00:00 2026-05-21T04:05:27+00:00

Well since it seems relatively difficult to send the object of a WebControl over

  • 0

Well since it seems relatively difficult to send the object of a WebControl over JSON using jquery.ajax() I’ve decided to send the name of the control as a string because I know how to do that. Then I promptly realized that, from a web service, I don’t actually know how to search for a control by ID name. Since its a service I can’t seem to get Control.FindControl() to work so does anyone have ideas or suggestions? All I’m trying to do is call a databind() on my radcombobox.

Thanks in advance!

For any of you that knows anything about asp.net/rad controls – I’m basically updating a database and want the radcombobox to be in sync with that database again after adding something, before I autoselect what was just added. Other than databind do i have to call anything to refresh that list?

Thanks again!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:05:28+00:00Added an answer on May 21, 2026 at 4:05 am

    The way i would go in this case is the following:

    1. Make some change on the data set
    2. Make a call to the web service to update the html page
    3. On the service method – i would load the same control and data bind it with the updated data set like this:
    
        // create standard webform
        Page page = new Page();
        HtmlForm form = new HtmlForm();
        page.Controls.Add(form);
        // prepare for rendering
        StringBuilder html = new StringBuilder();
        StringWriter tw = new StringWriter(html);
        HtmlTextWriter hw = new HtmlTextWriter(tw);    
    
        // load the control to render
        Control control = page.LoadControl("relativeControlPath");
        TypeOfYourControl myControl = (TypeOfYourControl)control;
        myControl.DataSet = GetUpdatedDataSet();
        myControl.DataBind();
    
        form.Controls.Add(myControl);
        // render
        HttpContext.Current.Server.Execute(page, hw, false);
    
        // pack the output as JSON
        result.Add("html", html.ToString());
        JavaScriptSerializer ser = new JavaScriptSerializer();
        string json = ser.Serialize(result);
    
        return json;
    

    4. When the ajax call receives a response from the previous step, all i have to do i s to replace the current dom element with the newly rendered one:

    
    $.ajax({
        type: 'POST',
        contentType: 'application/json; charset=utf-8',
        url: "webServiceUrl",
        data: "{'if you need a specific params to identify nature of your control':'" + data + "'}",
        dataType: 'json',
        success: function(result) {
            var output = eval('(' + result.d + ')');
            $("oldNode").remove();
            $("parentNode").append(output.html);
        }
    });
    

    This approach is generally suitable when you are dealing with composite controls and cannot control or change their behavior.
    But for general async update methods i would recommend more lightweight methods like sending serialized data over JSON and using something like jQuery templates on client side for markup generation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, since I am facing some issues with OAuth implementation, I decided to go
I represent dates using seconds (and microseconds) since 1970 as well as a time
Using C# .NET 3.5. It seems I'm not the only one, since a search
I do realize that this question seems very well known, but since I don't
Well since i installed IE 8 i get this error so i cant debug
Since the GOF book was put together well before .Net came into being, are
I am using seeds.rb to populate some State model reference data: State.create :name =>
I have this anchor locating regex working pretty well: $p = '%<a.*\s+name=(.*)\s*>(?:.*)</a>%im'; It matches
I'm wondering about HTML reuse when using Ajax (specifically Dojo). So let me set
Since C# doesn't support the optimization of recursive call very well (e.g tail recursion).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.