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. ASP.NET
  4. get left position of the panel

get left position of the panel

Scheduled Pinned Locked Moved ASP.NET
helpjavascripttools
4 Posts 3 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.
  • S Offline
    S Offline
    S Aijaz
    wrote on last edited by
    #1

    i have to get left position of the panel on pageload. i do get dat by playing a trick, but wt problem now i face is im not able to put dat value in the hidden control. below is code that i use for the purpose: string strJS = @" <script language='javascript' type='text/javascript'> intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); </script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS); it throws exception can any body help me............

    L V 2 Replies Last reply
    0
    • S S Aijaz

      i have to get left position of the panel on pageload. i do get dat by playing a trick, but wt problem now i face is im not able to put dat value in the hidden control. below is code that i use for the purpose: string strJS = @" <script language='javascript' type='text/javascript'> intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); </script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS); it throws exception can any body help me............

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The exception thrown might help to solve the problem...

      1 Reply Last reply
      0
      • S S Aijaz

        i have to get left position of the panel on pageload. i do get dat by playing a trick, but wt problem now i face is im not able to put dat value in the hidden control. below is code that i use for the purpose: string strJS = @" <script language='javascript' type='text/javascript'> intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); </script>"; Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS); it throws exception can any body help me............

        V Offline
        V Offline
        Venkatesh Mookkan
        wrote on last edited by
        #3

        S_Aijaz1 wrote:

        string strJS = @" intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); "; Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS);

        Try this,

        string strJS = @" intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); ";

        Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS, true);

        if this doesn't help, post the error message you getting.

        Castle Rider

        What if I freeze??? Don't forget to breath...

        My: Website | Yahoo Group | Blog Spot

        S 1 Reply Last reply
        0
        • V Venkatesh Mookkan

          S_Aijaz1 wrote:

          string strJS = @" intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); "; Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS);

          Try this,

          string strJS = @" intWidth = document.body.clientWidth;intHeight = document.body.clientHeight;intWidth = (intWidth* 15/100);document.getElementById('<% =HpnlCtrlLeftPos.ClientID %>').value=intWidth; alert('Width : '+ intWidth +' Height : ' + intHeight); ";

          Page.ClientScript.RegisterStartupScript(this.GetType(), "ScreenPosition", strJS, true);

          if this doesn't help, post the error message you getting.

          Castle Rider

          What if I freeze??? Don't forget to breath...

          My: Website | Yahoo Group | Blog Spot

          S Offline
          S Offline
          S Aijaz
          wrote on last edited by
          #4

          thank you sir, i have have tried dis as well but it is not working, at page load it does nt find the hidden control

          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