HighTechTalks DotNet Forums  

ASP.NET Membership

Dotnet General Discussions microsoft.public.dotnet.general


Discuss ASP.NET Membership in the Dotnet General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Tem
 
Posts: n/a

Default ASP.NET Membership - 12-27-2007 , 03:39 PM






Im making a photo gallery application where users can only see their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership provider
Can someone points me to the right direction

Thanks

Tem


Reply With Quote
  #2  
Old   
Scott M.
 
Posts: n/a

Default Re: ASP.NET Membership - 12-27-2007 , 04:57 PM






You'll need to create your own custom provider if you wish to manage, not
only the users & roles but also the photo data.

http://www.devx.com/asp/Article/29256




"Tem" <tem1232 (AT) yahoo (DOT) com> wrote

Quote:
Im making a photo gallery application where users can only see their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership provider
Can someone points me to the right direction

Thanks

Tem



Reply With Quote
  #3  
Old   
Phil H
 
Posts: n/a

Default Re: ASP.NET Membership - 12-27-2007 , 05:36 PM



On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Quote:
Im making a photo gallery application where users can only see their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership provider
Can someone points me to the right direction

Thanks

Tem
I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.


Reply With Quote
  #4  
Old   
Tem
 
Posts: n/a

Default Re: ASP.NET Membership - 12-27-2007 , 09:40 PM



Thanks

If I understand this correctly PhotoUser would store the username of the
user the photo belongs to. Wouldn't this be slow performance wise?
(searching a string)
would it be faster to use UserID uniqueidentifier instead?

"Phil H" <google (AT) philphall (DOT) me.uk> wrote

Quote:
On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Im making a photo gallery application where users can only see their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership
provider
Can someone points me to the right direction

Thanks

Tem

I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.


Reply With Quote
  #5  
Old   
Mohamad Elarabi [MCPD]
 
Posts: n/a

Default Re: ASP.NET Membership - 12-28-2007 , 06:34 AM



Not if you indexed the PhotoUser column.

--
Mohamad Elarabi
MCP, MCTS, MCPD.


"Tem" wrote:

Quote:
Thanks

If I understand this correctly PhotoUser would store the username of the
user the photo belongs to. Wouldn't this be slow performance wise?
(searching a string)
would it be faster to use UserID uniqueidentifier instead?

"Phil H" <google (AT) philphall (DOT) me.uk> wrote in message
news:aa5c6776-b9e8-4e9e-a8e7-7145a496501e (AT) e6g2000prf (DOT) googlegroups.com...
On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Im making a photo gallery application where users can only see their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership
provider
Can someone points me to the right direction

Thanks

Tem

I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.



Reply With Quote
  #6  
Old   
Tem
 
Posts: n/a

Default Re: ASP.NET Membership - 12-28-2007 , 01:03 PM



how would I do that?

"Mohamad Elarabi [MCPD]" <MohamadElarabiMCPD (AT) discussions (DOT) microsoft.com>
wrote in message news:5879D58F-89BB-4CA5-87E3-72723E871DB7 (AT) microsoft (DOT) com...
Quote:
Not if you indexed the PhotoUser column.

--
Mohamad Elarabi
MCP, MCTS, MCPD.


"Tem" wrote:

Thanks

If I understand this correctly PhotoUser would store the username of the
user the photo belongs to. Wouldn't this be slow performance wise?
(searching a string)
would it be faster to use UserID uniqueidentifier instead?

"Phil H" <google (AT) philphall (DOT) me.uk> wrote in message
news:aa5c6776-b9e8-4e9e-a8e7-7145a496501e (AT) e6g2000prf (DOT) googlegroups.com...
On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Im making a photo gallery application where users can only see their
own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership
provider
Can someone points me to the right direction

Thanks

Tem

I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.



Reply With Quote
  #7  
Old   
Tem
 
Posts: n/a

Default Re: ASP.NET Membership - 12-28-2007 , 03:26 PM



Believe me I tried. I have read those documentations and watched all the
video tutorials. They covered how to create login page, set up user profile,
web.config....none of them addressed what I'm trying to do.
that is why I posted my question here. maybe im not reading them correctly,
if you can point me to the right direction that would be really helpful.

Tem

"clintonG" <nobody (AT) nowhere (DOT) com> wrote

Quote:
Jeeeeeeeesus are you getting a bunch of nonsense for advice or what?
Mohamad was the only guy who tried to set you straight. First of all clean
up your redundant use of the PhotoUser column in your table as it is not
needed and poor design. Delete it.

Secondly, you do not neet to write your own "provider" that was nonsense.
The Membership, Roles and Profiles released in 2.00 are very
powerful --but-- you need to learn how to use them. Start by reading
maybe?

//search.live.com
membership overview site:msdn2.microsoft.com

Membership and Roles are so powerful in fact that we can filter content
out of a page right down to a single image, a sentence or even a single
word if we do not want anoybody to see that specific content. Just learn
Membership and Roles. We can get the identity of anybody logged in from
any page at any time. All you need to do is learn how and using search is
the way to get started.

--
%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/


"Tem" <tem1232 (AT) yahoo (DOT) com> wrote in message
news:%23IF$nvXSIHA.4888 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
how would I do that?

"Mohamad Elarabi [MCPD]" <MohamadElarabiMCPD (AT) discussions (DOT) microsoft.com
wrote in message
news:5879D58F-89BB-4CA5-87E3-72723E871DB7 (AT) microsoft (DOT) com...
Not if you indexed the PhotoUser column.

--
Mohamad Elarabi
MCP, MCTS, MCPD.


"Tem" wrote:

Thanks

If I understand this correctly PhotoUser would store the username of
the
user the photo belongs to. Wouldn't this be slow performance wise?
(searching a string)
would it be faster to use UserID uniqueidentifier instead?

"Phil H" <google (AT) philphall (DOT) me.uk> wrote in message
news:aa5c6776-b9e8-4e9e-a8e7-7145a496501e (AT) e6g2000prf (DOT) googlegroups.com...
On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Im making a photo gallery application where users can only see their
own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership
provider
Can someone points me to the right direction

Thanks

Tem

I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.





Reply With Quote
  #8  
Old   
sloan
 
Posts: n/a

Default Re: ASP.NET Membership - 12-28-2007 , 05:00 PM




I think you may be confusing what the Membership and Role provider can do.

Lets take a generic example.

I work at a hospital.

There are a few roles.

VP
HR
Worker


Let's say there is a business rule which says...
VP can delete employees under them.
HR can delete any employee.
Worker can't delete anybody.

So maybe here is a webpage called

employeedelete.aspx

look at the vp rule. even though the vp can delete employees...he/she can
only delete CERTAIN employees, not all employees.
thus when the vp visits the page "employeedelete.aspx"...only a handful of
emp's should show up.

the filtering is NOT handled by the membership or role provider. you have
to do that.

being able to see employeedelete.aspx in the sitemap, being able to visit
employeedelete.aspx page, that is (kinda) handled via the 2 providers.

so your "can see my images" rule is like the VP deleting employees. the
user can see images, but only his/her images. not everyones.

so the user (in role of "normaluser" for example) can get to a page called
imagesShowForUser.aspx
but YOU need to write the filtering code for which images show up here on
this page.

Membership is going to allow you to create users ... and all that jazz
(passwords, password reset, etc)...
Roles will allow you to put userX into a role (like "normalUser").

But you still need to code up the filtering for a user getting only his/her
images.






"Tem" <tem1232 (AT) yahoo (DOT) com> wrote

Quote:
Believe me I tried. I have read those documentations and watched all the
video tutorials. They covered how to create login page, set up user
profile, web.config....none of them addressed what I'm trying to do.
that is why I posted my question here. maybe im not reading them
correctly, if you can point me to the right direction that would be really
helpful.

Tem

"clintonG" <nobody (AT) nowhere (DOT) com> wrote in message
news:OwL809XSIHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Jeeeeeeeesus are you getting a bunch of nonsense for advice or what?
Mohamad was the only guy who tried to set you straight. First of all
clean up your redundant use of the PhotoUser column in your table as it
is not needed and poor design. Delete it.

Secondly, you do not neet to write your own "provider" that was nonsense.
The Membership, Roles and Profiles released in 2.00 are very
powerful --but-- you need to learn how to use them. Start by reading
maybe?

//search.live.com
membership overview site:msdn2.microsoft.com

Membership and Roles are so powerful in fact that we can filter content
out of a page right down to a single image, a sentence or even a single
word if we do not want anoybody to see that specific content. Just learn
Membership and Roles. We can get the identity of anybody logged in from
any page at any time. All you need to do is learn how and using search is
the way to get started.

--
%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/


"Tem" <tem1232 (AT) yahoo (DOT) com> wrote in message
news:%23IF$nvXSIHA.4888 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
how would I do that?

"Mohamad Elarabi [MCPD]" <MohamadElarabiMCPD (AT) discussions (DOT) microsoft.com
wrote in message
news:5879D58F-89BB-4CA5-87E3-72723E871DB7 (AT) microsoft (DOT) com...
Not if you indexed the PhotoUser column.

--
Mohamad Elarabi
MCP, MCTS, MCPD.


"Tem" wrote:

Thanks

If I understand this correctly PhotoUser would store the username of
the
user the photo belongs to. Wouldn't this be slow performance wise?
(searching a string)
would it be faster to use UserID uniqueidentifier instead?

"Phil H" <google (AT) philphall (DOT) me.uk> wrote in message
news:aa5c6776-b9e8-4e9e-a8e7-7145a496501e (AT) e6g2000prf (DOT) googlegroups.com...
On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Im making a photo gallery application where users can only see
their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership
provider
Can someone points me to the right direction

Thanks

Tem

I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.







Reply With Quote
  #9  
Old   
Tem
 
Posts: n/a

Default Re: ASP.NET Membership - 12-29-2007 , 03:44 PM



This is what I don't understand
How would it know, who the photo belongs to if there wasn't an identifier
field (PhotoUser) in the Photo table?



"sloan" <sloan (AT) ipass (DOT) net> wrote

Quote:
I think you may be confusing what the Membership and Role provider can do.

Lets take a generic example.

I work at a hospital.

There are a few roles.

VP
HR
Worker


Let's say there is a business rule which says...
VP can delete employees under them.
HR can delete any employee.
Worker can't delete anybody.

So maybe here is a webpage called

employeedelete.aspx

look at the vp rule. even though the vp can delete employees...he/she can
only delete CERTAIN employees, not all employees.
thus when the vp visits the page "employeedelete.aspx"...only a handful of
emp's should show up.

the filtering is NOT handled by the membership or role provider. you have
to do that.

being able to see employeedelete.aspx in the sitemap, being able to visit
employeedelete.aspx page, that is (kinda) handled via the 2 providers.

so your "can see my images" rule is like the VP deleting employees. the
user can see images, but only his/her images. not everyones.

so the user (in role of "normaluser" for example) can get to a page called
imagesShowForUser.aspx
but YOU need to write the filtering code for which images show up here on
this page.

Membership is going to allow you to create users ... and all that jazz
(passwords, password reset, etc)...
Roles will allow you to put userX into a role (like "normalUser").

But you still need to code up the filtering for a user getting only
his/her images.






"Tem" <tem1232 (AT) yahoo (DOT) com> wrote in message
news:uC80m$YSIHA.5400 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Believe me I tried. I have read those documentations and watched all the
video tutorials. They covered how to create login page, set up user
profile, web.config....none of them addressed what I'm trying to do.
that is why I posted my question here. maybe im not reading them
correctly, if you can point me to the right direction that would be
really helpful.

Tem

"clintonG" <nobody (AT) nowhere (DOT) com> wrote in message
news:OwL809XSIHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Jeeeeeeeesus are you getting a bunch of nonsense for advice or what?
Mohamad was the only guy who tried to set you straight. First of all
clean up your redundant use of the PhotoUser column in your table as it
is not needed and poor design. Delete it.

Secondly, you do not neet to write your own "provider" that was
nonsense. The Membership, Roles and Profiles released in 2.00 are very
powerful --but-- you need to learn how to use them. Start by reading
maybe?

//search.live.com
membership overview site:msdn2.microsoft.com

Membership and Roles are so powerful in fact that we can filter content
out of a page right down to a single image, a sentence or even a single
word if we do not want anoybody to see that specific content. Just learn
Membership and Roles. We can get the identity of anybody logged in from
any page at any time. All you need to do is learn how and using search
is the way to get started.

--
%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/


"Tem" <tem1232 (AT) yahoo (DOT) com> wrote in message
news:%23IF$nvXSIHA.4888 (AT) TK2MSFTNGP02 (DOT) phx.gbl...
how would I do that?

"Mohamad Elarabi [MCPD]" <MohamadElarabiMCPD (AT) discussions (DOT) microsoft.com
wrote in message
news:5879D58F-89BB-4CA5-87E3-72723E871DB7 (AT) microsoft (DOT) com...
Not if you indexed the PhotoUser column.

--
Mohamad Elarabi
MCP, MCTS, MCPD.


"Tem" wrote:

Thanks

If I understand this correctly PhotoUser would store the username of
the
user the photo belongs to. Wouldn't this be slow performance wise?
(searching a string)
would it be faster to use UserID uniqueidentifier instead?

"Phil H" <google (AT) philphall (DOT) me.uk> wrote in message
news:aa5c6776-b9e8-4e9e-a8e7-7145a496501e (AT) e6g2000prf (DOT) googlegroups.com...
On 27 Dec, 20:39, "Tem" <tem1... (AT) yahoo (DOT) com> wrote:
Im making a photo gallery application where users can only see
their own
photos.
My photos table looks like this
Id, PhotoName, PhotoURL, PhotoUser

I need to know how I can integrate this with ASP.NET's membership
provider
Can someone points me to the right direction

Thanks

Tem

I'm not sure what you mean by "integrate" but the requirement you
describe could be met by filtering the data table on Membership
username (if that differs from PhotoUser then add an extra column)
which is easily read with the Membership.getuser() function.







Reply With Quote
  #10  
Old   
Phil H
 
Posts: n/a

Default Re: ASP.NET Membership - 12-29-2007 , 05:12 PM



On 28 Dec, 18:28, "clintonG" <nob... (AT) nowhere (DOT) com> wrote:
Quote:
Jeeeeeeeesus are you getting a bunch of nonsense for advice or what? Mohamad
was the only guy who tried to set you straight. First of all clean up your
redundant use of the PhotoUser column in your table as it is not needed and
poor design. Delete it.

Secondly, you do not neet to write your own "provider" that was nonsense.
The Membership, Roles and Profiles released in 2.00 are very
powerful --but-- you need to learn how to use them. Start by reading maybe?

//search.live.com
membership overview site:msdn2.microsoft.com

Membership and Roles are so powerful in fact that we can filter content out
of a page right down to a single image, a sentence or even a single word if
we do not want anoybody to see that specific content. Just learn Membership
and Roles. We can get the identity of anybody logged in from any page at any
time. All you need to do is learn how and using search is the way to get
started.
Speaking as one of those other than Mohamid who offered advice here I
would make the following observations:

(1) It is reasonable to suspect that the PhotoUser column is redundant
but without more information about background and context I was a
little cautious in suggesting it should be deleted.

(2) Yes it is true that loginViews can filter out various elements
according to identity and privelege but that is not the kind of
filtering that was being requested in this case. All that was asked
for is that the user only see records from a datasource that are
relevent to them personally. Ordinary row filtering is straight-
forward enough and probably simpler than constructing a LoginView type
control to meet that particular need (what are you going to do, create
an individual template for every user?).

I don't see any performance issues. If your application is data-driven
then the suggested solutions will not make it any worse.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.