New to Javascript in ASP.Net

Discussion in 'ASP .Net' started by Dave, Oct 14, 2009.

  1. Dave

    Dave Guest

    I have a web page that I'm trying to lauch another page in the same
    web using window.open. Setting up the Javascript on a single page
    isn't the issue. Where do I place the function when I'm using a
    master page?
     
    Dave, Oct 14, 2009
    #1
    1. Advertising

  2. On Oct 15, 12:01 am, Dave <> wrote:
    > I have a web page that I'm trying to lauch another page in the same
    > web using window.open.  Setting up the Javascript on a single page
    > isn't the issue.  Where do I place the function when I'm using a
    > master page?


    Dave, if you need to call it on startup then you can use
    RegisterStartupScript to add your script from the content page

    protected void Page_Load(object sender, EventArgs e)
    {
    const string someScript = "alertMe";
    if (!ClientScript.IsStartupScriptRegistered(this.GetType(),
    someScript))
    {
    ClientScript.RegisterStartupScript(this.GetType(),
    someScript, "alert('I was called from Content
    page!')", true);
    }
    }
     
    Alexey Smirnov, Oct 15, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flare
    Replies:
    1
    Views:
    510
    William F. Robertson, Jr.
    Sep 21, 2004
  2. Adrian Bezzina
    Replies:
    0
    Views:
    406
    Adrian Bezzina
    Jan 18, 2005
  3. Replies:
    3
    Views:
    488
    Mark Rae
    Jun 2, 2007
  4. Ann
    Replies:
    0
    Views:
    173
  5. Replies:
    2
    Views:
    509
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page