In this article I am going to show how we can read and parse a CSS file in asp.net.
This is my aspx code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Reading a css file</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table cellpadding="2" cellspacing="2" border="2" width="50%" align="center" style="padding: 20px;">
<tr>
<td>
<table cellpadding="2" cellspacing="2" width="100%" align="center">
<tr>
<td valign="top">
<span style="font-family: Verdana; font-size: 10pt; font-weight: bold;">Class Name</span>
</td>
<td valign="top">
<asp:DropDownList ID="DDLCssClass" runat="server" OnSelectedIndexChanged="DDLCssClass_SelectedIndexChanged"
AutoPostBack="true" Width="100px">
</asp:DropDownList>
</td>
<td valign="top">
<span style="font-family: Verdana; font-size: 10pt; font-weight: bold;">Class Property</span>
</td>
<td valign="top">
<asp:ListBox ID="lstClassProperty" runat="server" Width="200px" Height="200px"></asp:ListBox>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
This is my aspx.cs code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;



chap neoxPosted Aug 6, 2013, 3:03 AM
thanks for posting this
Akhil MittalPosted Dec 7, 2012, 12:46 AM
What about tags and id tags for eg. i,body,p,div............ and #divId,#pName.......................
Lori BeckPosted Oct 18, 2011, 8:10 AM
Just what I was looking for -- thank you!!
priyank bhavsarPosted Jun 20, 2011, 2:09 AM
very useful article.. Thanks
sudheer reddyPosted Sep 9, 2010, 8:05 AM
Helped a lot
Blocked AccountPosted Sep 2, 2010, 2:35 AM
Nice Article, Keep it up.