JavaScript file

Discussion in 'ASP .Net Web Controls' started by ruca, Mar 4, 2004.

  1. ruca

    ruca Guest

    I have a JS file, where I have show_clock function to call. I calling
    her like this<body onload="show_clock()">, but nothing happens. The clock
    don't appear.

    In your opinion what should I do? Use "RegisterClientScriptBlock" and/or
    "RegisterStartupScript".? If yes, how can I use them?


    --

    Thank's (if you try to help me)
    Hope this help you (if I try to help you)
    ruca
     
    ruca, Mar 4, 2004
    #1
    1. Advertising

  2. I need to look at the documentation, but one of the two runs prior to the
    HTML being written out. This is not the one you want to use. The other puts
    the script at the end of the load, which is what you will want. I believe
    the RegisterClientScriptBlock is the correct one to have it run after the
    HTML is written out, but would have to check the docs to see.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    **********************************************************************
    Think Outside the Box!
    **********************************************************************
    "ruca" <> wrote in message
    news:...
    > I have a JS file, where I have show_clock function to call. I calling
    > her like this<body onload="show_clock()">, but nothing happens. The clock
    > don't appear.
    >
    > In your opinion what should I do? Use "RegisterClientScriptBlock" and/or
    > "RegisterStartupScript".? If yes, how can I use them?
    >
    >
    > --
    >
    > Thank's (if you try to help me)
    > Hope this help you (if I try to help you)
    > ruca
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Mar 4, 2004
    #2
    1. Advertising

  3. RegisterClientScriptBlock() puts the script just after the <form> tag on the
    page. RegisterStartupScript() puts the script just before the </form> tag in
    the page.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Cowboy (Gregory A. Beamer)" <> wrote in
    message news:...
    > I need to look at the documentation, but one of the two runs prior to the
    > HTML being written out. This is not the one you want to use. The other

    puts
    > the script at the end of the load, which is what you will want. I believe
    > the RegisterClientScriptBlock is the correct one to have it run after the
    > HTML is written out, but would have to check the docs to see.
    >
    > --
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > **********************************************************************
    > Think Outside the Box!
    > **********************************************************************
    > "ruca" <> wrote in message
    > news:...
    > > I have a JS file, where I have show_clock function to call. I calling
    > > her like this<body onload="show_clock()">, but nothing happens. The

    clock
    > > don't appear.
    > >
    > > In your opinion what should I do? Use "RegisterClientScriptBlock" and/or
    > > "RegisterStartupScript".? If yes, how can I use them?
    > >
    > >
    > > --
    > >
    > > Thank's (if you try to help me)
    > > Hope this help you (if I try to help you)
    > > ruca
    > >
    > >

    >
    >
     
    Kevin Spencer, Mar 4, 2004
    #3
  4. ruca

    ruca Guest

    Right.
    But I still don't know how and where to use one of them. Where should I call
    them?



    --

    Thank's (if you try to help me)
    Hope this help you (if I try to help you)
    ruca

    "Kevin Spencer" <> escreveu na mensagem
    news:...
    > RegisterClientScriptBlock() puts the script just after the <form> tag on

    the
    > page. RegisterStartupScript() puts the script just before the </form> tag

    in
    > the page.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Big things are made up
    > of lots of little things.
    >
    > "Cowboy (Gregory A. Beamer)" <> wrote in
    > message news:...
    > > I need to look at the documentation, but one of the two runs prior to

    the
    > > HTML being written out. This is not the one you want to use. The other

    > puts
    > > the script at the end of the load, which is what you will want. I

    believe
    > > the RegisterClientScriptBlock is the correct one to have it run after

    the
    > > HTML is written out, but would have to check the docs to see.
    > >
    > > --
    > > Gregory A. Beamer
    > > MVP; MCP: +I, SE, SD, DBA
    > >
    > > **********************************************************************
    > > Think Outside the Box!
    > > **********************************************************************
    > > "ruca" <> wrote in message
    > > news:...
    > > > I have a JS file, where I have show_clock function to call. I calling
    > > > her like this<body onload="show_clock()">, but nothing happens. The

    > clock
    > > > don't appear.
    > > >
    > > > In your opinion what should I do? Use "RegisterClientScriptBlock"

    and/or
    > > > "RegisterStartupScript".? If yes, how can I use them?
    > > >
    > > >
    > > > --
    > > >
    > > > Thank's (if you try to help me)
    > > > Hope this help you (if I try to help you)
    > > > ruca
    > > >
    > > >

    > >
    > >

    >
    >
     
    ruca, Mar 5, 2004
    #4
  5. ruca

    ruca Guest

    Can you help me, please. I'm a litle urgency on that and I don't know what
    to do.

    Thanks
    Ruca

    "Kevin Spencer" <> escreveu na mensagem
    news:...
    > RegisterClientScriptBlock() puts the script just after the <form> tag on

    the
    > page. RegisterStartupScript() puts the script just before the </form> tag

    in
    > the page.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Big things are made up
    > of lots of little things.
    >
    > "Cowboy (Gregory A. Beamer)" <> wrote in
    > message news:...
    > > I need to look at the documentation, but one of the two runs prior to

    the
    > > HTML being written out. This is not the one you want to use. The other

    > puts
    > > the script at the end of the load, which is what you will want. I

    believe
    > > the RegisterClientScriptBlock is the correct one to have it run after

    the
    > > HTML is written out, but would have to check the docs to see.
    > >
    > > --
    > > Gregory A. Beamer
    > > MVP; MCP: +I, SE, SD, DBA
    > >
    > > **********************************************************************
    > > Think Outside the Box!
    > > **********************************************************************
    > > "ruca" <> wrote in message
    > > news:...
    > > > I have a JS file, where I have show_clock function to call. I calling
    > > > her like this<body onload="show_clock()">, but nothing happens. The

    > clock
    > > > don't appear.
    > > >
    > > > In your opinion what should I do? Use "RegisterClientScriptBlock"

    and/or
    > > > "RegisterStartupScript".? If yes, how can I use them?
    > > >
    > > >
    > > > --
    > > >
    > > > Thank's (if you try to help me)
    > > > Hope this help you (if I try to help you)
    > > > ruca
    > > >
    > > >

    > >
    > >

    >
    >
     
    ruca, Mar 5, 2004
    #5
  6. Here's a link to the freely downloadable Microsoft .Net SDK (Software
    Development Kit), which documents these functions as well as the entire CLR
    (Common Language Runtime Library), and includes examples, tutorials, and
    articles to help you.

    http://www.microsoft.com/downloads/...A6-3647-4070-9F41-A333C6B9181D&displaylang=en

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "ruca" <> wrote in message
    news:...
    > Can you help me, please. I'm a litle urgency on that and I don't know what
    > to do.
    >
    > Thanks
    > Ruca
    >
    > "Kevin Spencer" <> escreveu na mensagem
    > news:...
    > > RegisterClientScriptBlock() puts the script just after the <form> tag on

    > the
    > > page. RegisterStartupScript() puts the script just before the </form>

    tag
    > in
    > > the page.
    > >
    > > --
    > > HTH,
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > Big things are made up
    > > of lots of little things.
    > >
    > > "Cowboy (Gregory A. Beamer)" <> wrote

    in
    > > message news:...
    > > > I need to look at the documentation, but one of the two runs prior to

    > the
    > > > HTML being written out. This is not the one you want to use. The other

    > > puts
    > > > the script at the end of the load, which is what you will want. I

    > believe
    > > > the RegisterClientScriptBlock is the correct one to have it run after

    > the
    > > > HTML is written out, but would have to check the docs to see.
    > > >
    > > > --
    > > > Gregory A. Beamer
    > > > MVP; MCP: +I, SE, SD, DBA
    > > >
    > > > **********************************************************************
    > > > Think Outside the Box!
    > > > **********************************************************************
    > > > "ruca" <> wrote in message
    > > > news:...
    > > > > I have a JS file, where I have show_clock function to call. I

    calling
    > > > > her like this<body onload="show_clock()">, but nothing happens. The

    > > clock
    > > > > don't appear.
    > > > >
    > > > > In your opinion what should I do? Use "RegisterClientScriptBlock"

    > and/or
    > > > > "RegisterStartupScript".? If yes, how can I use them?
    > > > >
    > > > >
    > > > > --
    > > > >
    > > > > Thank's (if you try to help me)
    > > > > Hope this help you (if I try to help you)
    > > > > ruca
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Kevin Spencer, Mar 5, 2004
    #6
  7. ruca

    Cor Guest

    Hi Ruca,

    Two samples in one.
    Needs a label1 on a page and a HTML textbox with the name HTMLtextbox1

    Private Sub Page_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
    Dim scriptString As String = "<script language=JavaScript>" & _
    "function ShowText() {document.Form1.HTMLTextBox1.value " & _
    "= 'I hope this helps?'}" & _
    "</script>"
    Page.RegisterClientScriptBlock("clientScript", scriptString)

    Dim str As String = "<script language " & _
    "=javascript>alert('I hope this helps a little bit?');</script>"
    Page.RegisterStartupScript("Startup", str)
    Me.Label1.Text = "Does this works<br>I hope"

    End Sub
    I hope this helps a little bit?

    Cor
     
    Cor, Mar 5, 2004
    #7
    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. Cold Filtered
    Replies:
    0
    Views:
    465
    Cold Filtered
    Feb 18, 2005
  2. Dhanasankar S via DotNetMonster.com

    How to read the BODY of HTML file from another HTML file using javascript?

    Dhanasankar S via DotNetMonster.com, Feb 26, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    490
    =?Utf-8?B?dHBlcnJp?=
    Feb 28, 2005
  3. Erik Jälevik

    JavaScript in .XML file vs .HTML file

    Erik Jälevik, Nov 5, 2003, in forum: Javascript
    Replies:
    1
    Views:
    91
    Martin Honnen
    Nov 6, 2003
  4. Antonio
    Replies:
    2
    Views:
    130
    Antonio
    May 21, 2004
  5. vunet
    Replies:
    2
    Views:
    164
    Laser Lips
    Jul 8, 2008
Loading...

Share This Page