Usercontrol Options
mbech
Posted: Monday, November 05, 2007 10:54:52 AM
Rank: Enthusiast

Joined: 12/8/2006
Posts: 11
Well im trying to create my first usersontrol. I've found this document

http://en.wikibooks.org/wiki/Umbraco/Samples_and_Articles/Dot_Net_Controls/Using_Dot_NET_Contro
ls_With_Umbraco

but i cannot get it to work. I'm trying to create the usercontrol with MS Visuel web develover 2008 express. Is there anyone who has an easy example hot to create a usercontol ? or can someone point me to some docs ??

Best Regards

Morten
warren
Posted: Monday, November 05, 2007 11:56:34 AM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
Hello Morten,
It depends what you are trying to achieve with the usercontrol.

I recommend that you download my website package,
http://packages.umbraco.org/packages/website-packages/creative-web-site-package?callback=

This will download a zip file. Unzip it and look at the VB.NET usercontrols I have created and this will give you some idea of what I have created.

If you install my website package you will also see how I use the usercontrol by setting up a macro that calls the .ascx (usercontrol)

Warren

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
mbech
Posted: Monday, November 05, 2007 12:13:24 PM
Rank: Enthusiast

Joined: 12/8/2006
Posts: 11
Thanks. Just wanted to make a simple usercontrol to see how it all works. IN the future it should be used to get some external data from Oracle.

I will install your package right away.

Morten
mbech
Posted: Monday, November 05, 2007 5:39:17 PM
Rank: Enthusiast

Joined: 12/8/2006
Posts: 11
Thanks Warren

That was what i needed. One thing though when clicking browse properties on one of your macros Umbraco dosn't show me any properties. That is the same problem i have when writing usercontrols myself.

Best Regards

Morten
warren
Posted: Monday, November 05, 2007 6:05:39 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
Hiya Morten, you will have to ask someone else in regards to that as I have never managed to do it myself. However these controls work fine without it.

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
jesper
Posted: Monday, November 05, 2007 8:52:16 PM

Rank: Administration

Joined: 7/25/2006
Posts: 415
Location: vipperoed, denmark
Morten wrote:

Thanks Warren

That was what i needed. One thing though when clicking browse properties on one of your macros Umbraco dosn't show me any properties. That is the same problem i have when writing usercontrols myself.

Best Regards

Morten


You have to use public get/setters. Try this:

public string MyText
{
set { _myText = value; }
}

where _myText is a private class variable.

Kindly,

Jesper

webbureau jesper.com doing webdesign / development / umbraco implementations / 2007&2008 MVP
vonlinaa
Posted: Tuesday, November 06, 2007 8:44:40 AM
Rank: Aficionado

Joined: 7/23/2006
Posts: 172
In visual studio just write

prop and tab twice and you will get it right

Søren Linaa
Level 1 & 2 Certified Professional
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.