473,769 Members | 4,846 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
13 1590
Ok, I have a work around, (at least until VS2006). I can create the
variable and in the page load do a FindControl to populate it. To place the
control I can create a panel and use this panel to host the control.

Not exactly what you would expect from a "RAD" product.

Thanks to all for their ideas. An composite of all those ideas was the
parent of the solution.
Lloyd Sheen
Nov 18 '05 #11
Actually it does. The var must have exactly the same name as that in the
..ASPX/.ASCX html page and should be declared at least as protected or
higher. This works perfectly in C#, but I can't say for VB.

As for your gripes about the product, maybe you should seek some training so
as to reduce the learning curve a little. If you are a MSDN subscriber, be
sure to get the "Whidbey" CD released at October's PDC. The ASP.NET team is
making huge strides in the design-time experience, and I believe in the
user-control arena that you'll probably want to check out.

Jeffrey
"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message
news:l0******** **********@news 01.bloor.is.net .cable.rogers.c om...
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 #12
Jeffrey,
I have been using the MS visual tools since VB1. The biggest problem
with the new VS is that the docs are not up to the task. I have been
compiling of a list of problems with the release and the wait until the next
release is getting a little old.

There are way too many things in the IDE that just don't do the job. I
first set out to learn the .NET framework which has good docs and I was
pleased by the classes which took care of many of the needs that I have been
used to coding myself.

What level of MSDN is required to get the Whidbey "beta". I have
Enterprise and see nothing in any of the categories about it.

Lloyd
"Jeffrey Huntsman" <jhuntsman@__no spam__teletrack ing.com> wrote in message
news:uw******** ******@TK2MSFTN GP12.phx.gbl...
Actually it does. The var must have exactly the same name as that in the
.ASPX/.ASCX html page and should be declared at least as protected or
higher. This works perfectly in C#, but I can't say for VB.

As for your gripes about the product, maybe you should seek some training so as to reduce the learning curve a little. If you are a MSDN subscriber, be
sure to get the "Whidbey" CD released at October's PDC. The ASP.NET team is making huge strides in the design-time experience, and I believe in the
user-control arena that you'll probably want to check out.

Jeffrey
"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message news:l0******** **********@news 01.bloor.is.net .cable.rogers.c om...
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 #13
PS. Thanks for the help. Setting the variable to the correct name fixed
the problem. Now if only that were documented. If it were not for the help
of the people on this newgroup I would have no hair left from all the
scratching.

Lloyd
"Jeffrey Huntsman" <jhuntsman@__no spam__teletrack ing.com> wrote in message
news:uw******** ******@TK2MSFTN GP12.phx.gbl...
Actually it does. The var must have exactly the same name as that in the
.ASPX/.ASCX html page and should be declared at least as protected or
higher. This works perfectly in C#, but I can't say for VB.

As for your gripes about the product, maybe you should seek some training so as to reduce the learning curve a little. If you are a MSDN subscriber, be
sure to get the "Whidbey" CD released at October's PDC. The ASP.NET team is making huge strides in the design-time experience, and I believe in the
user-control arena that you'll probably want to check out.

Jeffrey
"Lloyd Sheen" <sq************ *******@tostops pamhotmail.com> wrote in message news:l0******** **********@news 01.bloor.is.net .cable.rogers.c om...
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 #14

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

Similar topics

23
3284
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
878
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
1571
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
1936
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
1702
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
1217
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
9589
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
10212
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
9995
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
9863
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...
0
8872
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
7410
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
6674
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();...
1
3962
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
2815
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.