Selecting CSS File From C#



Using C# and ASP.NET 1.1, I seek to format a web page using a .css
file. Sparse documentation exists (see
), but I can't seem to reproduce their results. I continue to get an
unformatted page.

My code, with impertinent parts removed:

// WebForm1.aspx
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content=""

<link id="MyStyleSheet" rel="stylesheet" type="text/css"
runat="server" />

// code-behind
public class WebForm1 : System.Web.UI.Page
protected HtmlGenericControl MyStyleSheet;

private void Page_Load(object sender, System.EventArgs e)

// etc...

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question