Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

This is my first attempt at CSS..

 

1. I have an "ascx" file. Added this line to it:

<%@ Control Language="vb" AutoEventWireup="false" Codebehind="SideMenu.ascx.vb" Inherits="ASPApp.SideMenu" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
[b]<LINK href="Styles.css" type="text/css" rel="stylesheet">[/b]

 

2. Added a button with this line:

<TR bgColor="lightslategray">
	<TD align="middle" colSpan="1" height="50" rowSpan="1"><asp:button id="btnHome" runat="server" Text="Home" Font-Bold="True" [b]CssClass="ButtonStyle" [/b]></asp:button></TD>
</TR>

 

3. Added a CSS Class:

.ButtonStyle
{

height : 50px;
width : 150px;

}

 

But the Height and Width arent being read from the CSS file. In my .Net book, it has to put the "link" in between <HEAD>...but i do NOT have a <HEAD> tag in ascx file..

 

What am I missing??

Posted

You use external CSS file in user control?

 

Please do remember user control not independ, so it's URL is follow the webform you tie to. In your case, I suspect your webform and user control not located in same directory, so the system can't found the actual CSS file.

 

Hope you understand what I talking about... :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...