ASP and VBScript questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gpence

    ASP and VBScript questions

    !!! Newbie question warning !!!

    I am somewhat familiar with javascript's ability to "access" the
    browser's favorites list -- for example, using window.home() will take
    you to the default URL -- is there any similar code for an ASP page
    using VBscript? I want my Logout button to take them back to their
    homepage. I've looked into Response.Redire ct, but I can't seem to find
    a way to take the user out of my program to their home default.

    Another possibility: can I integrate Javascript with the VBScript?

    One other question: I have a login page with the usual
    username/password fields, but I cannot find a way to force the cursor
    into the username field by default -- in other words, the user must
    click there in order to begin typing. Ideas?

    TIA,
    gpence
  • Andy Dingley

    #2
    Re: ASP and VBScript questions

    On 11 Aug 2003 07:00:53 -0700, gpence@uiuc.edu (gpence) wrote:
    [color=blue]
    >I am somewhat familiar with javascript's ability to "access" the
    >browser's favorites list -- for example, using window.home() will take
    >you to the default URL -- is there any similar code for an ASP page
    >using VBscript?[/color]

    Write a page out to the browser that does this from a window_onload
    event handler.
    [color=blue]
    >Another possibility: can I integrate Javascript with the VBScript?[/color]

    Of course. This is trivial on ASP - just keep them in separate files.

    Even better though is to throw VBScript away and write in JScript for
    both server and client. It's a better langauge, and you only need to
    learn one of them,


    Comment

    • Jim Dabell

      #3
      Re: ASP and VBScript questions

      Andy Dingley wrote:
      [color=blue]
      > On 11 Aug 2003 07:00:53 -0700, gpence@uiuc.edu (gpence) wrote:[/color]
      [snip][color=blue][color=green]
      >>Another possibility: can I integrate Javascript with the VBScript?[/color]
      >
      > Of course. This is trivial on ASP - just keep them in separate files.[/color]

      Well, I suspect the OP was talking about mixing client-side Javascript with
      server-side VBScript. You just have to use one to write out the other.
      You could even have server-side JScript writing out client-side VBScript if
      you wanted, although I'm not sure _why_ anybody would want that.

      [color=blue]
      > Even better though is to throw VBScript away and write in JScript for
      > both server and client. It's a better langauge, and you only need to
      > learn one of them,[/color]

      I've found that JScript is better supported compared with VBScript when
      using non-Microsoft ASP engines. That makes sense, considering that
      JScript/Javascript/ECMAScript has become a published standard. And of
      course, there's also the fact that VBScript is a _horrible_ language.

      In any case, I'm sure there are better newsgroups for talking about ASP,
      Javascript and VBScript. Try:

      <URL:news:micro soft.public.ine tserver.asp>
      <URL:news:comp. lang.javascript >
      <URL:news:micro soft.public.scr ipting.vbscript >

      --
      Jim Dabell

      Comment

      • gpence

        #4
        Re: ASP and VBScript questions

        "William Tasso" <ngx@tbdata.com > wrote in message news:<bh89d8$vf 2qo$1@ID-139074.news.uni-berlin.de>...
        [color=blue][color=green]
        > > Another possibility: can I integrate Javascript with the VBScript?[/color]
        >
        > possibly, no definately, but why don't you concentrate on providing
        > interesting and unique content for your visitors in HTML before trying to
        > mess with their browsing.
        >[color=green]
        > > One other question: I have a login page with the usual
        > > username/password fields, but I cannot find a way to force the cursor
        > > into the username field by default -- in other words, the user must
        > > click there in order to begin typing. Ideas?[/color]
        >
        > It's a good idea to leave it alone. The issues have been well documented
        > here and in other groups: may I suggest you search the archive at:
        > http://groups.google.com[/color]

        Hi William,

        Thanks for your response. I should have added a little more info to my
        original post. This is a set of intranet pages for my employees' use
        only. I'm not trying to mess with their browser or their favorite
        list, I'm just trying to take them out to the web site of their
        preference (I'm guessing that would be their default homepage). They
        all use the same version of IE, so cross-browser incompatibility isn't
        an issue (in fact, it's something of a security bonus!)

        There is, in fact, little in the way of content. This is a framework
        for them to add details for various projects into a documentation
        database. So there's a login page (and assorted retry pages), a change
        password page, a main page which includes a search function and either
        a textarea to add comments to the project, or a display area to show
        the previous documentation history.

        In regard to the latter comment -- your suggestion seems totally
        opposed to what I have experienced on the web. When I'm presented with
        a web page asking for me to login, I can normally just start typing
        because the focus is already in the username field. Can you suggest
        something to search on, I have tried "default field", "field
        selection", and "cursor placement", but haven't found anything which
        look relevant after a cursory review.

        Thanks,
        gpence

        Comment

        • William Tasso

          #5
          Re: ASP and VBScript questions

          gpence wrote:[color=blue]
          > "William Tasso" <ngx@tbdata.com > wrote in message
          > news:<bh89d8$vf 2qo$1@ID-139074.news.uni-berlin.de>...
          >[color=green][color=darkred]
          >>> Another possibility: can I integrate Javascript with the VBScript?[/color]
          >>
          >> possibly, no definately, but why don't you concentrate on providing
          >> interesting and unique content for your visitors in HTML before
          >> trying to mess with their browsing.
          >>[color=darkred]
          >>> One other question: I have a login page with the usual
          >>> username/password fields, but I cannot find a way to force the
          >>> cursor into the username field by default -- in other words, the
          >>> user must click there in order to begin typing. Ideas?[/color]
          >>
          >> It's a good idea to leave it alone. The issues have been well
          >> documented here and in other groups: may I suggest you search the
          >> archive at: http://groups.google.com[/color]
          >
          > Hi William,
          >
          > Thanks for your response. I should have added a little more info to my
          > original post. This is a set of intranet pages for my employees' use
          > only.[/color]

          ok, but it is accepted practice to mention that fact when posting to groups
          that deal with www topics.
          [color=blue]
          > I'm not trying to mess with their browser or their favorite
          > list, I'm just trying to take them out to the web site of their
          > preference[/color]

          then perhaps make it a data element that they can configure in an admin page
          or similar.
          [color=blue]
          > (I'm guessing that would be their default homepage).[/color]

          why?
          [color=blue]
          > They
          > all use the same version of IE, so cross-browser incompatibility isn't
          > an issue (in fact, it's something of a security bonus!)[/color]

          till the next upgrade ;o)
          [color=blue]
          > ...
          > In regard to the latter comment -- your suggestion seems totally
          > opposed to what I have experienced on the web. When I'm presented with
          > a web page asking for me to login, I can normally just start typing
          > because the focus is already in the username field. Can you suggest
          > something to search on, I have tried "default field", "field
          > selection", and "cursor placement", but haven't found anything which
          > look relevant after a cursory review.
          >[/color]

          The issue (in summary) is:

          As the page starts to render in the browser the visitor can click into an
          input field and start typing. When your page finishes loading the script
          executes and sets focus to your chosen input field. This behaviour causes
          confusion at best, often causing passwords to be readable (in the username
          field for example) to any bystanders.

          This may or may not be an issue in your environment. I have worked in
          companies where network un/password sharing/abuse was a sackable offence.

          But - as this is an intranet then the issue of logging in is a non-starter.
          Just use integrated windows authentication and you can concentrate on
          building functionality - you already know who your users are.

          --
          William Tasso - http://WilliamTasso.com


          Comment

          • gpence

            #6
            Re: ASP and VBScript questions

            "CJM" <cjmwork@m.co.u k> wrote in message news:<3f37c9c1$ 2@shknews01>...

            [snip]
            [color=blue]
            >
            > Logout button takes you to intermediate page:
            >[color=green][color=darkred]
            > >>>>>>>>>[/color][/color]
            >
            > <%
            >
            > 'Asp clean up code
            >
            > %>
            > <html> etc
            >
            > <body onload='javascr ipt: window.home();' >
            >
            > etc...
            >
            >
            > The asp code will clean up then render an blank HTML which redirects to the
            > homepage... Yes, this is a messy solution too...
            >
            >
            > BUT my final advice is... DONT.
            >
            > http://www.aspfaq.com/show.asp?id=2055
            >
            > This advice is not ASP specific.
            >
            > hth
            >
            > Chris[/color]

            Thanks Chris! For some reason, (obviously, a brain fart) I was trying
            to implement the javascript code on the button -- I had designed the
            clean up page, but was just missing the onload() part (duh). My
            solution will briefly flash a "logged out" message before sending the
            user to their homepage. I also looked at the aspfaq page, but I'll
            reiterate what I said to William earlier. I am not trying to change
            anything on the users' machine. I am simply wanting to use a browser
            variable they've defined. For most of the employees, that will
            probably be our intranet portal, but some users (myself included) have
            different homepages configured.

            Thanks again!
            gpence

            Comment

            Working...