473,851 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="myc ontrol1.ascx.vb " Inherits="webco ntrolplay.mycon trol1"
TargetSchema="h ttp://schemas.microso ft.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="mycont rol1" Src="mycontrol1 .ascx" %>
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb"
Inherits="webco ntrolplay.WebFo rm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>WebForm1 </title>
<meta name="GENERATOR " content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<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:mycontro l1 id="Mycontrol12 " style="Z-INDEX: 101; LEFT: 32px;
POSITION: absolute; TOP: 24px"
runat="server"> </uc1:mycontrol1>
<uc1:mycontro l1 id="Mycontrol11 " style="Z-INDEX: 101; LEFT: 48px;
POSITION: absolute; TOP: 192px"
runat="server"> </uc1:mycontrol1>
Nov 19 '05 #1
3 1320
The best way to use the style is to create a CSS-class and then use
CSSClass for each control.

Gaurav Vaish

Nov 19 '05 #2
are you therefore suggesting that I don't use the design view in vs.net to
layout my controls?
"MasterGaur av" <ga**********@g mail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
The best way to use the style is to create a CSS-class and then use
CSSClass for each control.

Gaurav Vaish

Nov 19 '05 #3
But instead of using the default layout from VS.Net, use yours. You'd
have more control.
Gaurav Vaish

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Zürcher See | last post by:
I created a webcontrol with inside a dropdownlist, and exposed its proprieties DataSource,DataMember,DataTextField,DataValueField But I can't set the DataSource from the aspx page (DataSource='<%#this.DataSource%>' ). If I set a breakpoint inside the DataSet propriety, I see that the thread never reach this point, the DataSource propriety will never be called. Why? <%@ Register TagPrefix="wcl" Namespace="WebControlLibrary1"...
by: Rodrigo DeJuana | last post by:
Howdy, I'm new to this .net stuff and really have little to no training. Im trying to create a new page for a web form, so i have been pretty much jsut coping code. I having some issue with some textboxes not updating when i a hit save. for example I have this code in my aspx.cs file: declared:
by: Dexter | last post by:
Hello all, I have webform1, and i need to make a bow to catch all textbox in my webform1. I tray this, but don't function. Dim obj As System.Web.UI.WebControls.TextBox Dim cont As Integer For Each obj In Page.Controls. If TypeOf obj Is System.Web.UI.WebControls.TextBox Then obj.Text = "It is a Textbox"
by: I am Sam | last post by:
Ok whats wrong with my toolbar? When I debug I don't get an error message and the databinding is working correctly but the toolbar itself and the <iewc:ToolbarDropDownlist /> control isn't showing up all that is returned to the web page is the buttons text and the contents of the DropDownlist. What am I doing wrong here? Below is the control I typed in and below that is the code behind. <iewc:toolbar id="Toolbar1" runat="server">...
by: Roger Moore | last post by:
Hi all, I have a beginner's question: If webcontrols are rendered to suit different browsers using different HTML syntax for each, how can I create a unified CSS stylesheet to them (using the cssStyle attribute). What I say is that I need to know which HTML tag i'm applying the style to, in order to know which CSS styles are relevant to it.
by: loga123 | last post by:
Hi All, I am using Link Button for DELETE on the gridview. When I click on DELETE link, I get the ArgumentOutOfRangeException. But...it deletes the record from table in the database. On Gridview_rowdatabound, I am dynamically building hyperlink control based on the values in the other fields. Here is my code for Gridview_rowdatabound. It does work sometimes though.
by: bcumminsr | last post by:
Hi, I have a input="type" control and two WebControls.Buttons that do not respond to click events if I type into the file input box a network path and file. I have a break set on the click event and it doesn't even enter the code. If I use the browse button on the input file control to select the file then the click events work. What I am trying to accomplish is have the user select a file on the network and then just take the value...
by: marcyb | last post by:
Can anyone help I am trying to get a WebControl toolbar to work this is my code for a toolbar in visual web developement 2005 express for C# <%@ Page Language="C#" Debug="true" %> <%@ Import Namespace="Microsoft.Web.UI.WebControls" %> <%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> <html> <head>
by: Christopher Houdeshell | last post by:
System.Web.UI.WebControls.Button can load a style based on XAML. This can be done by using the Style method. I was wondering if there was a way to apply a XAML Style to a System.Windows.Forms.Button, since there is no Style method; I am unsure on how to do this.
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.