RegisterStartupScript() and RegisterClientScriptBlock()

Discussion in 'ASP .Net' started by Mark, Oct 16, 2003.

  1. Mark

    Mark Guest

    I've been reading the following link :
    That supposedly tells you how to use these: RegisterStartupScript() and
    RegisterClientScriptBlock() to inject client side script into a server
    I'm new to ASP.NET and am hoping someone can help.
    I'm trying to get this snippet: <script language="JavaScript1.2"
    src="adds/menu/wm_menu.js" type="text/javascript"></script>
    to run in my server control.
    Here is the code for the control:

    <%@ Control Language="VB" %>
    <script runat="server">

    <p align="center">
    <table height="90" width="100%" align="center" bgcolor="dodgerblue">
    <td rowspan="3">
    <p align="left">
    <asp:Image id="logo" runat="server"
    ImageUrl="images/logo_wm.gif" ImageAlign="Top"></asp:Image>
    <td valign="center" align="left" width="50%" colspan="2"
    height="50" border="0">
    </tr><script language="JavaScript1.2" src="adds/menu/wm_menu.js"
    type="text/javascript"></script> /////// here is where I would like it.
    <td valign="center" width="50%" colspan="2" height="40"
    rowspan="2" border="0">
    <p align="center">
    <asp:AdRotator id="header" runat="server"
    Width="360px" Height="40px"

    CAn anyone help me get this code RegisterStartupScript() and
    RegisterClientScriptBlock() to work?

    Where does the code go in my control and what is the correct syntax?
    Mark, Oct 16, 2003
    1. Advertisements

  2. Mark

    Natty Gur Guest


    You can use page_load event to take advantage of

    src="adds/menu/wm_menu.js" type="text/javascript"></script>

    Natty Gur[MVP]
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377
    Natty Gur, Oct 16, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.