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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. accessing controls in javascript in asp.net

accessing controls in javascript in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netvisual-studiohelp
3 Posts 2 Posters 1 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
    Tarun Suneja 0
    wrote on last edited by
    #1

    hello friends, i am working on some project where i need to use javascript in the webforms. i am unable to access the controls in the javascript. for example i have two image controls in my webform. i want to increase size i.e. height and width of the control on mouseover event. can you help me plz. i am using visual studio 2008 professional edition but i am not getting document.getElementById in the intellisence even. with thanks... Tarun Suneja

    P 1 Reply Last reply
    0
    • T Tarun Suneja 0

      hello friends, i am working on some project where i need to use javascript in the webforms. i am unable to access the controls in the javascript. for example i have two image controls in my webform. i want to increase size i.e. height and width of the control on mouseover event. can you help me plz. i am using visual studio 2008 professional edition but i am not getting document.getElementById in the intellisence even. with thanks... Tarun Suneja

      P Offline
      P Offline
      PCuong1983
      wrote on last edited by
      #2

      where is your code ? or try: document.getElementById('<%=YourControl.ClientID%>');

      T 1 Reply Last reply
      0
      • P PCuong1983

        where is your code ? or try: document.getElementById('<%=YourControl.ClientID%>');

        T Offline
        T Offline
        Tarun Suneja 0
        wrote on last edited by
        #3

        function change3() { document.bgColor = "blue"; //document.getElementById('Image1').value = "hello"; document.getElementById('Image1').ImageUrl = "~/Ferrari/004.jpg"; document.getElementById('Image1').style.height = "170"; } this is my code. this is working in a simple webform which do not use master page. but a webform which uses a master page does not execute it. it changes the bgColor but not the attributes of the control (image1 here). pls help me. with thanks... Tarun Suneja ` 0

        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