Mingebag
Mingebag

Reputation: 758

Internet explorer 8 issues with design

I'm working on a project a tool to track holidays and there are some parts of this application (report administration), the role "user" should not see. So far that works without problems, but somehow the representation of the parts that a "user" should not see look terrible:

enter image description here

The permission who should see something on the page is controlled in the Web.sitemap

 <siteMapNode title="Vacation" roles="Administrator,Location Business Leader,Business Leader,Department Leader" description="All employees with vacation" url="~/EmployeeView/UserVacationGrid.aspx" />

If someone had the same problem and, could you give me some good tips or a solution how to fix this I would really appreciate it!

Upvotes: 0

Views: 116

Answers (1)

atconway
atconway

Reputation: 21304

The problem is that whatever you are hiding (either client side or server side) is not encapsulating all of the controls associated. So for example, if you were using an ASP.NET menu, then you could hide a menu option server side with the following code:

switch (UserRole) {
    case "Administrator":
        Menu1.Items.Item(0).Enabled = false;
        break;
}

These controls will make sure to collapse all the associated HTML with that option. If however you are using your own controls, or hiding things client side you need to make sure to hide the entire container (i.e. <div>) containing the control. A good way to do this is with jQuery:

$("#divVacationControl").hide();

Your best bet at figuring out which controls in IE8 are not being hidden and leaving that undesirable look is to use the IE developer toolbar. You can access it via F12 button, or Tools -> Developer Tools It can also be downloaded from here: http://www.microsoft.com/en-us/download/details.aspx?id=18359

Once open use the 'Select Element by Click' function to inspect the non-hidden elements and inspect the DOM. You can then find the culprit not being hidden and check your logic.

The last method if it only happen in a certain browser is to set its compatibility mode. Not saying this is the best way but it's an option. You can read how to do this in a blog post of mine below; just use IE7 or whatever worked for you. I would not recommend this approach as a long term solution unless this is a corporate intranet app that you have total control over the environment.

Specifying Document Compatibility Modes for ASP.NET Intranet Sites using IE8

Upvotes: 3

Related Questions