.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

determine the screen height within javascript and set a property on an iframe

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :ASP.Net

I have a webform  that has a header and iframe,  what I need to do is on load detemine the users screen height and then  set the height on the iframe. Can someone explain  or show me an example of how to do this.

Thanks in advance.

View Complete Post

More Related Resource Links

Calculate Client Height in javascript

The article Calculate Client Height in javascript was added by amoljk2009 on Monday, May 31, 2010.

Hi, Following code will help the developer to calculate exact client height in all browsers.script language="javascript" type="text/javascript">var winW = 630, winH = 460;if (parseInt(navigator.appVersion)>3) {if (navigator.appName

What's the problem in my javascript's code to get ClientID Property?



 Hi all.

I wirte a simple java script code to get ClientID of controls on the webform. The code is like:

<script type="text/javascript" language="javascript">

var butt = $find("<%= Button1.ClientID %>");



But when i run it , i have a problem. The probmel is:


Server Error in '/' Application.

The Controls collection cannot be modified because t

JavaScript iframe resezing issue



I have an iframe that is supplied by another application, inside the iframe I have my .Net application. However, I am having sizing issues, where one minute that pages in the .Net fit the frame perfectly and the next minute they don't, with a vertical and horizontal scroll bars appearing. All the .Net Pages use a Master Page and I have also fixed the size of the pages, but with no luck. What I would was thinking if possible is to pass some javascript between the .Net application and the iframe which will make the pages and the iframe resize themselves. Has anyone done this before and have some code that I could use?

Object or Property is not supported in IE8 - javascript error



I am using following code line in my web app through external javascript file.






both these methods are working fine in IE6 but failing in IE8 with a error: "Object or Property is not supported".


any solution would be appreciated!



Javascript funtion in the href property does not accepted


I try to add the following code in a sharepoint 2010 web page

<a href="javascript:function();"> This is a test</a>

but each time I save it, the line disappear. What is wrong with the code??



Javascript to pass var in iframe to parent form

Why doesn't this form work when the button is clicked? It is inside an iframe. I sent the controls to an iframe from  a different website. When I hover my mouse over the Resubmit button, I can see the correct url in my browser bar. (lower left) This is the same one as the save button. Does the fact that the Resbmit button is in an iframe create a problem?  Is this a security issue?   I was trying to use the Copy url to clipboard button to copy the selected url in the dropdown to the clipboard. Then the user could paste it into the Recipcocal url field in the form and click the Save button again. (see picture) The form is on the page with the iframe. The copy button doesn't work either.  <form name="ctl01" method="post" action="http://www.link-exchangers.com/adv_links_addbycustomer.aspx" id="ctl01" target="hdnFrm"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUaUXIyTcD6f05q0zIbv4QVbpto4s=" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="//2DwKU+M6MDwK8m8+dCQKy8rjSBwLD+aWMBALcwYfHCALrp+eHDwKggI3ODAKvtqqBBgKjs8y4CAKqiLHeDgK34agCBNfAteTeI3XoiXVXjCs/J0yEnNM=" /> </div>

AttachedPropertiesService determine if property already added

Hi, Is there any way to tell whether a property has previously been added to the AttachedPropertiesService, other than keeping track oneself in some external data structure ?  Thanks, Notre

javascript not working in iframe on remote site

<html> <body style="background-color: White;"> <form name="ctl01" method="post" action="adv_links_addbycustomer.aspx" id="ctl01"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/</div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/dfdafa" /> </div> <div style="background-color:White;"> <span id="lblMsg" class="ErrorText" style="font-weight:bold;"></span> <center> <span id="Label1" style="font-size:X-Small;font-weight:bold;">Valid Urls</span> <select name="DropDownList1" id="DropDownList1" style="background-color:#EFEFEF;border-color:#898989;border-width:1px;border-style:Solid;font-size:8pt;padding:0px;"> <option value="0"> - Select - </option> <option value="http://www.fha-home-loans.us/index.htm">http://www.fha-home-loans.us/index.htm</option> <option value="http://www.fha-home-loans.us/jumbomortgage/apply.htm">http://www.fha-home-loans.us/jumbomortgage/apply.htm</op

javascript pageLoad() & client side isPostBack property?

Hello and thanks for your help in advance. I have some javascript code that I have placed in the pageLoad() function like this:function pageLoad() { var x = 5; }But I only want this to happen on the first time the page loads... Is there an isPostBack property on the client site?

How do I change the height of a remote iframe

<iframe id="hdnFrm" name="hdnFrm" src=""   scrolling="yes" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="width:90%;height:90px"></iframe>   here is my iframe. This in on a php page on a different website. Right below the iframe is a form. The form posts variables to a page on my vb.net website. The codebehind processes the data in the form. The results of processing are sent back to the iframe above. When this happens instead of the height beinc 90px, I want to change it to a different number. How can i do this? Do I set up some type of "listener" for when the controls arrive? I read this somewhere.   

Access an IFrame's body tag in javascript

I want to dynamically set some attributes in an IFrame (like textAlign).  I keep getting "undefined" for all the different things I try.  When I inspect the element, it seems as though I should be able to access the html > body tag from the iFrame object, but that is not the case:var myIFrame = document.getElementById("myIFrame"); alert(myIFrame.childNodes[0]); //Expecting "Html Node", getting "undefined" myIFrame.style.textAlign = "right"; //this does nothing even though I can set the style.textAlign attribute without the javascript failing, it doesn't do anything.  Looking at Chrome's element inspector, I'm able to get the desired result by placing an inline style on the body tag within the iFrame tag.

how to fix the height of the table to be same as the screen size?

hi,iam trying to have my web page design inside a table that fills the screen in width and height.i tried like this<table  border="0" cellspacing="0" cellpadding="0"                         style="width:100%; height:100%; margin-right: 0px; margin-left:0;margin-top:0; margin-bottom: 0px;">            <tr> etc...the table width is filling 100 % but the height is not expanding to the bottom of the screen.my aim is to have a column in the table that looks like a left pane and it will contains dynamically added controls so if there is controls or no the column will have the height of the screenthanks for the help

Contract the Screen.PrimaryScreen.WorkingArea.Height

Hello. I have been developing a Windows Form Application that works as an alert system for my computer, and the form is docked at the bottom of my screen. What I want to do is contract the Screen.PrimaryScreen.WorkingArea.Height by the height of my Windows Form. That way, instead of me having to move my icons from underneath of my application, they will automatically be moved by the operating system due the the contracted Screen.Primary.Screen.WorkingArea.Height.

Here is what I want:


Here is an example of exactly how big I want the working area.  The red rectangle around visual studio represents the working area I want.


I played with some of the properties in the Screen.PrimaryScreen.WorkingArea class and was not able to reach success with my approaches as each time I tried something it gave me compiler errors saying that the properties were either not accessable or are cannot be used like variables.

If anyone knows how to contract the height of the Screen.PrimaryScreen.WorkingArea, please, let me know.

Thank you in advance,
Dave S. Anderson
Owner of DCOM Productions

javascript page height


My footer should be the height of the page. It works with position:absolute; bottom:0, but when my div height of my page is higher than my  document.documentElement.clientHeight, my position:absolute does not work as intended. How can I fix this so my footer is always on the bottom of the page despite my document.documentElement.clientHeight is only 400px and my page height is well over 800.

Determine CSS class, set by javascript, server-side


 I have a website and I use javascript/jQuery to change the CSS classes associated with various controls on the page to hide and displey them based upon user selections.  I want to be able to determine the current Css class for an item on my page when the page is posted back to the server.  Is there any way to determine the current Css class for a control on the server when it's been changed using javascript client-side?

Any suggestions would be greatly apprciated.



how to capture Clieck Event using javascript for pop up screen


Hi ,

I have code for popup screen , but i want to capture some value on click also ,from code behind but not able to capture


below are code 








string modaljs = "function " + radarLimitedCtl.ClientID + "OpenEnlargeMapModalPopup() { $('#" + pnlEnlargeRadar.ClientID + "').showModal(); document.getElementById('" + iEnlargeRadar.ClientID + "').src = '/Controls/Radar/Radar.aspx'; } function " + radarLimitedCtl.ClientID + "CloseEnlargeMapModalPopup() { $('#" + pnlEnlargeRadar.ClientID + "').hideMod

Determine node type selected in TreeView and reading property values


I am hoping that someone can help me get past some problems I am having when using the WPF TreeView control.  I have a TreeView that at most can have 3 levels.  The levels are defined as Project, Discipline, Person which would look like the following:

+ Project

    + Discipline

        - Person

My TreeView is bound to a database using two HierarchicalDataTemplate's and then one DataTemplate (the binding is done in the XAML).

What I would like to get is the following information when selecting an item:

  1. Read the selected value (text of the selected node)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend