Hi,
I'm trying to access DNN Role information from inside a Webmatrix web application installed as part of a DNN site. For background, we're at a university and we run this Webmatrix application to connect a bunch of databases. We want to put it inside DNN to take advantage of all the module tools and to run authentication from the institution's ActiveDirectory server. DNN does all this and we've already tested it--so far so good.
The Webmatrix app was built using the Starter Site template to control authentication and roles. What we'd like to do is strip out all the authentication/role/WebSecurity helpers from the Webmatrix app and have it draw on the roles for the authenticated users from DNN. But we'd like to do this without rebuilding the whole site as a module in DNN (beyond our abilities and timeline).
We set the Webmatrix site up in an embedded inline frame on a DNN page and that works fine. We can do this with the embed src= pointing to the URL for Webmatrix site (it's on the same IIS server) or to a virtual directory inside DNN that points over to the Webmatrix site--it doesn't seem to matter.
I also identified a number of variables from the DotNetNuke.Web.Razor.Helpers class that we need to access inside our Webmatrix site:
- @Dnn.User.UserID
- @Dnn.User.UserName
- @Dnn.User.IsInRole()
These all run correctly inside a Razor-script module in a DNN page, but not inside the Webmatrix app. What I can't figure out is how to access the DotNetNuke.Web.Razor.Helpers namespace from inside the Webmatrix application. This blog posting seemed to address the issue, but I haven't been able to make it work. Some thoughts I've had are:
- Does the Webmatrix app need to physically located inside the DNN folder?
- Do I add namespace declarations inside the Webmatrix web.config file?
- Or, do I move the Webmatrix app insider the DNN folder and move the contents of its web.config folder up to the DNN web.config file?
Any help is appreciated. Sorry for the long post.
Thanks, Bill