Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Razor Helpers for user infoRazor Helpers for user info
Previous
 
Next
New Post
2/16/2011 6:05 PM
 
Hi

I've been playing with the Razor module and am trying to get the current user ID and email etc.  There are helpers in the examples for tabs and modules
and portal info.  e.g.   @Dnn.Tab.TabName    gives the current tab name.

But I need user info. Anyone know if there is a helper for this?

thanks
Gus

"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
New Post
2/18/2011 3:45 PM
 
the same helper contains it , you use @dnn.user - see http://www.dotcomsoftwaresolutions.com/en/News/articleType/ArticleView/articleId/47/Razor-Tips-and-Tricks-4-ndash-Extending-the-Helpers.aspx

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/19/2011 6:54 AM
 
Many thanks Cathal

that did the trick once I remember C# is case sensitive!    So this works:   @Dnn.User.DisplayName but this @DNN.User.DisplayName does not.

I'm looking forward to some good documentation on this stuff.

While we're on the subject I don't suppose you know how to create a download dialogue?  I have a file on the server and I have a link to download it.
It's a text file and when I click the link the browser just displays it in a window.  I want to show a 'save as' box control if possible.  With a normal .aspx page or user control I could use a .NET control.  How would I do this in Razor?

Perhaps we can have a DNN Razor forum?

thanks
Gus

"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
New Post
2/19/2011 2:44 PM
 
I agree on the razor forum, I've already requested one - i'll follow up on that. As to forcing the save as dialog you need to set a content-disposition of attachment (e.g. http://aspalliance.com/259) or use response.writebinary(filename,contenttype) e.g.

@{
Response.AppendHeader( "content-disposition",
"attachment; filename=" + name );
Response.WriteFile(name);
Response.End()
}

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Razor Helpers for user infoRazor Helpers for user info


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

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

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. 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.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out