Create javascript method dynamically

//Create javascript method dynamically


//create a scring variable and write your javascript code with dynamic values
string focusScript = "<script language='javascript'>" +
"window.opener.document.getElementById('" + checkval + "').value = '" + Hidden1.Value + "';"
+ "window.opener.document.getElementById('" + checkval5 + "').value = '" + dg + "';"
+ "window.close();"
+ "</script>";


// Add the JavaScript code to the page.

if (!ClientScript.IsStartupScriptRegistered("FocusScript"))
ClientScript.RegisterStartupScript(typeof(Page), "FocusScript", focusScript);


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: