473,756 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help with user controls

I have now spent 5 hours on google/msdn looking for something useful in the
creation of user controls for asp.net. The VS 2003 has very limited support
for things such as absolute positioning of the control etc.
Nov 18 '05 #1
13 1588
I'm not quite sure what you are looking for, but there is extensive coverage
of user controls not only in my book (Programming ASP.NET -O'Reilly) but in
many other books on Programming ASP.NET. As for positioning, you should be
able to position your user control much like any other control; you may want
to take a look at the portal sample (I buy spy) provided by Microsoft, which
makes extensive use of User Controls.

Best of luck.

-j

-----------
Jesse Liberty
http://www.LibertyAssociates.com
Author: .Net Programming books - O'Reilly

"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message
news:GH******** *********@news0 1.bloor.is.net. cable.rogers.co m...
I have now spent 5 hours on google/msdn looking for something useful in the creation of user controls for asp.net. The VS 2003 has very limited support for things such as absolute positioning of the control etc.

Nov 18 '05 #2
..NET Quickstart tutorials are always a good starting point
if you haven't looked at them already.

Web Forms User Controls
-----------------------
http://samples.gotdotnet.com/quickst...us/doc/webpage
lets.aspx

Abosulte positioning can done thru the design mode when
you drag and drop your control on to a web form. Is their
anything more specific you are looking for?

HTH,
Suresh.
-----Original Message-----
I have now spent 5 hours on google/msdn looking for something useful in thecreation of user controls for asp.net. The VS 2003 has very limited supportfor things such as absolute positioning of the control etc.

.

Nov 18 '05 #3
I am trying to use VS 2003. The support is so confusing it is useless. The
articles you refer to have no relation to VS that I can see. None of them
use absolute positioning or VS 2003.

I want tutorials using this software. Why would someone spend +$1000 on
software instead of notepad, the answer to make the development cycle
quicker and less error prone. So far in the creation of user controls I see
no support that makes sense. I am assumming that I just do see the correct
path through VS 2003.

Thanks for the link but that was one of the hundreds I have looked at today.

Lloyd
"Suresh" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
.NET Quickstart tutorials are always a good starting point
if you haven't looked at them already.

Web Forms User Controls
-----------------------
http://samples.gotdotnet.com/quickst...us/doc/webpage
lets.aspx

Abosulte positioning can done thru the design mode when
you drag and drop your control on to a web form. Is their
anything more specific you are looking for?

HTH,
Suresh.
-----Original Message-----
I have now spent 5 hours on google/msdn looking for

something useful in the
creation of user controls for asp.net. The VS 2003 has

very limited support
for things such as absolute positioning of the control

etc.


.

Nov 18 '05 #4
Hi Lloyd,

I've found that wrapping all of the user control html in a asp:panel, and
then exposing that style property of the asp:panel as a public property of
the control, it works real well. this way, you can easily position it.
Example:

<%@Control%>
<asp:panel runat=server id=wrapper>
Put the regular control contents overhere ...
</asp:panel>

.... in the codebehind or in a SCRIPT runat=server block,

Public Property Readonly Style as CssStyleCollect ion
Get
Return wrapper.style
End Get
End Property

-- Alex Papadimoulis

"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message
news:GH******** *********@news0 1.bloor.is.net. cable.rogers.co m...
I have now spent 5 hours on google/msdn looking for something useful in the creation of user controls for asp.net. The VS 2003 has very limited support for things such as absolute positioning of the control etc.

Nov 18 '05 #5
Ok guys thank for the help. Let me explain what I have tried.

1. Create a Web User Control within ASP project.
2. Add GridFlow panel and add controls within
3. Drag WUC to the asp page I want to have the control on.

Now the problems commence.

A. No support for absolute positioning of the control.
B. No reference to the control in the VB codebehind page.

So that is useless for my purposes.

Next try.

1. Create Web Control Library

Now the problems commence (already). When I go to add the web control I can
only add windows form controls. Now the help line on the New Project dialog
states "A project for creating controls to use in Web applications". The
problem is that within this project there is no designer support.

Now after some experimenting I see that if I just say add new item then the
selections change. MS please please fix VS. Now there is still no designer
support. What good is an IDE if all you really need is notepad.

All in all totally useless for RAD.

Lloyd Sheen
Nov 18 '05 #6
>A. No support for absolute positioning of the control.
You are right. VS.NET ide doesn't seem to support
absolute positioning for a user control. I'm not sure if
there's a setting that'll allow you to control that.
But a possible workaround is to place a control that does
absolute positioning such as a Label and place it in the
form where you want the control. Then take the Style
property text and place it inside your user control.
Hopefully someone here has a more elegant way.
B. No reference to the control in the VB codebehind page.
This is because the object doesn't get declared in the
codebehind automatically. You have to manually add it.
It should be like the following.

Protected <YourUserContro lClassName> <IDofyouUserCon trol>

That should create the reference in your codebehind.

HTH,
Suresh.
-----Original Message-----
Ok guys thank for the help. Let me explain what I have tried.
1. Create a Web User Control within ASP project.
2. Add GridFlow panel and add controls within
3. Drag WUC to the asp page I want to have the control on.
Now the problems commence.

A. No support for absolute positioning of the control.
B. No reference to the control in the VB codebehind page.

So that is useless for my purposes.

Next try.

1. Create Web Control Library

Now the problems commence (already). When I go to add the web control I canonly add windows form controls. Now the help line on the New Project dialogstates "A project for creating controls to use in Web applications". Theproblem is that within this project there is no designer support.
Now after some experimenting I see that if I just say add new item then theselections change. MS please please fix VS. Now there is still no designersupport. What good is an IDE if all you really need is notepad.
All in all totally useless for RAD.

Lloyd Sheen
.

Nov 18 '05 #7
I have tried some of the things you have suggested.

A. No support for absolute positioning of the control. You are right. VS.NET ide doesn't seem to support
absolute positioning for a user control. I'm not sure if
there's a setting that'll allow you to control that.
But a possible workaround is to place a control that does
absolute positioning such as a Label and place it in the
form where you want the control. Then take the Style
property text and place it inside your user control.
Hopefully someone here has a more elegant way.


I can make the designer place the control by stealing position info from
another control. This is lost when the page renders.
B. No reference to the control in the VB codebehind page.


This is because the object doesn't get declared in the
codebehind automatically. You have to manually add it.
It should be like the following.

Protected <YourUserContro lClassName> <IDofyouUserCon trol>

That should create the reference in your codebehind.


My big bitch is that a development IDE that requires the user to do
everything manually is a waste of money. I have tried so many things today
I know that one thing I did created the control. The problem with just
declaring it is that there is no instant of the control during run-time.

Nov 18 '05 #8
Hi Lloyd,

I completely agree with you -- the VS.NET IDE is pretty worthless when it
comes to making decent looking websites. However, it's an essential took
for creating your middle tier classes -- the integration with SQL Server,
intellisense, and so on are all wonderful. I'd advise sticking with
Dreamweaver to develop the ASPX pages and ASCX controls, and just use VS.NET
to develop your middle tier. I've found that to be the most productive
approach.

Alex Papadimoulis
"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message
news:b7******** **********@news 01.bloor.is.net .cable.rogers.c om...
I have tried some of the things you have suggested.

A. No support for absolute positioning of the control. You are right. VS.NET ide doesn't seem to support
absolute positioning for a user control. I'm not sure if
there's a setting that'll allow you to control that.
But a possible workaround is to place a control that does
absolute positioning such as a Label and place it in the
form where you want the control. Then take the Style
property text and place it inside your user control.
Hopefully someone here has a more elegant way.


I can make the designer place the control by stealing position info from
another control. This is lost when the page renders.
B. No reference to the control in the VB codebehind page.


This is because the object doesn't get declared in the
codebehind automatically. You have to manually add it.
It should be like the following.

Protected <YourUserContro lClassName> <IDofyouUserCon trol>

That should create the reference in your codebehind.


My big bitch is that a development IDE that requires the user to do
everything manually is a waste of money. I have tried so many things

today I know that one thing I did created the control. The problem with just
declaring it is that there is no instant of the control during run-time.

Nov 18 '05 #9
Putting the reference does nothing other than creating a variable. It is
never set and cannot be used.
"Suresh" <an*******@disc ussions.microso ft.com> wrote in message
news:12******** *************** ******@phx.gbl. ..
A. No support for absolute positioning of the control.

You are right. VS.NET ide doesn't seem to support
absolute positioning for a user control. I'm not sure if
there's a setting that'll allow you to control that.
But a possible workaround is to place a control that does
absolute positioning such as a Label and place it in the
form where you want the control. Then take the Style
property text and place it inside your user control.
Hopefully someone here has a more elegant way.
B. No reference to the control in the VB codebehind page.


This is because the object doesn't get declared in the
codebehind automatically. You have to manually add it.
It should be like the following.

Protected <YourUserContro lClassName> <IDofyouUserCon trol>

That should create the reference in your codebehind.

HTH,
Suresh.
-----Original Message-----
Ok guys thank for the help. Let me explain what I have

tried.

1. Create a Web User Control within ASP project.
2. Add GridFlow panel and add controls within
3. Drag WUC to the asp page I want to have the control

on.

Now the problems commence.

A. No support for absolute positioning of the control.
B. No reference to the control in the VB codebehind page.

So that is useless for my purposes.

Next try.

1. Create Web Control Library

Now the problems commence (already). When I go to add

the web control I can
only add windows form controls. Now the help line on the

New Project dialog
states "A project for creating controls to use in Web

applications". The
problem is that within this project there is no designer

support.

Now after some experimenting I see that if I just say add

new item then the
selections change. MS please please fix VS. Now there

is still no designer
support. What good is an IDE if all you really need is

notepad.

All in all totally useless for RAD.

Lloyd Sheen
.

Nov 18 '05 #10

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

Similar topics

23
3282
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
5
2410
by: Franco, Gustavo | last post by:
Hi, I have a question, and please I need a answer. How can I finalize a thread running with Application.Run (I need the message loop!!!) without call Thread.Abort?. I want to call Application.ExitThread in the same thread that it is running.
1
7587
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
0
875
by: Kevin Jones | last post by:
I'm developing an ASP.NET application on my local machine and I am able to reference user-defined methods and other public members from my user controls just fine, but when I copied the project up to a staging server for testing I cannot get any values from my user controls. In fact, the page load event on my user controls will not even fire. I assume that this has something to do with IIS, but I have no idea what. I am developing on Windows...
4
1567
by: John | last post by:
Hi all, I have posted this type of question quite a few times but to date, no-one has actually been able to provide me with a solution. I really need to understand how to do this properly. My situation: I have n user controls which, based on user input, interchange with a placeholder on a web form.
7
1935
by: John | last post by:
Hi all, I need finality on this once and for all please. I have a main page which contains a couple of placeholders and within these placeholders, depending on what the user presses, I load different user controls. This loading of user controls is done within the code-behind of the main page. The problem is that before loading a user control in place of another, I need to do a Controls.Add then a Controls.Remove so the viewstate is...
9
3340
by: John Walker | last post by:
Hi, I have a datagrid with a radiobutton template column, with AutoPostBack set to TRUE. When the user clicks on a radiobutton the application will PostBack, and in the PostBack there will be certain logic performed, and the dataview will be re-binded to the datagrid. There turns out to be about 2-5 seconds delay between the time the user clicks the radiobutton and when the page is completely re-loaded. During this time the user may try...
8
1701
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user populations with different access rights and "roles" will be visiting the site. I will be using ASP.NET 2.0's membership, roles, and profiles stuff to manage access. User controls need to be visible or not visible depending on user role. In some...
1
1216
by: NKaufman | last post by:
In my pageload I am adding multiple instances of same User control. They all have properties ID and ParentID. Now I also have a button in each User control and am bubbling the event back to main form. No problem so far. Now in the event handler method, I get the ID of the user control that raised the event (through the ID property of sender). I now need to go through all the user controls on my page to see which one has parentID...
0
9456
marktang
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...
0
9275
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
9873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9846
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
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7248
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
6534
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
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3806
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.