I created a new ASPX page, and put it into the Admin folder of the project (because I know that Admin is a reserved word in DNN and you can access that folder from the Url). I put this code in the page:
Partial
Class admin_MyPage
Inherits DotNetNuke.Framework.PageBase
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objUserInfo As UserInfo = UserController.GetCurrentUserInfo
Response.Write(
"username: " & objUserInfo.Username & "<br>")
Response.Write("portalId: " & PortalSettings.PortalId)
End Sub
End
Class
-I save the code creating the page as described above
-I go into a child portal (or any portal really) such as localhost/Test I put an IFrame module on the home page.
-I then put his path in the IFrame Modlue:
http://localhost/admin/MyPage.aspx (note that the regex filter prevents this entry so you have to yank that from the IFrame control code OR put this value into the DB directly
now, when I load my portal home page, the Iframe comes up, and shows my nifty page inside, which is SUPPOSED to show me username and portal ID. However... it just doesnt work right. No matter what I do, I get username blank, and portalID 0, whether logged in, or on portal 0 or not. and worse, it logs me out if I hit the home page containing this IFrame! Any time MyPage.aspx is loaded, it wipes out all portal and user knowledge. Whats the deal????
I am not thinking this is an IFrame problem, but some kind of core functionality I have not used properly, or cant use. And in fact, the same issues ocurrs when not using IFrames at all. What is the deal with creating custom pages, inheriting the base class, and getting the proper values?
Bottom line: I am trying to create a DNN project that has some custom ASPX pages without the skins and features, BUT that have the portal and user objects in them. Ideally, these pages would be used in Iframes (not necessarily the IFrame module) so that I can use it in Dialog type windows I am building for my DNN pages (and the dialog window needs at least to know what portal and user, etc it is being viewed under).
Passing portalId, and all kinds of info to this page via querystring is not a good option (security and etc, not to mention, I really do want access to the full suite of Portal and UserInfo objects).
any guru's understand the issue here?