I want to separate the design and implementation of my web pages into a separate HTML and CSS files (for easier maintenance).
I have the following Page defined in a project.
<%@ Page Title="" Language="C#" MasterPageFile="~/STGGeneral.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="SystemManager.Register" %>
And this makes a reference to the following CSS file
#UsernameLabel
{
position: absolute;
top: 10px;
left: 10px;
}
The trouble is when ASP.NET generates the code sent to the browser it sends the following
<!-- Login Popup -->
<input type="image" name="ctl00$LoginButton" id="ctl00_LoginButton" class="LoginButton" src="Images/key.png" style="border-width:0px;" />
<div id="ctl00_LoginFormPanel" class="LoginPanel">
<div id="ctl00_UpdatePanel1">
<span id="ctl00_LabelUsername">UserId:</span>
<input name="ctl00$UsernameTextBox" type="text" id="ctl00_UsernameTextBox" />
<span id="ctl00_LabelPassword" class="StandardLabel">Label</span>
<input name="ctl00$PasswordTextBox" type="text" id="ctl00_PasswordTextBox" />
<input type="image" name="ctl00$ConfirmLoginButton" id="ctl00_ConfirmLoginButton" class="ConfirmLoginButton" UseSubmitBehavior="false" src="Images/Security.png" style="border-width:0px;" />
</div>
</div>
Because my 'Username' label is now called ctl00_LabelUsername by ASP.NET the style which positions this code тo longer works.
Is there a way of telling ASP.NET that I do not want it to change the name of my objects, or how do you do a reference using '#' within a page generated by a master/content page combination.