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 8968483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:27:38+00:00 2026-06-15T17:27:38+00:00

I am dynamically adding a jQuery multiselect control onto a page like this: var

  • 0

I am dynamically adding a jQuery multiselect control onto a page like this:

 var captionCell = new HtmlTableCell { InnerHtml = control.Caption };
 var inputCell = new HtmlTableCell();
 inputCell.Controls.Add(inputControl);
 var row = new HtmlTableRow();
 row.Cells.Add(captionCell);
 row.Cells.Add(inputCell);
 tbl.Rows.Add(row);

And building my javascript string like this:

 StringBuilder sb = new StringBuilder();
 sb.AppendLine("<script type=\"text/javascript\">");
 sb.AppendLine("var $callback = $(\"#callback\");");
 sb.AppendLine("$(document).ready(function () {");
 sb.Append("$(\"#");
 sb.Append(multiSelectControl.ClientID);
 sb.AppendLine("\").multiselect(");
 sb.AppendLine("{");
 sb.AppendLine("show: \"fade\",");
 sb.AppendLine("hide: \"fade\",");
 sb.AppendLine("click: function (event, ui){");
 sb.AppendLine("$callback.text(ui.text + ' ' + (ui.checked ? 'checked' : 'unchecked'));");
 sb.AppendLine("},");
 sb.AppendLine("});");
 sb.AppendLine("});");
 sb.AppendLine("</script>");

Then adding the script to the page like this:

ScriptManager.RegisterClientScriptBlock(this.Page, Page.GetType(), "CreateControl" + inputControl.ClientID,
                            sb.ToString(), false);

But im getting the following error when trying to do this:

Microsoft JScript runtime error: Object doesn’t support this property or method

Please assist guys.

Thanks in advance.

enter image description here

  • 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-06-15T17:27:38+00:00Added an answer on June 15, 2026 at 5:27 pm

    I solved this by creating a user control, and when I need to use the script above I just loaded the user control.

    Solved everything and works really well.

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

Sidebar

Related Questions

I'm adding a table dynamically to JQuery MObile UK Table goes on like this
I am dynamically adding X canvas elements to a page via jQuery like so:
I use jquery for adding table dynamically and I use this pattern: var tbl
I am creating some thumbnails dynamically with JQuery, like this (in a loop): var
With jquery, I'm dynamically adding rows. To do this, I'm copying the first of
I'm using jQuery to dynamically add new divs containing a few fields. I'm adding
I am currently dynamically adding content to the page with the help of Jquery.
In this jQuery code , I am dynamically adding boxes to the canvas div
I am dynamically adding columns to a table by using document.createElement(th) var newTH =
I am dynamically adding labels to a form and I would like to set

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.