get left position of the panel
-
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............
-
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............
-
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............
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_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