No html insertion in the *.aspx file

A

arTleVark

I've developed a custom control, and added it to my toolbox. Everything worked fine.
I took the control back home, added it to my toolbox, but when I try to drag it onto my *.aspx file there is no more html generated or inserted in the file. The control get's a declaration in the *.aspx.cs codebehind file though.

Any solutions to this problem?
 
S

S.Grevi

You already tried to see if in the *html* part (.aspx) of the page you have
a reference to the control ?

If yes, keep in mind that all the HTML is in your .ascx file and it's parsed
and rendered as HTML afterwards.
In facts you have only to worry if in the .aspx.cs files you don't have the
reference OR in the .aspx you don't have a line like this one on top of the
page :

<%@ Register TagPrefix="kc" TagName="customControl"
Src="../myCustomControl.ascx" %>

which is used for referencing your custom control, and :

<kc:customControl id="cmbCustom" runat="server"></kc:customControl>

which is used as 'placeholder' and replaced, as needed, with the HTML code
present in the .ascx file.

....or I did'nt understood the point.


Stefano Grevi

arTleVark said:
I've developed a custom control, and added it to my toolbox. Everything worked fine.
I took the control back home, added it to my toolbox, but when I try to
drag it onto my *.aspx file there is no more html generated or inserted in
the file. The control get's a declaration in the *.aspx.cs codebehind file
though.
 
A

arTleVark

The reference is there,

it's the <kc:customControl id="cmbCustom" runat="server"></kc:customControl> part that's not inserted.

I already have figured one part,
most of my controls inherit from my base control, which is derived from WebControl. It seems all controls that are not derictly derived from WebControl produce this problem.
 
S

S.Grevi

That's tricky.

This case didn't happened to me in the past because I didn't tried to build
a custom webcontrols chain of inheritance and use it ... till now.
Doing the work 'by hand' and putting on the .aspx the reference solve the
problem arTleVark ?
If it's so it could be only a IDE problem, even if I hardly figure out that
the test of this case was missed by Microsoft.

I try to look for the solution, if I found it I'll put in this thread.(The
matter is really tricky...).

Stefano



arTleVark said:
The reference is there,

it's the <kc:customControl id="cmbCustom"
runat="server"> said:
I already have figured one part,
most of my controls inherit from my base control, which is derived from
WebControl. It seems all controls that are not derictly derived from
WebControl produce this problem.
 
A

arTleVark

I can add the controls "by hand" (ie, coding the html tags in the aspx etc), and then the controls show up in design view,
just when I drag them from the toolbox the html code is not inserted.

What I find the weirdest is that on day1 everything worked fine...
 
S

S.Grevi

....it's sad to say that our favourite sentence to freeze an angry boss is
'yesterday it worked, what happened ?' ;-)

But it's not only the technology which is trying to put obstacles on the
road of success, it's sometimes the code-sharing !

Anyway, I found this article on Custom Webcontrols that put a little light
on our work (eve the mine). Look at the Figure 1 at the beginning of the
class declaration of the custom control. I think that, like in mine, is
missing this attribute (...Aspect Oriented Programming...).

Could this help ?

Stefano

arTleVark said:
I can add the controls "by hand" (ie, coding the html tags in the aspx
etc), and then the controls show up in design view,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top