Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Security / March 2008

Tip: Looking for answers? Try searching our database.

can't see role in production version

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith G Hicks - 27 Mar 2008 16:39 GMT
asp.net 2.0 (ms sql 2005)

Worked in development but not on production site. I'm testing roles in a
couple of pages:

if My.User.IsInRole("adminstrators") then
   'do stuff or not
endif

Like I said, this all works fine in development.

When I run it on the remote server I can log in and it finds the user and
the login process seems fine but it cannot see the role for some reason.

I put this in the Page_Load event of my default page:

Response.Write("name: " & My.User.Name)
Response.Write("; role: " & String.Join(",",
Roles.GetRolesForUser(My.User.Name)))

the Role comes up blank (in production version)

Can anyone tell me what might be wrong?

Thanks,

Keith
Keith G Hicks - 28 Mar 2008 01:16 GMT
I ought to mention that I'm using a slightly custom membership provider
using the standard asp.net 2.0 membership tables/views/procedures but
they're in my sql 2005 db via the aspnet_regsql.exe utility. It's only
custom in that it's not using the default mdf file in the App_Data folder
but rather as I said the same tables but in the main database for my app.
Not sure if that makes any difference or not.

> asp.net 2.0 (ms sql 2005)
>
[quoted text clipped - 23 lines]
>
> Keith
Keith G Hicks - 28 Mar 2008 05:14 GMT
Never mind. I took my 2 Siberian Huskies for a nice long 10 mile hike in the
unexpected snow tonight. While I was out it occurred to me that I should set
the applicationName not only in the membership provider code in web.config
but also in the role provider code. So I just tried that and it solved the
problem. All's well so far. I'm sure other issues will pop up and look
forward to many more posts. :-)

Keith

> I ought to mention that I'm using a slightly custom membership provider
> using the standard asp.net 2.0 membership tables/views/procedures but
[quoted text clipped - 30 lines]
> >
> > Keith

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.