RegisterStartupScript

Discussion in 'ASP .Net' started by Lukman, Feb 18, 2004.

  1. Lukman

    Lukman Guest

    Hi,
    Could you tell me about what is RegisterStartupScript, I try to understand
    from MSDN sample, but I still don't understand. Could you give me more
    simple sample ? and what is the purpose of RegisterStartupScript.
    Thanks,
    Lukman, Feb 18, 2004
    #1
    1. Advertising

  2. There's an example in an article that I wrote some time ago:

    http://www.ftponline.com/vsm/2002_07/magazine/columns/aspnet/page5.aspx


    RegisterArrayDeclaration Inserts an array declaration into the HTML code,
    including the <script> tags. Accepts both the array name and a
    comma-separated list of values as a string.

    RegisterClientScriptBlock Inserts a block of client-side code within the
    HTML form. The first parameter is an identifying name for the block as a
    string. The second parameter is a string containing the script to be sent to
    the client. You must include the <script> tags.

    RegisterHiddenField Inserts a hidden input field with the HTML form. The
    first parameter is a string that provides the input control's name. The
    second parameter, also a string, is the field's initial value. In the
    rendered content, this field appears just before ASP.NET's hidden
    "__VIEWSTATE" field.

    RegisterOnSubmitStatement Inserts an OnSubmit attribute into the page's
    <form> tag and the script to be called as its value. The first parameter is
    a unique identifier for the script as a string. The second value is the
    statement or function called. This creates inline code, so no <script> tags
    are allowed.

    RegisterStartupScript Inserts a script block just before the closing </form>
    tag. The first parameter is a unique identifier for the script as a string.
    The second parameter, also a string, is the complete script including the
    <script> tags.


    "Lukman" <> wrote in message
    news:%23o9$...
    > Hi,
    > Could you tell me about what is RegisterStartupScript, I try to understand
    > from MSDN sample, but I still don't understand. Could you give me more
    > simple sample ? and what is the purpose of RegisterStartupScript.
    > Thanks,
    >
    >
    >
    Ken Cox [Microsoft MVP], Feb 18, 2004
    #2
    1. Advertising

  3. Lukman

    bruce barker Guest

    their are a couple Register script methods. basically they control where the
    script is genereated, and to help support controls that need javascript,
    they are named, so the code is only generated once.

    <html>
    <body>
    <form onsubmit="// RegisterOnSubmitStatement - goes here">
    <!-- RegisterArrayDeclaration goes here - before any script -->
    <!-- RegisterClientScriptBlock goes here - before any form controls -->

    ......
    ......

    <!-- RegisterStartupScript goes here, after all form controls -->
    </form>
    </body>
    </html>

    -- bruce (sqlwork.com)


    "Lukman" <> wrote in message
    news:#o9$...
    > Hi,
    > Could you tell me about what is RegisterStartupScript, I try to understand
    > from MSDN sample, but I still don't understand. Could you give me more
    > simple sample ? and what is the purpose of RegisterStartupScript.
    > Thanks,
    >
    >
    >
    bruce barker, Feb 18, 2004
    #3
  4. Lukman

    Lukman Guest

    Thanks Ken, the article is really helpful. Where can I find others articles
    from you ?

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:u%...
    > There's an example in an article that I wrote some time ago:
    >
    > http://www.ftponline.com/vsm/2002_07/magazine/columns/aspnet/page5.aspx
    >
    >
    > RegisterArrayDeclaration Inserts an array declaration into the HTML code,
    > including the <script> tags. Accepts both the array name and a
    > comma-separated list of values as a string.
    >
    > RegisterClientScriptBlock Inserts a block of client-side code within the
    > HTML form. The first parameter is an identifying name for the block as a
    > string. The second parameter is a string containing the script to be sent

    to
    > the client. You must include the <script> tags.
    >
    > RegisterHiddenField Inserts a hidden input field with the HTML form. The
    > first parameter is a string that provides the input control's name. The
    > second parameter, also a string, is the field's initial value. In the
    > rendered content, this field appears just before ASP.NET's hidden
    > "__VIEWSTATE" field.
    >
    > RegisterOnSubmitStatement Inserts an OnSubmit attribute into the page's
    > <form> tag and the script to be called as its value. The first parameter

    is
    > a unique identifier for the script as a string. The second value is the
    > statement or function called. This creates inline code, so no <script>

    tags
    > are allowed.
    >
    > RegisterStartupScript Inserts a script block just before the closing

    </form>
    > tag. The first parameter is a unique identifier for the script as a

    string.
    > The second parameter, also a string, is the complete script including the
    > <script> tags.
    >
    >
    > "Lukman" <> wrote in message
    > news:%23o9$...
    > > Hi,
    > > Could you tell me about what is RegisterStartupScript, I try to

    understand
    > > from MSDN sample, but I still don't understand. Could you give me more
    > > simple sample ? and what is the purpose of RegisterStartupScript.
    > > Thanks,
    > >
    > >
    > >

    >
    Lukman, Feb 18, 2004
    #4
  5. Lukman

    gvdamn

    Joined:
    Jun 24, 2010
    Messages:
    1
    Article is no longer available

    The article is no longer available.
    gvdamn, Jun 24, 2010
    #5
    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. Brian W
    Replies:
    1
    Views:
    2,901
    Yan-Hong Huang[MSFT]
    Jul 4, 2003
  2. bruce barker
    Replies:
    1
    Views:
    484
    Dave Stienessen
    Jul 31, 2003
  3. Mark
    Replies:
    1
    Views:
    541
    Natty Gur
    Oct 16, 2003
  4. Earl Teigrob

    Using Page.RegisterStartupScript in Class

    Earl Teigrob, Feb 3, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,481
    Earl Teigrob
    Feb 3, 2004
  5. Bill Jones

    RegisterStartupScript Question.

    Bill Jones, Apr 7, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    2,276
    Scott
    Apr 8, 2004
Loading...

Share This Page