I am trying to add a rad combo box into the custom fields of a raduploader but I'm getting some errors.
I created a javascript function that adds controls to the custom fields of the rad upload but, in order to put the rad combo box in, I need to call the render method from my server side code. I wanted to take the html that was produced in the render and put it in the table cell's inner html. The problem is that the combo box render method returns javascript functions that don't seem to work.
The error I get is: "'RadControlsNamespace' is Undefined"
The generated javscript looks like this:
"
cell.innerHtml = <div id=
"ctl02_wrapper" style="display:inline">
<!-- 2.8.4 --><script type="text/javascript" src="/WebResource.axd?d=kMNCn9DBFwUZ2PT3nr9Q8nKTfGxfqM3IzFnt6T4kZDu4u6ciNTtF77By2rZgy2esxjRhzIOLrLIYf5J1XBkdPBu0RcNwEvenr7LitxYGTM_9zU--1dBU2yjkl0u2Qlf70&t=633512827776734358"></script><div class="ComboBox_Default" id="ctl02" style="display:inline; white-space: nowrap;"><input type="text" id="ctl02_Input" name="ctl02_Input" value="" class="ComboBoxInput_Default" style="width:150px;" readonly="readonly"></input><img alt="" id="ctl02_Image" src="/WebResource.axd?d=kMNCn9DBFwUZ2PT3nr9Q8nKTfGxfqM3IzFnt6T4kZDu4u6ciNTtF77By2rZgy2eso7GBTTPlY_CgFW08xP6ilOK6Ftuf4jEzx__hxukw6JIsIH6jBcz5cAnBp-6BP6X10&amp;t=633512827776734358" class="ComboBoxImage_Default"></img><div id="ctl02_DropDownPlaceholder" style="position:absolute; display: none; z-index: 300;" class="ComboBoxDropDown_Default"><div id="ctl02_DropDown" style="overflow:auto;white-space:normal;"></div></div><span id="ctl02StyleSheetHolder" style="display:none;"></span><script type="text/javascript">RadControlsNamespace.AppendStyleSheet(false, 'ctl02', '/WebResource.axd?d=kMNCn9DBFwUZ2PT3nr9Q8nKTfGxfqM3IzFnt6T4kZDu4u6ciNTtF77By2rZgy2eso7GBTTPlY_CgFW08xP6ilLUVz9i9yv34zs8tlQJer5FL-YYvN_lmRn81TOiDQ9Yu0&t=633512827776734358');"
Below is some of the code:
private string GetJavascript()
{
RadComboBox cbo = new RadComboBox();
cbo.SkinsPath =
"";
this.Controls.Add(cbo);
StringWriter strWriter = new StringWriter();
HtmlTextWriter writer = new HtmlTextWriter(strWriter);
cbo.RenderControl(writer);
string cboRender = strWriter.ToString();
this.Controls.Remove(cbo);
string javascript = "";
javascript =
@"function addTitle(radUpload, args)
{
var row = args.Row;
var cell = row.insertCell(-1);
var text = document.createElement('span');
text.innerHTML = 'Title: ';
cell.valign = 'bottom';
cell.appendChild(text);
cell = row.insertCell(-1);
var title = document.createElement('input');
title.id = title.name = radUpload.GetID('title');
cell.appendChild(title);
cell = row.insertCell(-1);
cell.innerHtml = "
+cboRender+@";
}"
;
return javascript;
}
I would appreciate any information I could get on this.
Thanks,
Dale