Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Change js Tooltip

Change js Tooltip

Scheduled Pinned Locked Moved Web Development
csharpjavascriptasp-netcom
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tadhg88
    wrote on last edited by
    #1

    Hi, I am developing a web app using C# and asp.net. I am trying to incorporate the tooltips available here http://walterzorn.com/tooltip/tooltip\_e.htm#browser into my project, specifically the ability to display an image when the user scrolls over an icon. It is easy to hardcode an image to display but I need to be able to change the image displayed by the icon, this is the code needed to display an image onmouseover="Tip('Text with image.')" So im just wondering if anyone has any ideas or suggestions….. Thanks in advance Tim

    G 1 Reply Last reply
    0
    • T tadhg88

      Hi, I am developing a web app using C# and asp.net. I am trying to incorporate the tooltips available here http://walterzorn.com/tooltip/tooltip\_e.htm#browser into my project, specifically the ability to display an image when the user scrolls over an icon. It is easy to hardcode an image to display but I need to be able to change the image displayed by the icon, this is the code needed to display an image onmouseover="Tip('Text with image.')" So im just wondering if anyone has any ideas or suggestions….. Thanks in advance Tim

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      As the Javascript is in an argument in an html element, you have to html-encode the script: onmouseover="Tip('Text with <img src="pics/image.jpg" width="60">image.')"

      --- single minded; short sighted; long gone;

      T 1 Reply Last reply
      0
      • G Guffa

        As the Javascript is in an argument in an html element, you have to html-encode the script: onmouseover="Tip('Text with <img src="pics/image.jpg" width="60">image.')"

        --- single minded; short sighted; long gone;

        T Offline
        T Offline
        tadhg88
        wrote on last edited by
        #3

        thanks for the reply but do you know if it is possible to change the text in onmouseover="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" an example would be different users loggin on to the same page and viewing a pic specific to them in the tooltip

        G 1 Reply Last reply
        0
        • T tadhg88

          thanks for the reply but do you know if it is possible to change the text in onmouseover="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" an example would be different users loggin on to the same page and viewing a pic specific to them in the tooltip

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Yes. Use the Attributes collection of the control. Example: SomeControl.Attributes["onmouseover"] = Server.HtmlEncode(@"Tip('Text with <img src=""pics/image.jpg"" width=""60"">image.');");

          --- single minded; short sighted; long gone;

          T 1 Reply Last reply
          0
          • G Guffa

            Yes. Use the Attributes collection of the control. Example: SomeControl.Attributes["onmouseover"] = Server.HtmlEncode(@"Tip('Text with <img src=""pics/image.jpg"" width=""60"">image.');");

            --- single minded; short sighted; long gone;

            T Offline
            T Offline
            tadhg88
            wrote on last edited by
            #5

            oh ok nice one this is what i need thanks a lot but one last question i am just trying to test the different images on the tooltip but when i try and enter the text needed into a text box and update from there i get the following error A potentially dangerous Request.Form value was detected from the client (_ctl0:tbPic="Tip('.)') Thanks again Tim

            G 1 Reply Last reply
            0
            • T tadhg88

              oh ok nice one this is what i need thanks a lot but one last question i am just trying to test the different images on the tooltip but when i try and enter the text needed into a text box and update from there i get the following error A potentially dangerous Request.Form value was detected from the client (_ctl0:tbPic="Tip('.)') Thanks again Tim

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              It's the request validation that throws the exception. It filters out requests that contain special character combinations. In this case it's probably the < > characters that are stopped. You can turn off the request validation by using ValidateRequest="false" in the @Page directive.

              --- single minded; short sighted; long gone;

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups