Webcontrols with style?




I've been playing around with asp.net and don't understand how to get my web
controls to 'inherit' (which is probably the wrong phrase) the style from
the web form they are on.

I cut and paste a text box control and a button from a web form into a blank

I then place this web control on a web form, move the control around so I
have a nice layout.

When I run the app however the webcontrol doesn't stay where I put it in
design time and doesn't seem to use the style tag which is in the control at
design time.

Why is this.

The code for the control and web form are attached below.


<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="mycontrol1.ascx.vb" Inherits="webcontrolplay.mycontrol1"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button>


<%@ Register TagPrefix="uc1" TagName="mycontrol1" Src="mycontrol1.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 16px; POSITION:
absolute; TOP: 72px" runat="server"
Width="152px" Height="96px"></asp:TextBox>
<uc1:mycontrol1 id="Mycontrol12" style="Z-INDEX: 101; LEFT: 32px;
POSITION: absolute; TOP: 24px"
<uc1:mycontrol1 id="Mycontrol11" style="Z-INDEX: 101; LEFT: 48px;
POSITION: absolute; TOP: 192px"


are you therefore suggesting that I don't use the design view in vs.net to
layout my controls?

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