Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Constructor 2/21/2009 10:08 PM
This one is really buggin' me.

I have a simple GridView:
(asp:GridView ID="gvSiteCatalogs" runat="server" CellSpacing="-1" GridLines="None" DataKeyNames="ID" AutoGenerateColumns="False" onselectedindexchanged="gvSiteCatalogs_SelectedIndexChanged")etc......

This renders as:
(table cellspacing="0" rules="all" border="1" id="p_gvSiteCatalogs" style="border-collapse:collapse;")etc......

I do not want border="1".
I can not get rid of border="1".

This is in the module admin.

WHY!!! :)
# martijnb 2/22/2009 12:03 AM
I don't know. In my experience, if you drop a gridview on a form without setting any property, it renders as a pretty clean table.

The guys at forums.asp.net probably know the answer.
# Constructor 2/22/2009 11:39 AM (edited 2/22/2009 11:41 AM)
Ok, I had a look around and tried eveything I could find. Nothing has worked.

I realised that in past projects I have always used Css Control Adapters (now seems to be @ on code.google)

So now I am looking at this. Why MS do this I can not fathom.

Render the tag clean?
Difficult?
(/complaining)
:)
# Constructor 2/22/2009 12:04 PM (edited 2/22/2009 12:21 PM)
BEAUTIFUL!

I have added this to my custom solution and it works perfectly (so far ;) )

1) Download this: http://www.codeplex.com/cssfriendly/SourceControl/ListDownloadableCommits.aspx (the latest one)

2) Build it as 'release' and add the 'CSSFriendly.dll' to the webs '/bin' folder

3) Copy the 'App_Browsers' folder to the 'Cuyahoga.Web' directory within your solution.

4) Rebuild the solution.

5) Check your html output. Brilliant! Clean!

I added the CSSFriendly solution to my customised Cuyahoga solution, put in build events to the correct '/bin'. Now I have full control over the html output over all controls.

The output from the solution is now CSSFriendly and clean and there is fine-grained control over html output.

Bonus points, I am happy :)