Custom controls

  • Thread starter Thread starter Lloyd Sheen
  • Start date Start date
L

Lloyd Sheen

I have a piece of functionallity that is replicated on several pages. This
would be a good candidate for a custom control right?

Well I found a couple of tutorials (none really helpful) so I created a
simple asp app and added a custom control to the project.

Now to the problem. I created the control using a GridFlow control so that
the position of the controls within the custom control can be formatted
correctly. I then added the control to the asp page. The problem is that I
cannot figure out how to control where the output is shown. On the design
page the custom control shows at the left/top corner. By adding the style
attributes style="LEFT: 41px; POSITION: absolute; TOP: 32px" I can make the
controls show correctly on the design page but running the page destroys the
position.

Please help or direct me to an info source that leads me through the process
of creating the controls.
 
PS, when I add these controls there does not seem to be any way to see these
controls in code. I cannot make them "Run as Server", and they do not show
in the VB code.

Placing the cursor on any other control will cause the properties window to
show the control selected. This is not the case for the simple custom
control I created. It was created in the project and the ascx file in the
Project Explorer then dragged to a position.
 
PS again.

In just trying anything to get this to work I notice the following:

- I can add attributes manually in design to get the control to show in the
correct place in the design page.
- As soon as I do this the designer looses its mind. The dropdown list of
controls will only show one control. I have added labels and other things
to see what is generated but only one of these controls will show in the
dropdown list.

This makes no sense other than the parsing of the page that takes place
between the design and HTML views fails with no indication to the developer.
 
Another thing that is wrong is that the control is not added to the code of
the hosting page (code behind). I have a feeling that what I am doing is
very wrong. I have followed a tutorial and while the control will show in
the page, I cannot make it so that it will show in the correct place and
cannot be referenced by anything else on the page.
 
Back
Top