Archive for the ‘Visual Studio 2005’ Category

Using CSS Friendly Control Adapter to existing project

What it is: http://aspnet.4guysfromrolla.com/articles/112906-1.aspx
Download and Install: http://www.codeplex.com/cssfriendly

1. Downloading the current release. Go to the Releases tab. You should see three prominent links to files. The zip file contains the source code, the CSSFriendly.dll file contains the compiled source code, and the the CSSFriendlyAdapters.browser file is a configuration file. You only need the dll and browser files.
2. Add a reference to CSSFriendly.dll. This is typically done by right-clicking your web project, choosing the Add References command, browsing for the CSSFriendly.dll file, and clicking OK.
3. Add the CSSFriendlyAdapters.browser file to the AppBrowsers folder in the root of your web project. If the AppBrowsers folder doesn’t exist, create it.

Note:
You may notice the autoFormat you selected for your gridview or other controls is not working anymore. You will have to use the cssclass property of the control to specify the style you want.

Advertisements

Wilco Syntax Highlighter for ASP.NET Tutorial

I am looking for a good syntax highlighter for my new site. I was searching the forum on ASP.NET and eventually stumble upon Wilco’s syntax highlighter. It is open source which gives you the power to configure it. That site lacks a good tutorial and no examples are provided, so it took me a while to figure out how to customized it. (maybe because I’m still a newbie)

First, open and build Wilco’s project in Visual Studio. Then go to “Wilco.SyntaxHighlighting\bin\Debug” folder to get copy the compiled dll file and paste into the bin folder of your other project. Add reference and browse the dll file. Add it to the toolbox by right clicking the area in the toolbox section, browse the dll file again. You should see 4 more controls in the toolbox. Now just drag and drop it into your web page. Select the mode, language and text.

To customize the look, you can change the style setting in the SyntaxHighlighterTemplates.cs file.

Website display partially in IE 7

I am still using IE 6 at work and the website looks fine. When I get home, the website only display partial of the page.  It turns out that it only effect web pages with the Panel control on it. The problem is the default height for the Panel control is 50 px. IE 6 display the whole thing and IE 7 is more restrict and hence only display 50px of the panel. Solution is to get rid of the height.

Put code into readable format using Visual Studio

In visual studio, there is a quick way to indent and put code into readable format. In source view, Edit->Advanced->Format Document or simply use the shortcut, press Ctrl+K first, then Ctrl+D.

Add dll file to Visual Studio project

To add a .dll file into the project, right-click anywhere in the Solution Explorer and choose “Add Reference…”. Click the Browse tab and choose the .dll file. Go to View->Object Explorer to see all the function that comes with the .dll file.

Right click the Toolbox section, click “Choose Items…”. Click the browse button and choose the dll file. Click OK. The dll object should appears in the toolbox now. Just drag and drop the object into the website and configure its properties.