Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Can any one help me, to run the java script in my user control.
My Javascript is like this:
<script language="javascript" type ="text/javascript" >
  var intwidth;
  intwidth = window.screen.width;
  intwidth = intwidth - 423;
  var strwidth = intwidth + "Px";
  document.getElementById("upRightSide").style.width = strwidth;
</script>

I want to run this script in user control load.

Regards,
S.Inayat Basha
Posted
Updated 21-Nov-11 2:32am
v2
Comments
[no name] 21-Nov-11 8:33am    
What have you tried? What problems are you having?
inayat basha 21-Nov-11 8:35am    
i don't have any html tag in the user control.so it was not hitting this js to run...can you help me to run this js
inayat basha 21-Nov-11 8:39am    
or you can help me to write this code in page load using C#, when i am writting it in c#, the syntax is throwing error..When i run this js in .aspx it's working good
RaisKazi 21-Nov-11 8:47am    
What error you are getting? Check Run-time-Id of "upRightSide" in view source of the page in Browser.
inayat basha 21-Nov-11 8:48am    
"upRightSide" is there, i have used asp:Table,asp:TableRow etx for the user control

1 solution

Without knowing or seeing all the details I would hires the problem is with upRightSide. Remember asp.net will mangle the name so this specific Id is not on the page. Check the rendered output.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900