DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

error BC30456: 'GetCurrentUserInfo' is not a member of 'UserController'.

 6 Replies
 0 Subscribed to this topic
 19 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 20
New Around Here
New Poster
New Poster
Congrats on posting!

Just Updated from 9 to 10.0.1 to .
10.01.01 
One of my theme files (AddFiles.ascx) is throwing this error.

Google foo told me to change this 

Old line:

if("<%=UserController.GetCurrentUserInfo().IsInRole("Administrators") %>"=="True")

Changed to: 

if("<%=DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators") %>"=="True")

Still showing error.
Any ideas? Thanks

Advanced Member
Posts: 207
Advanced Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
I use UserController.Instance.GetCurrentUserInfo().IsInRole(role); method on server side code, and it's OK in DNN10. It's been a very, very long time since I did any ascx files, but it looks correct to me.

Have you got the IsInRole called multiple times?

What file is this? is it a DNN file or a module file?
Advanced Member
Posts: 207
Advanced Member
Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
Ok, sorry, I see it's a theme file. This kind of error usually happens when classes are not defined property, It it opensource, can you send a link to it?
Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!

is that if a Javascript if?

Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!

I just tested <%=DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators") %> in a them in the latest DNN 10 and it works as expected

New Around Here
Posts: 20
New Around Here
New Poster
New Poster
Congrats on posting!

Thanks. While editing I made a copy of the broken line and I thought it was commented out- the site was still parsing it and throwing the error. When I removed the 'comment' it worked. 

Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!

Right, I ran into that issue too :-)

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved