Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IS some Control depend of IE version in Aps.net

Status
Not open for further replies.

suvv

Programmer
May 7, 2007
1
IN
I am asp.net programmer. I am displaying text/lables control in Panel control. When I browse, in IE 6.0 the All control inside the Panel display Properly. This Panel I have used as Window. But in IE 7.0 some of the controls in from Panel dispear... The panel size also get decreased..
What is the solution ?
 
There are some rendering differences between ie6.0 and ie7.0.
what is the solution?
You will have to play with it and find out. I would suggest not using tables and using CSS only.

 
Most likely a CSS issue.

try removing all formatting from the controls in question (both server side and client) and viewing in IE6 & IE7. then apply styling 1 attribute at a time until you locate the exact style that's causing an issue.

If your using asp.net 2.0 you could opt for master pages, themes and/or skins to set your styling (1 set for IE6, another for IE7.

have a base class that inherits [tt]System.Web.UI.Page[/tt]
Overload the OnInit function, load the appropiate styling based on the browswer.

then have all your webforms inherit from your base class, instead of [tt]System.Web.UI.Page[/tt].

example
Code:
[COLOR=green]//Note: These are not the actual string values, just for demo purpose[/color]
public partial class MyPage : Page
{
     protected overrides void onInit(EventArgs e)
     {
         switch(Request.Browser.Browser)
         {
             case "[IE 6]":
                  this.Theme = "IE 6 Theme";
                  break;
             case "[Mozilla]":
                  this.Theme = "Mozilla Theme";
                  break;
             case "[Opera]":
                  this.Theme = "Opera Theme";
                  break;
             case "[IE 7]":
                  this.Theme = "IE 7 Theme";
                  break;
             default:
                  this.Theme = "Default Theme";
                  break;
        }
     }
}
then have your webforms inhert from this class
Code:
public partial class MyWebForm: MyPage
{
   //process your page
}

instead of inheriting from a base class you could also opt for a master page
Code:
[COLOR=green]//Note: These are not the actual string values, just for demo purpose[/color]
public partial class MyMaster: System.Web.UI.MasterPage
{
     protected overrides void onInit(EventArgs e)
     {
         switch(Request.Browser.Browser)
         {
             case "[IE 6]":
                  this.Theme = "IE 6 Theme";
                  break;
             case "[Mozilla]":
                  this.Theme = "Mozilla Theme";
                  break;
             case "[Opera]":
                  this.Theme = "Opera Theme";
                  break;
             case "[IE 7]":
                  this.Theme = "IE 7 Theme";
                  break;
             default:
                  this.Theme = "Default Theme";
                  break;
        }
     }
}
in the webconfig
Code:
<system.web>
   <pages masterPageFile="~/MyMaster.master">
   </pages>
</system.web>
this wouldn't require you to modify your existing webforms.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top