تغییر سایز فریم ها در زمان اجرای فرم وب

rezazd

عضو جدید
ابنجا روشی را می بینید که بوسیله ان میتوان سایز فریم را در زمان لود طوری عوض کرد که اسکرول بار کنار ان نیافتد به ترکیب جاوا و سی شارپ توجه کنید

کد:
[SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] Page_Load([/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] sender, [/SIZE][SIZE=2][COLOR=#2b91af]EventArgs[/COLOR][/SIZE][SIZE=2] e)
{
[/SIZE][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][SIZE=2] jva = [/SIZE][SIZE=2][COLOR=#a31515]""[/COLOR][/SIZE][SIZE=2] ;
jva =[/SIZE][SIZE=2][COLOR=#a31515]"javascript:{"[/COLOR][/SIZE][SIZE=2]+
[/SIZE][SIZE=2][COLOR=#a31515]" var iframe = document.getElementById('iframe1') ;"[/COLOR][/SIZE][SIZE=2]+
[/SIZE][SIZE=2][COLOR=#a31515]" if (iframe.contentDocument) { "[/COLOR][/SIZE][SIZE=2] +
[/SIZE][SIZE=2][COLOR=#a31515]" iframe.style.height = iframe.contentDocument.height + 24 + 'px'; "[/COLOR][/SIZE][SIZE=2] +
[/SIZE][SIZE=2][COLOR=#a31515]" } "[/COLOR][/SIZE][SIZE=2] +
[/SIZE][SIZE=2][COLOR=#a31515]" if (iframe.contentWindow.document.body) { "[/COLOR][/SIZE][SIZE=2] +
[/SIZE][SIZE=2][COLOR=#a31515]" iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 24 + 'px' ; "[/COLOR][/SIZE][SIZE=2] +
[/SIZE][SIZE=2][COLOR=#a31515]" } "[/COLOR][/SIZE][SIZE=2] +
[/SIZE][SIZE=2][COLOR=#a31515]" } "[/COLOR][/SIZE][SIZE=2] ;

iframe1.Attributes[[/SIZE][SIZE=2][COLOR=#a31515]"src"[/COLOR][/SIZE][SIZE=2]] = [/SIZE][SIZE=2][COLOR=#a31515]"../doc/DOC1.HTML"[/COLOR][/SIZE][SIZE=2];
iframe1.Attributes[[/SIZE][SIZE=2][COLOR=#a31515]"onload"[/COLOR][/SIZE][SIZE=2]] = jva ;
[/SIZE]
 
بالا