views:

104

answers:

2

I have an ASP.NET Site that has a single Master Page. On one of my pages in this site I display a PDF file as the content of the page.

I need a way to know the size that I can make the PDF control so that I do not create a scroll bar for the webpage (the PDF control has it's own scroll bar).

I was able to solve this horizontally by setting the width of the control to 100%. Sadly this does not work for the Vertical size.

Any help is appreciated.

Vaccano

+1  A: 

There's no way to determine this server-side, so you'll need to use JavaScript. I'd recommend the jQuery Dimensions plug in.

John Sheehan
I was hoping to not have to use JavaScript. I would like a solution similar to the one found here: http://www.codeverge.net/ng.asp-net-forum.master_pages_themes_and_navigation_controls/masterpages-stretch-content-to-fill-height-of-the-page That solution does not seem to work for me (not sure why).
Vaccano
This is the real link: http://forums.asp.net/t/964672.aspx (The other was a copy I think)
Vaccano
A: 

If you do use JavaScript, however, there is a workaround where you can put that value into a HiddenField (Which of course JavaScript would see as an Input), and click a Submit button, all behind the scenes. If you use an UpdatePanel, you may be able to get away with a partial postback without user intervention.

For the button clickery, look into Document.Forms[0].btnMyButton.Click();.

tsilb