Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

dynamically get master page div dimensions

Posted on 2011-03-13
5
Medium Priority
?
409 Views
Last Modified: 2012-05-11
I have a DIV wrapper incorporating the various controls on and asp.net master page. I'd like to access the DIV height from the content page and programmatically change that height prior to pre-rendering the page. Is this doable?
0
Comment
Question by:eehunter3
  • 3
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 35122949
Yes, it is doable. You just need to get the Id of that div, and then you can get or set its height

alert( document.getElementById("divId").style.height ); //getting the height
document.getElementById("divId").style.height = "100px"; //setting the height
0
 

Author Comment

by:eehunter3
ID: 35123163
I think this might work but I am not familiar with javascript. Is there a VB.NET counterpart? Or can you be a little more explicit as to what javascript code goes on the master page and what goes on the content page to access the DIV's properties?.
0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 1000 total points
ID: 35123175
check this page
http://www.w3schools.com/jsref/dom_obj_style.asp

I have no experience in VB.net, so Sorry, can't suggest anything else.
0
 

Assisted Solution

by:eehunter3
eehunter3 earned 0 total points
ID: 35123262
Back in a few .... Taking a quick tutorial in javascript and reviewing the link you have suggested.
0
 

Author Closing Comment

by:eehunter3
ID: 35178788
Made a mistake ... did not mean to credit myself with providing answer.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question