473,770 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Webcontrols with style?

Hi,

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
webcontrol.

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.

Webcontrol

<%@ 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>
webform

<%@ 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">
<HTML>
<HEAD>
<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">
</HEAD>
<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>
</form>
</body>
</HTML>
Nov 19 '05 #1
3 1318
The best way to use the style is to create a CSS-class and then use
CSSClass for each control.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

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.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #3
Nopes.
But instead of using the default layout from VS.Net, use yours. You'd
have more control.
--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #4

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

Similar topics

2
2007
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"...
4
2927
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:
2
1411
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"
0
1504
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">...
7
1340
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.
2
3472
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.
4
1935
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...
0
1122
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>
1
2026
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.
0
9454
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,...
0
10257
Oralloy
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...
1
10037
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,...
0
8931
agi2029
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...
1
7456
isladogs
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...
0
6710
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();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.