What does this ClientScriptManager code do??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AAaron123

    What does this ClientScriptManager code do??

    I read the help on which says:

    The ClientScriptMan ager class is used to manage client-side scripts and add
    them to Web applications...


    But could use a little help. Can someone tell me what the code below is used
    for?

    If you could just put a few comments into the code that would help.

    Is this code requires when ever the <scripttag is used?

    The last line appears to relate to the following, but what does it do?

    <asp:Image ID="MasterChurc hImage" runat="server" AlternateText=" Church
    Image" ImageUrl="~/Images/MasterChurchIma ge.jpg" />

    THANKS for any insight



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
    Handles Me.Load

    Dim csname2 As String = "ButtonClickScr ipt"

    Dim cstype As Type = Me.GetType()



    Dim cs As ClientScriptMan ager = Page.ClientScri pt



    ' Check to see if the client script is already registered.

    If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then

    Dim cstext2 As New StringBuilder()

    cstext2.Append( "<script type=text/javascriptfunct ion DoClick() {")

    cstext2.Append( "Form1.Message. value='Text from client script.'} </")

    cstext2.Append( "script>")

    cs.RegisterClie ntScriptBlock(c stype, csname2, cstext2.ToStrin g(), False)

    End If

    MasterChurchIma ge.Attributes.A dd("onload", "resizeImg( '" +
    MasterChurchIma ge.ClientID + "')")

    End Sub


  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: What does this ClientScriptMan ager code do??

    Client script manager adds JavaScript to the page. It can be added in the
    header or in the body, depending on which method you use.

    The last lines here are adding an attibute to the MasterChurch image, which
    is a way to add elements not recognized on the ASP.NET image tag which are
    available in HTML. In particular, this addition adds an onload event handler
    to the image tag. Examine the source when you run the page and you will see

    <img onload="resizeI mg('1')>

    plus more (I purposely avoided writing the whole thing).

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

    Subscribe to my blog


    or just read it:


    *************** *************** **************
    | Think outside the box! |
    *************** *************** **************
    "AAaron123" <aaaron123@road runner.comwrote in message
    news:ufm33wq7IH A.2348@TK2MSFTN GP06.phx.gbl...
    >I read the help on which says:
    >
    The ClientScriptMan ager class is used to manage client-side scripts and
    add them to Web applications...
    >
    >
    But could use a little help. Can someone tell me what the code below is
    used for?
    >
    If you could just put a few comments into the code that would help.
    >
    Is this code requires when ever the <scripttag is used?
    >
    The last line appears to relate to the following, but what does it do?
    >
    <asp:Image ID="MasterChurc hImage" runat="server" AlternateText=" Church
    Image" ImageUrl="~/Images/MasterChurchIma ge.jpg" />
    >
    THANKS for any insight
    >
    >
    >
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles Me.Load
    >
    Dim csname2 As String = "ButtonClickScr ipt"
    >
    Dim cstype As Type = Me.GetType()
    >
    >
    >
    Dim cs As ClientScriptMan ager = Page.ClientScri pt
    >
    >
    >
    ' Check to see if the client script is already registered.
    >
    If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
    >
    Dim cstext2 As New StringBuilder()
    >
    cstext2.Append( "<script type=text/javascriptfunct ion DoClick() {")
    >
    cstext2.Append( "Form1.Message. value='Text from client script.'} </")
    >
    cstext2.Append( "script>")
    >
    cs.RegisterClie ntScriptBlock(c stype, csname2, cstext2.ToStrin g(), False)
    >
    End If
    >
    MasterChurchIma ge.Attributes.A dd("onload", "resizeImg( '" +
    MasterChurchIma ge.ClientID + "')")
    >
    End Sub
    >
    >

    Comment

    • AAaron123

      #3
      Re: What does this ClientScriptMan ager code do??

      Thanks for the clear description. Now I read the Help again and see if it
      now makes sense. I run this in
      the Page_Load event.


      I've tried and it appears that you can have multiple blocks like this each
      with a different csname* and cstext*. Correct?



      If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then

      Dim cstext2 As New StringBuilder()

      snip...

      cs.RegisterClie ntScriptBlock(c stype, csname2, cstext2.ToStrin g(), False)

      End If

      MasterChurchIma ge.Attributes.A dd("onload", "resizeImg( '" +
      MasterChurchIma ge.ClientID + "')")


      Also, the ...Attributes.A dd is outside the If..
      If that is correct it appears register should be done only once but the Add
      each time the page is loaded. Correct?


      Thanks again


      "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamMwrote in
      message news:%23T70frs7 IHA.2224@TK2MSF TNGP05.phx.gbl. ..
      Client script manager adds JavaScript to the page. It can be added in the
      header or in the body, depending on which method you use.
      >
      The last lines here are adding an attibute to the MasterChurch image,
      which is a way to add elements not recognized on the ASP.NET image tag
      which are available in HTML. In particular, this addition adds an onload
      event handler to the image tag. Examine the source when you run the page
      and you will see
      >
      <img onload="resizeI mg('1')>
      >
      plus more (I purposely avoided writing the whole thing).
      >
      --
      Gregory A. Beamer
      MVP, MCP: +I, SE, SD, DBA
      >
      Subscribe to my blog

      >
      or just read it:

      >
      *************** *************** **************
      | Think outside the box! |
      *************** *************** **************
      "AAaron123" <aaaron123@road runner.comwrote in message
      news:ufm33wq7IH A.2348@TK2MSFTN GP06.phx.gbl...
      >>I read the help on which says:
      >>
      >The ClientScriptMan ager class is used to manage client-side scripts and
      >add them to Web applications...
      >>
      >>
      >But could use a little help. Can someone tell me what the code below is
      >used for?
      >>
      >If you could just put a few comments into the code that would help.
      >>
      >Is this code requires when ever the <scripttag is used?
      >>
      >The last line appears to relate to the following, but what does it do?
      >>
      ><asp:Image ID="MasterChurc hImage" runat="server" AlternateText=" Church
      >Image" ImageUrl="~/Images/MasterChurchIma ge.jpg" />
      >>
      >THANKS for any insight
      >>
      >>
      >>
      >Protected Sub Page_Load(ByVal sender As Object, ByVal e As
      >System.EventAr gs) Handles Me.Load
      >>
      >Dim csname2 As String = "ButtonClickScr ipt"
      >>
      >Dim cstype As Type = Me.GetType()
      >>
      >>
      >>
      >Dim cs As ClientScriptMan ager = Page.ClientScri pt
      >>
      >>
      >>
      >' Check to see if the client script is already registered.
      >>
      >If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
      >>
      >Dim cstext2 As New StringBuilder()
      >>
      >cstext2.Append ("<script type=text/javascriptfunct ion DoClick() {")
      >>
      >cstext2.Append ("Form1.Message .value='Text from client script.'} </")
      >>
      >cstext2.Append ("script>")
      >>
      >cs.RegisterCli entScriptBlock( cstype, csname2, cstext2.ToStrin g(), False)
      >>
      >End If
      >>
      >MasterChurchIm age.Attributes. Add("onload", "resizeImg( '" +
      >MasterChurchIm age.ClientID + "')")
      >>
      >End Sub
      >>
      >>
      >

      Comment

      • bruce barker

        #4
        Re: What does this ClientScriptMan ager code do??

        the if is just to test if the register call has already been made. you
        are confusing two unrelated bits of javascript code.

        the RegisterScriptB lock is used to render a javascript routine named
        DoClick(). the second attaches an event handler (resizeImg) to an images
        load event.

        -- bruce (sqlwork.com)



        AAaron123 wrote:
        Thanks for the clear description. Now I read the Help again and see if it
        now makes sense. I run this in
        the Page_Load event.
        >
        >
        I've tried and it appears that you can have multiple blocks like this each
        with a different csname* and cstext*. Correct?
        >
        >
        >
        If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
        >
        Dim cstext2 As New StringBuilder()
        >
        snip...
        >
        cs.RegisterClie ntScriptBlock(c stype, csname2, cstext2.ToStrin g(), False)
        >
        End If
        >
        MasterChurchIma ge.Attributes.A dd("onload", "resizeImg( '" +
        MasterChurchIma ge.ClientID + "')")
        >
        >
        Also, the ...Attributes.A dd is outside the If..
        If that is correct it appears register should be done only once but the Add
        each time the page is loaded. Correct?
        >
        >
        Thanks again
        >
        >
        "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamMwrote in
        message news:%23T70frs7 IHA.2224@TK2MSF TNGP05.phx.gbl. ..
        >Client script manager adds JavaScript to the page. It can be added in the
        >header or in the body, depending on which method you use.
        >>
        >The last lines here are adding an attibute to the MasterChurch image,
        >which is a way to add elements not recognized on the ASP.NET image tag
        >which are available in HTML. In particular, this addition adds an onload
        >event handler to the image tag. Examine the source when you run the page
        >and you will see
        >>
        ><img onload="resizeI mg('1')>
        >>
        >plus more (I purposely avoided writing the whole thing).
        >>
        >--
        >Gregory A. Beamer
        >MVP, MCP: +I, SE, SD, DBA
        >>
        >Subscribe to my blog
        >http://gregorybeamer.spaces.live.com/lists/feed.rss
        >>
        >or just read it:
        >http://gregorybeamer.spaces.live.com/
        >>
        >************** *************** ***************
        >| Think outside the box! |
        >************** *************** ***************
        >"AAaron123" <aaaron123@road runner.comwrote in message
        >news:ufm33wq7I HA.2348@TK2MSFT NGP06.phx.gbl.. .
        >>I read the help on which says:
        >>>
        >>The ClientScriptMan ager class is used to manage client-side scripts and
        >>add them to Web applications...
        >>>
        >>>
        >>But could use a little help. Can someone tell me what the code below is
        >>used for?
        >>>
        >>If you could just put a few comments into the code that would help.
        >>>
        >>Is this code requires when ever the <scripttag is used?
        >>>
        >>The last line appears to relate to the following, but what does it do?
        >>>
        >><asp:Image ID="MasterChurc hImage" runat="server" AlternateText=" Church
        >>Image" ImageUrl="~/Images/MasterChurchIma ge.jpg" />
        >>>
        >>THANKS for any insight
        >>>
        >>>
        >>>
        >>Protected Sub Page_Load(ByVal sender As Object, ByVal e As
        >>System.EventA rgs) Handles Me.Load
        >>>
        >>Dim csname2 As String = "ButtonClickScr ipt"
        >>>
        >>Dim cstype As Type = Me.GetType()
        >>>
        >>>
        >>>
        >>Dim cs As ClientScriptMan ager = Page.ClientScri pt
        >>>
        >>>
        >>>
        >>' Check to see if the client script is already registered.
        >>>
        >>If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
        >>>
        >>Dim cstext2 As New StringBuilder()
        >>>
        >>cstext2.Appen d("<script type=text/javascriptfunct ion DoClick() {")
        >>>
        >>cstext2.Appen d("Form1.Messag e.value='Text from client script.'} </")
        >>>
        >>cstext2.Appen d("script>")
        >>>
        >>cs.RegisterCl ientScriptBlock (cstype, csname2, cstext2.ToStrin g(), False)
        >>>
        >>End If
        >>>
        >>MasterChurchI mage.Attributes .Add("onload", "resizeImg( '" +
        >>MasterChurchI mage.ClientID + "')")
        >>>
        >>End Sub
        >>>
        >>>
        >
        >

        Comment

        • AAaron123

          #5
          Re: What does this ClientScriptMan ager code do??

          I guess you're right I am confused.

          For example, I have the following which works but I don't know why.

          When I open the page the dialogbox does show.

          I think I'm registering the script for PopupScript but I'd expect to have to
          "call" it some place.

          Registering doesn't cause it to execute does it?

          Thanks for the interest



          Partial Class Default_aspx

          Inherits System.Web.UI.P age



          Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
          Handles Me.Load

          Dim csname1 As String = "PopupScrip t"

          Dim cstype As Type = Me.GetType()

          Dim csm As ClientScriptMan ager = Page.ClientScri pt

          If (Not csm.IsStartupSc riptRegistered( cstype, csname1)) Then

          Dim cstext1 As New StringBuilder()

          cstext1.Append( "alert('Thi s sites...es with text.');")

          csm.RegisterSta rtupScript(csty pe, csname1, cstext1.ToStrin g, True)

          End If

          End Sub

          End Class


          Comment

          • AAaron123

            #6
            Re: What does this ClientScriptMan ager code do??

            In my other reply I should have mentioned that the below helped a lot.
            You're right, I was trying to tie the two together and couldn't do it.

            thanks again


            "bruce barker" <nospam@nospam. comwrote in message
            news:uZ3ZyYB8IH A.1192@TK2MSFTN GP05.phx.gbl...
            the if is just to test if the register call has already been made. you are
            confusing two unrelated bits of javascript code.
            >
            the RegisterScriptB lock is used to render a javascript routine named
            DoClick(). the second attaches an event handler (resizeImg) to an images
            load event.
            >
            -- bruce (sqlwork.com)
            >
            >
            >

            Comment

            • Cowboy \(Gregory A. Beamer\)

              #7
              Re: What does this ClientScriptMan ager code do??

              You have two concepts here, as I see it:

              Emitting blocks of JavaScript
              Adding attributes to tags

              Blocks of JavaScript can be created in a variety of ways. For example, you
              can do something like this:

              string code = "{block of code here}";
              Literal lit = new Literal(code);
              Page.Controls.A dd(lit);

              There is probably a mistake in that code, as I am just writing on the fly,
              but it is one way to add JavaScript. The emit methods, like
              RegisterClientS criptBlock are better, as you end up placing a script block
              either a) at the top of the page or b) inline. There are two primary methods
              here (on the ClientScriptMan ager class):

              RegisterStartup Script
              RegisterClientS criptBlock

              But you can also avail youself of RegisterClientS criptInclude,
              RegisterClientS criptResource, etc. All fo the methods are here:


              That pretty covers outputting blocks, so to the attributes adding. This is a
              way of adding tags not normally exposed by the ASP.NET classes. For example,
              the code, you show sets up the following on the image:

              onload="resizeI mg('1')"

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

              Subscribe to my blog


              or just read it:


              *************** *************** **************
              | Think outside the box! |
              *************** *************** **************
              "AAaron123" <aaaron123@road runner.comwrote in message
              news:ux%23temz7 IHA.5596@TK2MSF TNGP02.phx.gbl. ..
              Thanks for the clear description. Now I read the Help again and see if it
              now makes sense. I run this in
              the Page_Load event.
              >
              >
              I've tried and it appears that you can have multiple blocks like this each
              with a different csname* and cstext*. Correct?
              >
              >
              >
              If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
              >
              Dim cstext2 As New StringBuilder()
              >
              snip...
              >
              cs.RegisterClie ntScriptBlock(c stype, csname2, cstext2.ToStrin g(), False)
              >
              End If
              >
              MasterChurchIma ge.Attributes.A dd("onload", "resizeImg( '" +
              MasterChurchIma ge.ClientID + "')")
              >
              >
              Also, the ...Attributes.A dd is outside the If..
              If that is correct it appears register should be done only once but the
              Add each time the page is loaded. Correct?
              >
              >
              Thanks again
              >
              >
              "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamMwrote in
              message news:%23T70frs7 IHA.2224@TK2MSF TNGP05.phx.gbl. ..
              >Client script manager adds JavaScript to the page. It can be added in the
              >header or in the body, depending on which method you use.
              >>
              >The last lines here are adding an attibute to the MasterChurch image,
              >which is a way to add elements not recognized on the ASP.NET image tag
              >which are available in HTML. In particular, this addition adds an onload
              >event handler to the image tag. Examine the source when you run the page
              >and you will see
              >>
              ><img onload="resizeI mg('1')>
              >>
              >plus more (I purposely avoided writing the whole thing).
              >>
              >--
              >Gregory A. Beamer
              >MVP, MCP: +I, SE, SD, DBA
              >>
              >Subscribe to my blog
              >http://gregorybeamer.spaces.live.com/lists/feed.rss
              >>
              >or just read it:
              >http://gregorybeamer.spaces.live.com/
              >>
              >************** *************** ***************
              >| Think outside the box! |
              >************** *************** ***************
              >"AAaron123" <aaaron123@road runner.comwrote in message
              >news:ufm33wq7I HA.2348@TK2MSFT NGP06.phx.gbl.. .
              >>>I read the help on which says:
              >>>
              >>The ClientScriptMan ager class is used to manage client-side scripts and
              >>add them to Web applications...
              >>>
              >>>
              >>But could use a little help. Can someone tell me what the code below is
              >>used for?
              >>>
              >>If you could just put a few comments into the code that would help.
              >>>
              >>Is this code requires when ever the <scripttag is used?
              >>>
              >>The last line appears to relate to the following, but what does it do?
              >>>
              >><asp:Image ID="MasterChurc hImage" runat="server" AlternateText=" Church
              >>Image" ImageUrl="~/Images/MasterChurchIma ge.jpg" />
              >>>
              >>THANKS for any insight
              >>>
              >>>
              >>>
              >>Protected Sub Page_Load(ByVal sender As Object, ByVal e As
              >>System.EventA rgs) Handles Me.Load
              >>>
              >>Dim csname2 As String = "ButtonClickScr ipt"
              >>>
              >>Dim cstype As Type = Me.GetType()
              >>>
              >>>
              >>>
              >>Dim cs As ClientScriptMan ager = Page.ClientScri pt
              >>>
              >>>
              >>>
              >>' Check to see if the client script is already registered.
              >>>
              >>If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
              >>>
              >>Dim cstext2 As New StringBuilder()
              >>>
              >>cstext2.Appen d("<script type=text/javascriptfunct ion DoClick() {")
              >>>
              >>cstext2.Appen d("Form1.Messag e.value='Text from client script.'} </")
              >>>
              >>cstext2.Appen d("script>")
              >>>
              >>cs.RegisterCl ientScriptBlock (cstype, csname2, cstext2.ToStrin g(), False)
              >>>
              >>End If
              >>>
              >>MasterChurchI mage.Attributes .Add("onload", "resizeImg( '" +
              >>MasterChurchI mage.ClientID + "')")
              >>>
              >>End Sub
              >>>
              >>>
              >>
              >
              >

              Comment

              • AAaron123

                #8
                Re: What does this ClientScriptMan ager code do??

                thanks a lot

                "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamMwrote in
                message news:uyanKTY8IH A.4608@TK2MSFTN GP06.phx.gbl...
                You have two concepts here, as I see it:
                >
                Emitting blocks of JavaScript
                Adding attributes to tags
                >
                Blocks of JavaScript can be created in a variety of ways. For example, you
                can do something like this:
                >
                string code = "{block of code here}";
                Literal lit = new Literal(code);
                Page.Controls.A dd(lit);
                >
                There is probably a mistake in that code, as I am just writing on the fly,
                but it is one way to add JavaScript. The emit methods, like
                RegisterClientS criptBlock are better, as you end up placing a script block
                either a) at the top of the page or b) inline. There are two primary
                methods here (on the ClientScriptMan ager class):
                >
                RegisterStartup Script
                RegisterClientS criptBlock
                >
                But you can also avail youself of RegisterClientS criptInclude,
                RegisterClientS criptResource, etc. All fo the methods are here:

                >
                That pretty covers outputting blocks, so to the attributes adding. This is
                a way of adding tags not normally exposed by the ASP.NET classes. For
                example, the code, you show sets up the following on the image:
                >
                onload="resizeI mg('1')"
                >
                --
                Gregory A. Beamer
                MVP, MCP: +I, SE, SD, DBA
                >
                Subscribe to my blog

                >
                or just read it:

                >
                *************** *************** **************
                | Think outside the box! |
                *************** *************** **************
                "AAaron123" <aaaron123@road runner.comwrote in message
                news:ux%23temz7 IHA.5596@TK2MSF TNGP02.phx.gbl. ..
                >Thanks for the clear description. Now I read the Help again and see if it
                >now makes sense. I run this in
                >the Page_Load event.
                >>
                >>
                >I've tried and it appears that you can have multiple blocks like this
                >each with a different csname* and cstext*. Correct?
                >>
                >>
                >>
                >If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
                >>
                >Dim cstext2 As New StringBuilder()
                >>
                >snip...
                >>
                >cs.RegisterCli entScriptBlock( cstype, csname2, cstext2.ToStrin g(), False)
                >>
                >End If
                >>
                >MasterChurchIm age.Attributes. Add("onload", "resizeImg( '" +
                >MasterChurchIm age.ClientID + "')")
                >>
                >>
                >Also, the ...Attributes.A dd is outside the If..
                >If that is correct it appears register should be done only once but the
                >Add each time the page is loaded. Correct?
                >>
                >>
                >Thanks again
                >>
                >>
                >"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamMwrote in
                >message news:%23T70frs7 IHA.2224@TK2MSF TNGP05.phx.gbl. ..
                >>Client script manager adds JavaScript to the page. It can be added in
                >>the header or in the body, depending on which method you use.
                >>>
                >>The last lines here are adding an attibute to the MasterChurch image,
                >>which is a way to add elements not recognized on the ASP.NET image tag
                >>which are available in HTML. In particular, this addition adds an onload
                >>event handler to the image tag. Examine the source when you run the page
                >>and you will see
                >>>
                >><img onload="resizeI mg('1')>
                >>>
                >>plus more (I purposely avoided writing the whole thing).
                >>>
                >>--
                >>Gregory A. Beamer
                >>MVP, MCP: +I, SE, SD, DBA
                >>>
                >>Subscribe to my blog
                >>http://gregorybeamer.spaces.live.com/lists/feed.rss
                >>>
                >>or just read it:
                >>http://gregorybeamer.spaces.live.com/
                >>>
                >>************* *************** *************** *
                >>| Think outside the box! |
                >>************* *************** *************** *
                >>"AAaron123" <aaaron123@road runner.comwrote in message
                >>news:ufm33wq7 IHA.2348@TK2MSF TNGP06.phx.gbl. ..
                >>>>I read the help on which says:
                >>>>
                >>>The ClientScriptMan ager class is used to manage client-side scripts and
                >>>add them to Web applications...
                >>>>
                >>>>
                >>>But could use a little help. Can someone tell me what the code below is
                >>>used for?
                >>>>
                >>>If you could just put a few comments into the code that would help.
                >>>>
                >>>Is this code requires when ever the <scripttag is used?
                >>>>
                >>>The last line appears to relate to the following, but what does it do?
                >>>>
                >>><asp:Image ID="MasterChurc hImage" runat="server" AlternateText=" Church
                >>>Image" ImageUrl="~/Images/MasterChurchIma ge.jpg" />
                >>>>
                >>>THANKS for any insight
                >>>>
                >>>>
                >>>>
                >>>Protected Sub Page_Load(ByVal sender As Object, ByVal e As
                >>>System.Event Args) Handles Me.Load
                >>>>
                >>>Dim csname2 As String = "ButtonClickScr ipt"
                >>>>
                >>>Dim cstype As Type = Me.GetType()
                >>>>
                >>>>
                >>>>
                >>>Dim cs As ClientScriptMan ager = Page.ClientScri pt
                >>>>
                >>>>
                >>>>
                >>>' Check to see if the client script is already registered.
                >>>>
                >>>If (Not cs.IsClientScri ptBlockRegister ed(cstype, csname2)) Then
                >>>>
                >>>Dim cstext2 As New StringBuilder()
                >>>>
                >>>cstext2.Appe nd("<script type=text/javascriptfunct ion DoClick() {")
                >>>>
                >>>cstext2.Appe nd("Form1.Messa ge.value='Text from client script.'} </")
                >>>>
                >>>cstext2.Appe nd("script>")
                >>>>
                >>>cs.RegisterC lientScriptBloc k(cstype, csname2, cstext2.ToStrin g(),
                >>>False)
                >>>>
                >>>End If
                >>>>
                >>>MasterChurch Image.Attribute s.Add("onload", "resizeImg( '" +
                >>>MasterChurch Image.ClientID + "')")
                >>>>
                >>>End Sub
                >>>>
                >>>>
                >>>
                >>
                >>
                >

                Comment

                Working...