Asp.Net SS control call client java function

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

    Asp.Net SS control call client java function

    Can an asp.net button that is a server side control call a client side java
    function when the button is clicked? If so, please provide
    example.....tha nks.,

  • Tampa.NET Koder

    #2
    Re: Asp.Net SS control call client java function

    In code:

    button1.Attribu tes.Add("onClic k" , " doSomething()") ;

    doSometing() is your Javascript function

    I would write this code probably in the page load event.

    "Mike Moore" <MikeMoore@disc ussions.microso ft.com> wrote in message
    news:E6E97D00-1DA7-4B6F-8F77-1D2822A92017@mi crosoft.com...[color=blue]
    > Can an asp.net button that is a server side control call a client side
    > java
    > function when the button is clicked? If so, please provide
    > example.....tha nks.,
    >[/color]


    Comment

    • Blue Streak

      #3
      Re: Asp.Net SS control call client java function

      To register the client side JavaScript (example):

      Private Sub Page_Load(sende r as Object, e as EventArgs) Handles MyBase.Load
      ....
      ClientScriptKBa se()
      ....
      End Sub

      ....

      Private Sub ClientScriptKBa se()
      'Register JavaScript block for KBase button (HTML Control)
      Dim JavaScriptCode as String = "<SCRIPT language='JavaS cript'
      type='text/javascript'><!--"& vbCRLF _
      &"function KBase()"& vbCRLF _
      &"{"& vbCRLF _
      &"
      window.open('../KBase/KBase.aspx','wi n_KBase','statu s=1,resizable=1 ,alwaysRa
      ised=1,left=0,t op=0,height=' + (screen.availHe ight - 110) + ',width=' +
      (screen.availWi dth - 10));"& vbCRLF _
      &"} //--> </SCRIPT>"& vbCRLF

      If NOT(IsClientScr iptBlockRegiste red("KBase")) Then
      RegisterClientS criptBlock("KBa se", JavaScriptCode)
      End If
      End Sub

      "Mike Moore" <MikeMoore@disc ussions.microso ft.com> wrote in message
      news:E6E97D00-1DA7-4B6F-8F77-1D2822A92017@mi crosoft.com...[color=blue]
      > Can an asp.net button that is a server side control call a client side[/color]
      java[color=blue]
      > function when the button is clicked? If so, please provide
      > example.....tha nks.,
      >[/color]


      Comment

      • tshad

        #4
        Re: Asp.Net SS control call client java function

        "Mike Moore" <MikeMoore@disc ussions.microso ft.com> wrote in message
        news:E6E97D00-1DA7-4B6F-8F77-1D2822A92017@mi crosoft.com...[color=blue]
        > Can an asp.net button that is a server side control call a client side
        > java
        > function when the button is clicked? If so, please provide
        > example.....tha nks.,[/color]

        I use the following for my popups:

        Dim myDeleteButton As LinkButton
        myDeleteButton = e.Item.FindCont rol("btnDelete" )
        myDeleteButton. Attributes.Add( "onclick", "return confirm('Are you sure
        you want to delete this answer?');")

        Tom


        Comment

        • Tampa.NET Koder

          #5
          Re: Asp.Net SS control call client java function

          Hope we are reading your question correctly, do you mean client side
          javascript or java ?

          "Mike Moore" <MikeMoore@disc ussions.microso ft.com> wrote in message
          news:E6E97D00-1DA7-4B6F-8F77-1D2822A92017@mi crosoft.com...[color=blue]
          > Can an asp.net button that is a server side control call a client side
          > java
          > function when the button is clicked? If so, please provide
          > example.....tha nks.,
          >[/color]


          Comment

          Working...