UserControl (ascx) - Using Javsscript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an ascx.

I have some client side JS on the ascx itself.

I want this to run each time my control is loaded.

How can I do this?
 
protected void Page_Load(object sender, EventArgs e)
{
this.Page.RegisterStartupScript("something", "<script
type=\"text/javascript\">alert('I ran.')</script>");
}

Ray at work
 

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