troubleshooting Question

Call code-behind function from javascript

Avatar of carled
carledFlag for United Kingdom of Great Britain and Northern Ireland asked on
ASP.NET
1 Comment1 Solution699 ViewsLast Modified:
I'm utilising the pretty snazzy Gaia ajax toolkit - fairly irrelevant at present to this issue, just thought I'd mention it. Well worth a look!

Anyhow, I have a div on my asp.net page which has a panel control in it.  All are set to 100% height/width and it works fine. However, I have an asp.net function that needs to know HOW big the 100% is in pixels once rendered and this only seems to be available once the asp.net page has completed processing, then my javascript "onload" event fires. Trouble is, this is too late for me to use the values that the javascript function creates by inspecting the height/width of the div that's been drawn.

So... the only way I can think of getting around this is to somehow have javascript call the asp.net function that needs the height/width values. This does, of course, mean a postback of some sort and I suppose it has to be ajax (although I'd much rather use the gaia controls, just don't see how to get it working).

How can I get javascript in the "onload" function to call my code-behind asp.net function please?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros