all groups > asp.net building controls > march 2005 >
You're in the

asp.net building controls

group:

Custom control won't drag and drop to page


Custom control won't drag and drop to page Andrea Williams
3/28/2005 6:01:13 PM
asp.net building controls:
i'm a bit of a noob to custom controls, so please bare with me...

I just downloaded source to a control from thecodeproject.com but I'm unable
to drag and drop the control from my toolbox to the design mode of my ascx
file. According to the docs, I should be able to do just that. Is there
something special that I have to do to get a custom control to drag and drop
into my page? Some sort of setting or something that I haven't included in
the VS.NET option?

Thanks,
Andrea

Re: Custom control won't drag and drop to page Steve C. Orr [MVP, MCSD]
3/28/2005 6:09:50 PM
Are you getting some kind of error message?

Here are some working examples of custom controls that can be successfully
dropped from the toolbar:
http://steveorr.net/articles/InheritAndExtend.aspx
http://steveorr.net/articles/StreamingMedia.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net



[quoted text, click to view]

Re: Custom control won't drag and drop to page Andrea Williams
3/28/2005 6:15:18 PM
No, no error... When I try to drag and drop, the cursor turns to the no
sign as if it's not a control that can be dropped.

It's the control from this article:
http://www.codeproject.com/useritems/OverlibWrapper.asp

Meanwhile I'll try the controls you suggest.

Andrea

[quoted text, click to view]

Re: Custom control won't drag and drop to page Andrea Williams
3/28/2005 6:19:55 PM
I tried the first link and it is not drag and dropping either. So maybe I'm
adding it to the toolbar incorrectly? Are there an instructions to add
them?

Andrea

[quoted text, click to view]

Re: Custom control won't drag and drop to page Andrea Williams
3/28/2005 6:21:31 PM
I just noticed that all the system control are in the GAC... Do I need to
add them to the GAC?

Andrea

[quoted text, click to view]

Re: Custom control won't drag and drop to page Brock Allen
3/28/2005 7:01:36 PM
I wonder if the control is actually being added to the page, but it shows
no design time rendering. Check the underlying HTML for the control. It should
look something like <cc:YourControlName runat=server ... />

-Brock
DevelopMentor
http://staff.develop.com/ballen



[quoted text, click to view]


Re: Custom control won't drag and drop to page Steve C. Orr [MVP, MCSD]
3/28/2005 10:40:03 PM
No, custom controls don't need to be in the GAC.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


[quoted text, click to view]

Re: Custom control won't drag and drop to page Andrea Williams
3/29/2005 10:30:29 AM
Nope, nothing is there. VS 2003 doesn't drop a thing. I can drag and drop
my User Web controls from my project into the page... And the control block
appears in that case.

So I'm adding the control to the toolbar by right-click the toolbar and
selecting "Add/ Remove Items..."
On the .Net Tab I browse, find the dll in the BIN/Debug folder and select it
and click OK. That puts the item on the toolbar. When the page is in
design mode, the control looks to be enabled. I click and drag it... When
the drag goes to the page (in design mode), the cursor changes from the bow
and pointer to a circle with a line through it (No sign). I drop it anyway
and nothing happens. No control in design mode and not text in HTML mode.

Andrea


[quoted text, click to view]

Re: Custom control won't drag and drop to page recoil NO[at]SPAM community.nospam
3/29/2005 12:31:35 PM
Most of the time when this happens it is because your UserControl is
throwing an exception of some sort. There are a few occassions where
this will just "happen" and creating a new web page or a new project
usually solves it. In cases where it does not it is most likely because
somewhere along the line the UserControl is throwing an exception. Most
obvious things to look for are code references that might fail at
runtiome because things like Server is null (thus a call to
Server.MapPath in OnInit or in the constructor or OnRender would fail)
Re: Custom control won't drag and drop to page Andrea Williams
3/29/2005 12:43:30 PM
ok, I created a new project and it is dropping into the new project. I
tried adding a new page to my old project and it still was not working. My
page layout is defualted to Flow instead of Grid, would that have anything
to do with this issue? The new defualted to grid.

So, assuming there's a problem with my project that makes the drop fail,
what could it be? Where should I start looking? Or is it a bug in VS.net?

Andrea
[quoted text, click to view]

Re: Custom control won't drag and drop to page recoil NO[at]SPAM community.nospam
3/30/2005 9:37:20 AM
One of those wonderful mysteries of life.
AddThis Social Bookmark Button