It is pretty easy to add the CSS friendly adapters to existing ASP.NET projects.
The quickest way I see is to create a new web project from the ASP.NET CSS Friendly Web Site template and then open that project in the Explorer and drag the needed parts into the Solution Explorer of your existing web project where you want to enable the
adapters.
The parts you need to add/drag into your project are:
Then you can edit the CSSFriendlyAdapters.browser file in the App_Browsers folder and comment out the adapters that you do not want to use, as you said you only wanted the Menu adapter.
After these steps you should be able to build your project and have the adapters kick in and do their magic. Then it is up to you to do the CSS styling...
Best regards,
Per Salmi
Per Salmi, Software Developer .NET Technologies PerSalmi.NET
Even better, if you go to the CodePlex project (if I remember correctly:
www.codeplex.com/cssfriendly), you can get a compiled version:
It contains only two files: a .dll and aa .browser . Copy them to their respective folders (Bin and App_Browsers) and you are ready!
Juan
Juan Barrera
MCTS
Please remember to click "Mark as Answer" on this post if it helped you.
No, and that's the good thing: no web.config entries, no conditional css, just drop the .dll in the Bin folder, the .browser file in the App_Browsers folders and you are done!
Anyway, just have a look at the link I posted, there is interesting information there....
Cheers,
Juan Barrera
MCTS
Please remember to click "Mark as Answer" on this post if it helped you.
Please also keep in mind that the whitepaper that comes with the CSS Friendly adapter kit contains a section entitled, "Using these adapters in your web site" that is intended to give you a step-by-step set of instructions for using these adapters in an
existing web site,
http://www.asp.net/cssadapters/whitepaper.aspx#SamplesUsingInYourWebSite. That section's intro includes this statement, "If you want to integrate these adapters into an existing site, follow these instructions..."
The CodePlex solution is probably easier for most people to use, however, as it involves far fewer files. However, there are many cases where folks can't use a DLL in their site due to security limitations. In such cases it is best to use the kit's uncompiled
files in order to integrate these adapters. Either way, it shouldn't be terribly hard to do this integration.
Ok so I did all this and now my forms like my login form dont submit any data. I am pretty good at classic asp and C# win forms but i am still learning ASP.net and this happend to me once before when I had some bad javascript in a file. ASP.net seams to
break if something that shouldnt matter on the grand scale isnt right its can screw up everything..If I take the APP_Browser/CSSFriendlyAdapters.browser out of the site then everything works fine, well none of the Css controls are working yet but my site works..
You might want to get a the kit running locally. There are instructions for doing so in the Tutorial that is online. Test that you can get its Login page to work for you. Note, though that its Login page hooks up to a special (read: fake) MembershipProvider.
This simply allows the kit to emumlate a real MembershipProvider (ala the ones that you would normally use in a real ASP.NET 2.0 site). If you can get the kit's version of the Login to work locally with its fake provider then slowly morph it (by modifying
its connection and provider) to hook up to a real ASP.NET 2.0 membership provider. Then modify the CSS that comes with that sample so that the page displays as you wish.
That is the recipe I generally fall back on when I'm stuck. It's obviously a step-by-step approach that's not particularly simple in all situations but it generally is the most reliable to eventually achieve success... in my not-so-humble opinion. :)
Or....
You might look more carefully at the notion that your data isn't submitting. What exactly is happening when you click on the submit button? If the page isn't submitting at all then something on the page is preventing that. Is there some JS that you can unravel
to see if it is interfering. Maybe the page isn't submitting because it has some validators on it that think that the page isn't ready to be submitted yet. They could be "blocking" the submission completely on the client-side (i.e., via JavaScript in the browser).
avida
Member
120 Points
38 Posts
Retrofitting CSS adapters into an existing website
May 21, 2007 09:32 AM|LINK
Hi,
Using the CSS adapters seems simple so long as you start with the CSS template. How do I retrofit these adapters into an existing website.
I am mainly interested in the menu adapter.
Thanks.
persa
Participant
915 Points
144 Posts
Re: Retrofitting CSS adapters into an existing website
May 21, 2007 01:23 PM|LINK
It is pretty easy to add the CSS friendly adapters to existing ASP.NET projects.
The quickest way I see is to create a new web project from the ASP.NET CSS Friendly Web Site template and then open that project in the Explorer and drag the needed parts into the Solution Explorer of your existing web project where you want to enable the adapters.
The parts you need to add/drag into your project are:
Then you can edit the CSSFriendlyAdapters.browser file in the App_Browsers folder and comment out the adapters that you do not want to use, as you said you only wanted the Menu adapter.
After these steps you should be able to build your project and have the adapters kick in and do their magic. Then it is up to you to do the CSS styling...
Best regards,
Per Salmi
PerSalmi.NET
Rasetti
Participant
1216 Points
286 Posts
Re: Retrofitting CSS adapters into an existing website
May 26, 2007 08:09 AM|LINK
Even better, if you go to the CodePlex project (if I remember correctly: www.codeplex.com/cssfriendly), you can get a compiled version:
It contains only two files: a .dll and aa .browser . Copy them to their respective folders (Bin and App_Browsers) and you are ready!
Juan
MCTS
Please remember to click "Mark as Answer" on this post if it helped you.
persa
Participant
915 Points
144 Posts
Re: Retrofitting CSS adapters into an existing website
May 26, 2007 11:22 AM|LINK
That sounds really nice! Got to check that out...
/Per Salmi
PerSalmi.NET
avida
Member
120 Points
38 Posts
Re: Retrofitting CSS adapters into an existing website
May 26, 2007 11:39 AM|LINK
That sounds good. Are there any entries needed in the web.config file and are there any draw backs over the previous solution ?
Thanks
Rasetti
Participant
1216 Points
286 Posts
Re: Retrofitting CSS adapters into an existing website
May 26, 2007 11:44 AM|LINK
No, and that's the good thing: no web.config entries, no conditional css, just drop the .dll in the Bin folder, the .browser file in the App_Browsers folders and you are done!
Anyway, just have a look at the link I posted, there is interesting information there....
Cheers,
MCTS
Please remember to click "Mark as Answer" on this post if it helped you.
Russ Helfand
Contributor
3304 Points
744 Posts
Re: Retrofitting CSS adapters into an existing website
May 26, 2007 04:56 PM|LINK
Please also keep in mind that the whitepaper that comes with the CSS Friendly adapter kit contains a section entitled, "Using these adapters in your web site" that is intended to give you a step-by-step set of instructions for using these adapters in an existing web site, http://www.asp.net/cssadapters/whitepaper.aspx#SamplesUsingInYourWebSite. That section's intro includes this statement, "If you want to integrate these adapters into an existing site, follow these instructions..."
The CodePlex solution is probably easier for most people to use, however, as it involves far fewer files. However, there are many cases where folks can't use a DLL in their site due to security limitations. In such cases it is best to use the kit's uncompiled files in order to integrate these adapters. Either way, it shouldn't be terribly hard to do this integration.
Groovybits.com
avida
Member
120 Points
38 Posts
Re: Retrofitting CSS adapters into an existing website
May 27, 2007 04:44 PM|LINK
Thanks for that. In the deluge of info, i missed that 1
j3rm
Member
2 Points
10 Posts
Re: Retrofitting CSS adapters into an existing website
Jun 02, 2007 04:38 AM|LINK
Ok so I did all this and now my forms like my login form dont submit any data. I am pretty good at classic asp and C# win forms but i am still learning ASP.net and this happend to me once before when I had some bad javascript in a file. ASP.net seams to break if something that shouldnt matter on the grand scale isnt right its can screw up everything..If I take the APP_Browser/CSSFriendlyAdapters.browser out of the site then everything works fine, well none of the Css controls are working yet but my site works..
Any thoughts?
Russ Helfand
Contributor
3304 Points
744 Posts
Re: Retrofitting CSS adapters into an existing website
Jun 02, 2007 04:53 AM|LINK
You might want to get a the kit running locally. There are instructions for doing so in the Tutorial that is online. Test that you can get its Login page to work for you. Note, though that its Login page hooks up to a special (read: fake) MembershipProvider. This simply allows the kit to emumlate a real MembershipProvider (ala the ones that you would normally use in a real ASP.NET 2.0 site). If you can get the kit's version of the Login to work locally with its fake provider then slowly morph it (by modifying its connection and provider) to hook up to a real ASP.NET 2.0 membership provider. Then modify the CSS that comes with that sample so that the page displays as you wish.
That is the recipe I generally fall back on when I'm stuck. It's obviously a step-by-step approach that's not particularly simple in all situations but it generally is the most reliable to eventually achieve success... in my not-so-humble opinion. :)
Or....
You might look more carefully at the notion that your data isn't submitting. What exactly is happening when you click on the submit button? If the page isn't submitting at all then something on the page is preventing that. Is there some JS that you can unravel to see if it is interfering. Maybe the page isn't submitting because it has some validators on it that think that the page isn't ready to be submitted yet. They could be "blocking" the submission completely on the client-side (i.e., via JavaScript in the browser).
Groovybits.com