Total Pageviews

Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Thursday, December 17, 2009

How to dynamically adjust an iframe’s height?

I was looking to display content of the other aspx page inside iframe but i wasnt able to adjust the height of the iframe. so try out this solution to resolve it.

Insert iframe on page
   <iframe scrolling='no' frameborder='0' id='frmid' src=’getad.aspx'
            onload='javascript:resizeIframe(this);'>
   </iframe>


Use this javascript to resize iframe based on the height & width of child page




<script language="javascript" type="text/javascript">
 function resizeIframe(obj)
 {
   obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
   obj.style.width = obj.contentWindow.document.body.scrollWidth + 'px';
 }
 </script>


What does this code do? When the body of the parent frame loads, it looks up the document element “childframe” which corresponds to the iframe. Then the page calls a function resizeFrame(). The function sets the height of the frame to be the scrollHeight, which effectively removes the scrollbar.

happy programming!

Friday, November 13, 2009

jQuery for Absolute Beginners: The Complete Video Series

A great VIDEO series on all the nice effects (and functionality) you can achieve with jQuery JavaScript library for those who know NOTHING about it.
jQuery is a very powerful library. One of the first things I do when creating new project is to include the library in it. Microsoft is going to include it by default in ASP.NET web projects (All ASP.Net projects, not just MVC) starting Visual Studio 2010.
Here are some few examples of what you can do with it (VIDEO):

http://net.tutsplus.com/articles/web-roundups/jquery-for-absolute-beginners-video-series/?awesm=fbshare.me_EIez#



---
Happy Programming

Blog Archive

Ideal SQL Query For Handling Error & Transcation in MS SQL

BEGIN TRY BEGIN TRAN --put queries here COMMIT; END TRY BEGIN CATCH IF @@TRANCOUNT>0 BEGIN SELECT @@ERROR,ERRO...