How do you control the placement of controls in a user define control

I have a user define control.  I put the control on the (C# Visual Studio 2008) page where I want them. When I run the program, the controls are all over the page.  How do I place them where they do not move form where I put them?

7/16/2008 3:41:30 PM 3498 articles. 0 followers. Follow

5 Replies

Similar Articles

[PageSpeed] 41
Get it on Google Play
Get it on Apple App Store

You'll need to study the HTML output and see what it's producing, then start to look at how to do an HTML layout.

7/16/2008 3:54:20 PM


there are absolute and Relative position in html. I guess you must use relative position. For example, at design-time, you place a TextBox below an Image, at run-time, no matter what size is the image, the TextBox is alway below the image, so the TextBox's position in design-time and run-time is different.

You can get much greater detail in

Hope this can solve your problem.

What really matters most is the chance to communicate with you, my friends, rather than marking my post as answer, though I would be really appreciated if you do so.
7/17/2008 5:04:41 AM

Hi there

Use (X)HTML _and_ CSS to positioning all Elements.

There is also the "static" as Default.

Microsoft MVP - Visual Developer ASP / ASP.NET

- - Auf den Spuren von .NET
7/17/2008 1:09:56 PM

hi, peter

i know there is also fixed position, but i don't know the "static".

Can you provide some links about it? Thank you.

What really matters most is the chance to communicate with you, my friends, rather than marking my post as answer, though I would be really appreciated if you do so.
7/17/2008 2:01:49 PM

Hi there

Yep, fixed is too out here :)

static is de default value, see:

Microsoft MVP - Visual Developer ASP / ASP.NET

- - Auf den Spuren von .NET
7/17/2008 2:48:23 PM

Similar Artilces:

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

how to raise server control event(control defined inside user control) from host page?
I have built a user control(using c#,net 2.0,VS2005,MS-SQL server 2005),which contains set of 3 button,save,cancel and next and wud be reused/displayed in multiple pages.As the name says,they are suppose to update on save,reset the fields   on cancel and navigate to another page on next.How do i raise the onClick event for all of these button individually,from the individual host page?I do not have/do not prefer any logic,event handler etc.. defined in the user control for these buttons,since every host page have different set of parameters for save,cancel etc.Thanks...

User Control controls not created when dynamically creating user control
  Have created a user control for displaying and editing a dynamically number of values. The user control contains two labels and an edit box. When dynamically loading the user control I get an error when the control itself tries to change setting on the fields within the user control.   Why doesnt this work? It works okay if I dont load it dynamically but create a user-control-instance in the aspx-page but thats no solution.   Thankyou!     Here is my code:   ucDataValue.ascx   <%@ Control Language="C#" AutoEventWireup="true&...

User Controls not working if I put Validation controls in user control
Hi           I have validation controls(RequiredField Validator,RegularExpressionValidator)  in user controls.User controls are not posting back like the events are not wiring up.If I remove Validation controls in User controls page,user controls are working fine.Can anyone please help me out in getting it fixed. In the Validation controls, make sure you are setting the ControlToValidate property to the control that it links to.  If you're in .NET 2.0, it's also a good idea to put all the validation controls in the same Valid...

load user control from server custom control
hi all,i have a 3rd party menu control that consists of a bunch of HyperLinks and a PlaceHolder control (C# v1.1.4) . links to .ascx files are retrieved from a data source, and when the page containing the control is loaded or a link clicked, the control uses this.Page.LoadControl(strLink) to add the .ascx to the PlaceHolder. fine and dandy, probably wouldnt have done it that way myself, but i'm stuck with it :)the problem is events: i can't raise 'em :( if i have for example a Button control on one of the .ascx pages, the Button.Click will go by unnoticed on the post-back. stran...

User Controls and Custom Controls
what is Diff between User Controls and Custom Controls? User controls are asmx files, you can use them as a webpage, drag and drop as many controls you want and still user the user control to drop it into a form.Custom Controls are inherit from the control or used as composite control. You need to write the control by hand and override all the properties. They can be added into your toolbar.Hope this helpsCheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question! Also... User Controls are generally application specific.  If you want...

How to access a user control from another user control in a Wizard control
My page has a wizard control and each step is a user control.  I could find the value of a control in step1 user control in the wizard page but not in step2 user control.From wizard.aspx.vb – it worksDim m_title As DropDownList = CType(Me.PersonalBox1.FindControl("ddlTitle1"), DropDownList) Question:How can I find the value of a control(textbox or dropdownlist)in step1 user control from step2 user control? I want to find “PersonalBox1.FindControl("ddlTitle1")” from Step2 AddressBox1. I have tried several ways to access it but no luck. From AddressBox.ascx.vb –...

Custom Controls or User Controls
Hi, I have to create a menu control and I am unable to decide between a custom control or user control.  Apart from the fact that a custom control can be inserted into the toolbox what are the other advantages and disadvantages of each like performance, and so on.  Plus how do I decide between the two. Thanks Arjuna. Hello Please refer to the KB article Overview of user controls vs. custom controls Hope it helps, JessicaJessica CaoSincerely,Microsoft Online Community Support“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer...

user control and custom control
What is different between Web User Control and Web Custom Control?, EdMicrosoft MVP - ASP/ASP.NET I would suggest you to google the word "different between Web User Control and Web Custom Control" to get more informations and results...Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET Web custom controls are compiled components that run on the server and that encapsulate user-interface and other related functionality into reusable pack...

Using a user control in a custom server control.
I've created a custom server control and am trying to add a user control to the rendering of the server control.  Is this possible?  If so, hints as to how this is done would be GREATLY appreciated!  Thanks in advance for considering an answer to this question. Wendi Use the LoadControl method. For example:   Controls.Add(LoadControl("~/controls/login.ascx"))Steven BeyRecursion: see Recursion My server control renders a table with x number of rows.  I want to add a user control to each row of the table, last column.  I do not know how ...

user control or custom control ?
i have datagrid which shows monthyear user control for each row. The month year user control has two drop down list. one is for year and other one is for month. So for each row in particular column i'll have that user control loaded. it works fine but ut takes lot of time in rendering when there are 200 rows. what would be the solution. will custom control help? Hi,Lax4u: Some tips i am not quite sure. First, you can disable the viewstate of the userControl to make it not load so many information in each postback and store the necessary in the global range. Second, Caching porting of th...

controlling user controls
I'm starting an app. I'm using a usercontrol for a template. In my "template" I have a usercontrol that at times displays a login form. In this usercontrol is a link to the register page. Currently, my register page works by just calling my register user control in the main content area of the template. I'd like to cut out the register.aspx so that the link simply tells the other area on my page to display the register.ascx. So that I don't have several pages... just one default.aspx. How do I do this? I'm thinking the template.ascx will have a placeholder in the main...

user control to user control
I have an aspx page that have a "Register" directive to two usercontrol called rptMaster.ascx and rptDetail.ascx. I'm trying to set up a Master-Detail relationship and wish for the rptMaster.ascx to trigger and event from a dropdownlist and for the rptDetail to be listening for DropDownList event. I believe I have gotten the events part okay with help from this articel but my declaration for a private statement to my rptMaster class is producing an error. I'm using beta 2 of and I 'm having trouble getting a reference TO ...

Web resources about - How do you control the placement of controls in a user define control -

SMT placement equipment - Wikipedia, the free encyclopedia
Internal details of a two head, gantry style pick-and-place JUKI SMT machine. In the foreground are tape and reel feeders, then the (currently ...

REPORT: Facebook Desktop News Feed Ad Placements Costly for Black Friday, Cyber Monday
Digital marketing agency 3Q Digital shared some insights about the Black Friday and Cyber Monday Facebook advertising performances of two of ...

Ad placements do matter on Facebook — here’s what you need to know
Did you know that there are 5 possible ad placements on Facebook? We have two right column ad placements on desktop (homepage and non-homepage), ...

Speaking of Unpaid Apple Product Placement on Twitter
The Cleveland Indians bullpen caught teammate Brandon Moss’s landmark 100th career home run. They delivered a ransom note for the ball.

20120418IMG_1457-Microphone placement shoot - Flickr - Photo Sharing!
ORTF (Office de Radiodiffusion Télévision Française) stereo mic placement. Two cardioid mics placed about 7 inches apart, and angled about 110 ...

Black20 Trailer Park: Spiderman 3 - Product Placement - YouTube
Spiderman 3 went way over budget, and to finish the film, producers had to use product placement to generate more money. Spiderman 3, starring ...

Emirati teenagers say yes to work placements
The latest batch of students from Yes to Work, a programme that gives vocational training and work placements to Emirati teenagers, is set to ...

The Bachelorette Australia 2015: What was with those sneaky product placements?
... It wasn't the awkward three-on-one Turkish bath scene which looked like something out of Eyes Wide Shut, but some rather blatant product placement. ...

Sirius share placement reaps $189m
Sirius Resources receives $189m from institutional investors to finance development of Nova nickel project. The timing of the placement at $3.82 ...

TPG raising $300m in share placement - HeraldSun Search Search
TPG Telecom is raising $300 million through a placement of shares to local and overseas institutions.

Resources last updated: 12/28/2015 5:43:50 AM