Avia Afer
Avia Afer

Reputation: 866

strange behavior with response from code behind css rounded corner dissapears in IE9

I was about to write a whole post on my situation "the rounded corner css style disappeared after post back" and post my code here ...

so instead of posting my code I have rebuilt both aspx via it's js scripts piece by piece and same with code behind...

then I discovered the issue !!

the line who was responsible, was Response.Write("some value of a test");

I could just stay with that and fix with eliminating the un necessary Line, and actually delete this post just cause I have solved that issue , and that line was only a test, just as you would use Console.WriteLine() in a console application..

and also I could always avoid Response.Write() via setting an Html element's Text and plot values.

but The Question remains , and also for my understanding, why does the Response.Write() eliminated my Rounded corner css style , isn't it a bug ?

how on earth it is related, where is there a clue or a warning for that issue ??

Update

this is the css which was fine till this incedent

    .Rounded
    {
    -moz-border-radius: 20px;
    -webkit-border-radius: 20px;
    -khtml-border-radius: 20px;
    border-radius: 20px;
    }

Upvotes: 1

Views: 537

Answers (1)

DGibbs
DGibbs

Reputation: 14618

As per the comments..

The issue here is that your call to Response.Write("some value of a test"); is breaking the markup on the page and causing IE to render in Quirks Mode which is why your rounded borders are disappearing.

The solution would be to create well formed markup. You can check your HTML against your doctype using the W3C Validator, it will inform you of any errors with your code.

A suggestion would be to create a standard <asp:Label> and assign your text to it rather than outputting a string with no tags.

You could even do: Response.Write("<span>some value of test</span>");

Upvotes: 2

Related Questions