How to expose current user info to .net user control?
hello!
i'm trying to understand the 'big picture' in order to develop my own vb.net modules. so far umbraco looks great!
i've watched the videos and googled a bit but i still am not 100% clear on best practices for data access in my user control. Given: i'd like to use the 1 database that installs with umbraco. i think i can add any additional values related to myUserControl to the existing object model.
should i be adding certain umbraco dlls into my user control web application to gain data access? which ones? are there any examples of how to access this type of data?
for example, what if i wanted to make a boring user control that displayed the current logged in user's username?
If I remember correctly you need to at least add a reference to the umbraco.dll and the businesslogic.dll since the full member api is in umbraco.cms.businesslogic.member according to my level 2 course notes :-)
awesome thank you. i'm going to settle down tonight and poke around, but now that i've been reading more, i think i may be able to do what i want with a custom data type. this excellent article decribes the process: http://www.nibble.be/?p=97
i'm thinking a custom data type is one where i can use existing controls/custom logic and write the data to some generic place in the database referenced by guid. is this a correct understanding of what a custom data type is?
i'm sure i will have more questions later (like how to get that data back out... hahahaha).
-cheers!
*EDIT - ...and i see i'm already using the wrong terminology... "User" is internal privelaged backend users, "Member" is for everyone else. *
Regarding your big picture question of data access and user controls. You can take a traditional .NET approach and use code behind, ADO.NET etc and just add a custom database table in the main umbraco DB to hold your data. If you take this approach you can use whatever data layer you are comfortable with: ADO.NET, LINQ to SQL, Custom classes, etc. Also you will need an admin page in which to view this custom data, and it is pretty easy to add a page to the umbraco backend.
Or you could create document types in umbraco that have properties that are roughly equivalent to fields in a database. Then you could create new instances of that doctype using the API and the data would show up in your content tree.
thanks brad. i just spent the evening installing it and playing around. ran into a bit of a snag... it didn't like being installed in virtual directory... had to create a website through iis. after watching a few videos on vimeo i feel like i have a better understanding of it than dotnetnuke. excellent!
How to expose current user info to .net user control?
hello!
i'm trying to understand the 'big picture' in order to develop my own vb.net modules. so far umbraco looks great!
i've watched the videos and googled a bit but i still am not 100% clear on best practices for data access in my user control. Given: i'd like to use the 1 database that installs with umbraco. i think i can add any additional values related to myUserControl to the existing object model.
should i be adding certain umbraco dlls into my user control web application to gain data access? which ones? are there any examples of how to access this type of data?
for example, what if i wanted to make a boring user control that displayed the current logged in user's username?
many thanks to anyone with a good answer!
Hi Tony
If I remember correctly you need to at least add a reference to the umbraco.dll and the businesslogic.dll since the full member api is in umbraco.cms.businesslogic.member according to my level 2 course notes :-)
Hope this helps.
/Jan
awesome thank you. i'm going to settle down tonight and poke around, but now that i've been reading more, i think i may be able to do what i want with a custom data type. this excellent article decribes the process: http://www.nibble.be/?p=97
i'm thinking a custom data type is one where i can use existing controls/custom logic and write the data to some generic place in the database referenced by guid. is this a correct understanding of what a custom data type is?
i'm sure i will have more questions later (like how to get that data back out... hahahaha).
-cheers!
*EDIT - ...and i see i'm already using the wrong terminology... "User" is internal privelaged backend users, "Member" is for everyone else. *
Tony-
Regarding your big picture question of data access and user controls. You can take a traditional .NET approach and use code behind, ADO.NET etc and just add a custom database table in the main umbraco DB to hold your data. If you take this approach you can use whatever data layer you are comfortable with: ADO.NET, LINQ to SQL, Custom classes, etc. Also you will need an admin page in which to view this custom data, and it is pretty easy to add a page to the umbraco backend.
Or you could create document types in umbraco that have properties that are roughly equivalent to fields in a database. Then you could create new instances of that doctype using the API and the data would show up in your content tree.
Hope that helps a little.
Brad
thanks brad. i just spent the evening installing it and playing around. ran into a bit of a snag... it didn't like being installed in virtual directory... had to create a website through iis. after watching a few videos on vimeo i feel like i have a better understanding of it than dotnetnuke. excellent!
is working on a reply...