RegisterClientScripts not working???

  • Thread starter Thread starter Darren Clark
  • Start date Start date
D

Darren Clark

If i put the following code into the page load event on a page...
it works and registers the script..

HOWEVER

if i put this insde a custom server control it does not work?
any ideas?


string script = "<script language=javascript>\r\n";

script += "function StoreValue(itemID, sender)\r\n";

script += "{\r\n";

script += " var o = document.getElementById(itemID);\r\n";

script += " o.value = sender.innerHTML;\r\n";

script += "}\r\n";

script += "//-->\r\n";

script += "</script>\r\n";

this.Page.RegisterClientScriptBlock("WB_Input_JS",script);
 
Where in the custom you run the code? You are running this before Render
phase in the custom control?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top