Page view counter

IFRAME Question

Last post 06-28-2006 7:49 AM by zulurl. 12 replies.

Sort Posts:

  • IFRAME Question

    09-08-2005, 8:41 AM
    • Loading...
    • veganode
    • Joined on 04-14-2004, 7:06 AM
    • Node
    • Posts 90
    • Points 450
    I want to configure the IFRAME Module to open an ASP page not ASP.NET and pass the UserID asp an URL PArameter

    Example the URL of the IFRAME is:

    http://server/Page1.asp?UserID=2
  • Re: IFRAME Question

    09-09-2005, 3:26 PM
    • Loading...
    • dnnstuff
    • Joined on 11-25-2004, 7:49 AM
    • Ontario, Canada
    • Posts 155
    • Points 785
    Hi there,

    You can try the following. I think it should work.

    Create a new page called UserRedirect.aspx in the root directory of your site and put the following inside it.

    <%@ Page Language="VB" %>
    <% Response.Redirect(Request.QueryString("page").ToString & "?UserId=" & DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.UserID) %>


    This page will take a querystring parameter for the site you wish to redirect to, and add a UserId parameter to it with the current userid as it's value. This means you can set your iframe url to something like:

    http://www.microsoft.com/UserRedirect.aspx?page=http://www.dnnstuff.com/

    and it should redirect to http://www.dnnstuff.com?UserId=5 assuming 5 is the user id of the currently logged in user.

    Hope this works for you.
    Richard Edwards
    Available DotNetNuke modules - SQLView, CSSInclude, Aggregator - Tabbed Modules, Module Rotator
    http://www.dnnstuff.com,
  • Re: IFRAME Question

    09-09-2005, 4:52 PM
    • Loading...
    • RLyda
    • Joined on 03-30-2004, 6:21 PM
    • Charleston, SC
    • Posts 1,053
    • Points 5,265
    Slick way to work it out without a core mod!  But I think I'd prefer a mod that allws multiple token to be substituted....and certainly not by maintaining a page for each...
  • Re: IFRAME Question

    09-09-2005, 6:26 PM
    • Loading...
    • dnnstuff
    • Joined on 11-25-2004, 7:49 AM
    • Ontario, Canada
    • Posts 155
    • Points 785
    Thanks. It wouldn't be too hard to extend this to do some pattern matching to determine which of the standard DNN variables to substitute into the url.

    Actually, thats something I'd like to see added to the core. The ability to do token replacement within any text entered into DNN. It would also be nice for module developers to extend this with their own token replacement library routines. I've done this with my own Aggregator module so you can enter text such as http://www.dnnstuff.com?UserId=[DNN:User.UserId] and it will make the token replacements for you in tab captions etc. It would be nice to have a standard 'language' to do this with so each module developer doesn't have to invent his own language for these types of tasks. Maybe I'll draft something out and propose it to the core team.



    Richard Edwards
    Available DotNetNuke modules - SQLView, CSSInclude, Aggregator - Tabbed Modules, Module Rotator
    http://www.dnnstuff.com,
  • Re: IFRAME Question

    09-11-2005, 4:24 AM
    • Loading...
    • veganode
    • Joined on 04-14-2004, 7:06 AM
    • Node
    • Posts 90
    • Points 450
    I modified the IFrame Module and packed it as a new module PA called "EIFrame" passing the UserID, PortalID, User Full Name and IsSuperUser as URL Parameters.

    I ask this question because I want to integrate DNN 3.1.1 with existing old ASP applications on my employer Intranet.
  • Re: IFRAME Question

    09-11-2005, 5:30 PM
    • Loading...
    • mrswoop
    • Joined on 04-11-2003, 3:51 PM
    • Seattle, WA
    • Posts 2,235
    • Points 11,175
    Hey Gang... just FYI...

    There is a DNN Project and associated forums specifically for the IFrame module where I am sure the Project Lead (Josh Weinstein) would love to capture your comments.  http://dotnetnuke.com/Default.aspx?tabid=795

    Cheers
    Scott Willhite
    It is only with the heart that one can see rightly... what is essential is invisible to the eye.
    ~ Antoine de Saint-Exupéry
  • Re: IFRAME Question

    01-12-2006, 7:56 PM
    • Loading...
    • roachslayer
    • Joined on 12-15-2005, 5:59 PM
    • Posts 24
    • Points 120

    I'm not getting this to work for me at all.  I admit I did a variation on it, but I am really lost as to why its such an issue.  Any guru's out there with ideas?

    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

    1. -I save the code creating the page as described above
    2. -I go into a child portal (or any portal really) such as  localhost/Test   I put an IFrame module on the home page.
    3. -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! !?!???!??

      I am not thinking this is an IFrame problem, but some kind of core functionality I have not used properly, or cant use.  What is the deal with creating custom pages, inheriting the base class, and getting the proper values?

  • Re: IFRAME Question

    01-12-2006, 10:10 PM
    • Loading...
    • oziweb
    • Joined on 04-22-2003, 9:42 PM
    • Posts 345
    • Points 1,725
    I could be wrong but I don't think that your code will display anything without a post back. Try it before the page is rendered and it should work or to do a simple test -put a button on the page and click it.
  • Re: IFRAME Question

    01-13-2006, 1:42 AM
    • Loading...
    • cniknet
    • Joined on 07-23-2002, 7:19 PM
    • Washington, DC
    • Posts 1,915
    • Points 9,585

    The problem occurs because when you call MyPage.aspx you are not providing a way for the portal detection code to figure out which portal the request is being made for. Change the URL to:

    http://localhost/admin/MyPage.aspx?tabid=nnn 

    where nnn is the ID of any page on the child portal. This will get the data to display and also fix the logout problem.

    Also, since there is no IsPostback condition on your code, no postback is necessary for this to function.

    Nik

     

    Nik Kalyani
    Speerio, Inc.

    [DotNetNuke and ASP.Net solutions here]
  • Re: IFRAME Question

    01-13-2006, 6:04 AM
    • Loading...
    • oziweb
    • Joined on 04-22-2003, 9:42 PM
    • Posts 345
    • Points 1,725

    .Also, since there is no IsPostback condition on your code, no postback is necessary for this to function.

    you are of course correct - ignore what i said its just that i had not taken my prozac this morning

     

  • Re: IFRAME Question

    01-13-2006, 2:09 PM
    • Loading...
    • roachslayer
    • Joined on 12-15-2005, 5:59 PM
    • Posts 24
    • Points 120
    cniknet wrote:

    The problem occurs because when you call MyPage.aspx you are not providing a way for the portal detection code to figure out which portal the request is being made for. Change the URL to:

    http://localhost/admin/MyPage.aspx?tabid=nnn 

    where nnn is the ID of any page on the child portal. This will get the data to display and also fix the logout problem.....

    This is the kind of problem I expected, that perhaps it was wiping out the authentication because I loaded a page that did not maintain all the settings.  However, the  tabid=nnn   doesn't do as expected for me.   It actually loads the page whos tabid I give.  I'm not loading a tab from the DB, I am loading a physical ASPX page I wrote.

    i changed your suggestion to ...?portalId=nnn   and it works!  the data is pulled up properly, and it is able to load the UserInfo object as well!   However, I still loose the authentication "sometimes" for some reason.  I am not sure if it's because I am not handling this page right, or simply that DNN 4.0.2 has a logout bug:  see http://forums.asp.net/1017591/ShowPost.aspx

    I also added this code to be sure of my login status

    If Request.IsAuthenticated then
       Response.Write(
    "Auth: Yes")
    Else
       Response.Write("Auth: No")
    End If

    Question:  is it a breach of security to expose the portalId in the URL??  (my first thought is Yes, until proven otherwise)

    Thanks all for the posts!   Now if we can figure out the logout prob.   :o)

  • Re: IFRAME Question

    03-16-2006, 8:14 PM
    • Loading...
    • gatrudeau
    • Joined on 03-17-2006, 1:08 AM
    • Posts 1
    • Points 5

    I have to comment.

    I used a text module and included my propanganda and a hyperlink that pointed to the redirect page with 'target="_new" in the url.  It works wonderfully. Opens a new browser, loads the redirect page, (which is blank of course), then loads the requested page and passes in the userID.  All happens very quickly and is seamless to the user.  The end result is I can now cook up ANY separate 'module' I create and it will know which member called it.  Fantastic bit of code. I wouldn't have thought of it myself. Thanks a hundred times over!

  • Re: IFRAME Question

    06-28-2006, 7:49 AM
    • Loading...
    • zulurl
    • Joined on 08-04-2002, 7:56 AM
    • Posts 59
    • Points 295

    Hello master of DNN

    i need to get the cartid in  a  iframe to customize checkout  (store module of DNN.)

    can u help me

    could be something like this:

    http://forums.asp.net/1045674/showpost.aspx

     

    get cart id instead of user logged!!!!!

Page 1 of 1 (13 items)