Client script call

liunx

Guest
Hi

I want to access a javascript within my ASP.net 2.0 code.

The script is not linked to a button or links of some sort. I want the javascript executed within the code.

if (teller == 0)
{
txtbla.text = ok
}
else
{
Access JAVASCRIPT
}

I trie dthe following, but doens't work.


script = "function showAlert(){alert('test');}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "showAlert", script, true);
Response.Redirect("shop.aspx?CLID=" + ItemID + "&IMID=" + IMID.ToString());


thxi came accross this page, see if it helps:
<!-- m --><a class="postlink" href="http://www.dotnetjohn.com/articles.aspx?articleid=182try">http://www.dotnetjohn.com/articles.aspx ... eid=182try</a><!-- m --> to use Response.write(script) instead of Page.ClientScript.RegisterClientScriptBlock
you also can try to write all you javascript code in Script variable then use Response.write
 
Back
Top