Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Location
    Switzerland
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Intranet Userspecific Framepage

    Folks

    We run a little Intranetsite (all handmade in our sparetime). I have now a problem and I don't find the solution.

    Based on the User I would like to display in a Frame a different Framepage or call up an Userform. I have something similar on forms with VB:

    Code:
    Sub User()
        Dim User As String
        User = Application.UserName
            If User = "Jack" Or _
                User = "Joe" Or _
                User = "David" Or _
                User = "Sam" Then
                Call Intranet
            Else
                Call Joke
            End If
    End Sub
    
    Sub Intranet()
        VBA.UserForms.Add("UserForm").Show
    End SubIf USer
    Is there a posibility to this with a JavaScript within Framework?

    Thanks for your replay
    HERTSCH
    Last edited by hertsch; 04-29-2004 at 01:36 PM.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't really understand what you're asking. I also don't think I understand why you're asking this particular question.

    Do you want to convert that VB code to Javascript? If so, why?

    Actually taking a second look tells me that your code is not VBScript, but in fact VB (like .NET or VB6 or something..).

    So are you trying to convert your VB application to a web-based application using Javascript? If so, you're going to have to give a little more background on what you're trying to do, and what HTML/Javascript code you've got working thus far before we can be of any real assistance.

    Good luck,
    Sadiq.

  • #3
    New to the CF scene
    Join Date
    Apr 2004
    Location
    Switzerland
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Intranet Userspecific Framepage

    How to tell what I want, when I never did it and don't know how to do it?

    Based on the User (e.g. "Application.UserName", if possible) I would like to call up two different frames in a frame page. This means, if User Joe opens this page, header 1 will displayed, if Mary opens the same page, header 2 will displayed. See attachment. As an alternative it could be also: popup window/no window.
    I have created this on excel forms available on the page (see previous post) and this works.

    I hope this explains it.

    Thanks
    HERTSCH
    Attached Thumbnails Attached Thumbnails Intranet Userspecific Framepage-problem.jpg  
    Last edited by hertsch; 04-29-2004 at 01:46 PM.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Are you using a server-side language to get the username?
    I think you're using ASP.
    Code:
    <%
    dim page, User
    
    'set value of User here...
    
    Select Case User
      Case "Joe"
         page="header1.htm"
      Case "Mary"
         page="header2.htm"
      '...and so on
    
      Case Else 'default
         page="defaultheader.htm"
    End Select
    %>
    <frameset ...>
      <frame name="header" src="<%=page%>">
    ...
    </frameset>

  • #5
    New to the CF scene
    Join Date
    Apr 2004
    Location
    Switzerland
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks to glenngv.

    I have incorporated your sugestion into the html of the "FramePage". But something don't work. Could someone help me further. Is there a way to have a "CASE OR" link like:

    Code:
    Case "1" or
    Case "2" or
    Case "3"
        Page....
    Case Else....

    Code of the "Frame Page"

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>CTD</title>
    <link rel="stylesheet" type="text/css" href="Page_Ressources/CTD.css">
    </head>
    
    <%
    dim page, User
    
    'set value of User here...
    
    Select Case User
      Case "Joe"
      	  page="MainFrame.htm"
      Case "Sally"
      	  page="MainFrame.htm"
      Case "Mary"
      	  page="MainFrame.htm"
    
      Case Else 'default
         page="MainFrame_Special.htm"
    End Select
    %>
    
    <frameset rows="77,*" border="0" frameborder="0" framespacing="0">
      <frame name="Header" scrolling="no" noresize target="contents" src="CTD_Header.htm" marginwidth="10" marginheight="0" style="border-style: inset; border-width: 3">
      <frameset cols="221,*">
        <frameset rows="*,323">
        <frame name="Tree" target="main" src="CTD_Tree.html" marginwidth="10" marginheight="0" scrolling="auto" noresize style="border-style: inset; border-width: 3">
        <frame name="Tree1" src="Bilder_Scroll.html" target="_self" scrolling="no" noresize marginwidth="3" marginheight="2" style="border-style: inset; border-width: 3">
        </frameset>
        <frame name="MainFrame" src="%=page%" target="_self" marginwidth="0" marginheight="0" scrolling="auto" style="border-style: inset; border-width: 3">
      </frameset>
      <noframes>
      <body style="border-style: groove; border-color: #C0C0C0">
    
      <p>This page uses frames, but your browser doesn't support them.</p>
    
      </body>
      </noframes>
    </frameset>
    
    </html>
    Last edited by hertsch; 04-29-2004 at 01:41 PM.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Code:
    Select Case User
      Case "Joe"
      Case "Sally"
      Case "Mary"
        page="MainFrame.htm"
      Case Else 'default
        page="MainFrame_Special.htm"
    End Select
    ...
    <frame name="MainFrame" src="<%=page%>" ...>
    Don't forget the < and > signs.

  • #7
    New to the CF scene
    Join Date
    Apr 2004
    Location
    Switzerland
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have made it like sugested. Don't work

    From where it knows the "User"? (Windows XP User)
    Do I have to add someting like "<Script language....>?
    Attached Thumbnails Attached Thumbnails Intranet Userspecific Framepage-problem2.jpg  
    Last edited by hertsch; 04-29-2004 at 11:59 AM.

  • #8
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Code:
    dim User : User = request.servervariables("LOGON_USER")
    Select Case User
      Case "Joe"
      Case "Sally"
      Case "Mary"
        page="MainFrame.htm"
      Case Else 'default
        page="MainFrame_Special.htm"
    End Select
    ...
    <frame name="MainFrame" src="<%=page%>" ...>
    http://www.webmasterworld.com/forum47/61.htm


    I'm not sure about LOGON_USER, though - I don't think it's always available in the servervariables collection.

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts
    I don't know where would User come from, that's why I leave it in my suggested code. I dont't know how his login process goes.

    LOGON_USER is only available if you set IIS not to allow Anonymous access and set Basic Authentication. This means that a login prompt dialog will be displayed if your site is accessed by any user.

    This should be moved to ASP forum to get more help.

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts
    I only noticed now from your screenshot that the file extension of your page is .htm. Are you using any server-side language like ASP or something? If not, the previous code suggested is not for you. If this is really a static html page, then you should tell us how do you know who's logged in to your site. Do you provide a login page?

  • #11
    New to the CF scene
    Join Date
    Apr 2004
    Location
    Switzerland
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Glenn

    From that technical stuff you writte I don't understand much.
    I run this Web only internal and everybody has to go true a login process on his PC (Power on).
    With VBA in Excel I can get the User with....

    Code:
    Sub User()
        Dim User As String
        User = Application.UserName
    This brings back the Username and based on it I'm able to create a IF-THEN-ELSE routine. Anything like that I need to controll the frames.......

    HERTSCH

  • #12
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts
    You need to have your Web application its own login process.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •