popup window using ASP and VBscript

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

    popup window using ASP and VBscript

    Hi everyone

    I am having a little problem with an asp page.
    I am trying to create a master/detail page, but on this occasion, it's only
    a small amount of detail, so i want to create a small page, for the detail,
    and have that pop up. something you would do for instance to show a link to
    a larger graphic on your detail page.
    It's obvious that i am doing something wrong, because instead of opening the
    new page, in the pop up, the main page moves to the detail, and the pop up
    window then opens up as an error.
    For example here

    Clicking on a link there will give me the detail page, but not where i want
    it.

    This is my code from the master page, and the error is probably here


    <a href="info.asp? GradeID=<%=(rsS ublisting("Grad eID"))%>"
    onClick="window .open('nameofwi ndow','','width =100,height=100 ');return
    false"><%=rsSub Listing("Grades ")%></a>

    Could someone point out what i have done wrong?

    Thanks so much

    Raphael


  • Ray at

    #2
    Re: popup window using ASP and VBscript

    Try

    <A href="#"
    onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting("Grad e
    ID")%>',width=1 00,height=100)" ><%=rsSubListin g("Grades")%> </A>

    Ray at work

    "Raphael Gluck" <iwish i could tell you @alas blame the spammers> wrote in
    message news:u0AsuJvaDH A.2136@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi everyone
    >
    > I am having a little problem with an asp page.
    > I am trying to create a master/detail page, but on this occasion, it's[/color]
    only[color=blue]
    > a small amount of detail, so i want to create a small page, for the[/color]
    detail,[color=blue]
    > and have that pop up. something you would do for instance to show a link[/color]
    to[color=blue]
    > a larger graphic on your detail page.
    > It's obvious that i am doing something wrong, because instead of opening[/color]
    the[color=blue]
    > new page, in the pop up, the main page moves to the detail, and the pop up
    > window then opens up as an error.
    > For example here
    > http://www.tripak.me.uk/sublisting.a...9&TexSpecID=34
    > Clicking on a link there will give me the detail page, but not where i[/color]
    want[color=blue]
    > it.
    >
    > This is my code from the master page, and the error is probably here
    >
    >
    > <a href="info.asp? GradeID=<%=(rsS ublisting("Grad eID"))%>"
    > onClick="window .open('nameofwi ndow','','width =100,height=100 ');return
    > false"><%=rsSub Listing("Grades ")%></a>
    >
    > Could someone point out what i have done wrong?
    >
    > Thanks so much
    >
    > Raphael
    >
    >[/color]


    Comment

    • Raphael Gluck

      #3
      Re: popup window using ASP and VBscript

      Thanks
      I tried that, but it doesnt seem to work, I entered all this

      <A href="#"
      onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting("Grad e
      ID")%>',width=1 00,height=100)" ><%=rsSubListin g("Grades")%> </A>

      And it just doesnt move. I can see an error triangle in the bottom of the
      web page, line 188 which doesnt contain anything to help me
      Have i misunderstood your script line? must i modify it?

      Please help

      Raphael


      Comment

      • Raphael Gluck

        #4
        Re: popup window using ASP and VBscript

        sorry if this a double post, but it doesnt look like it sent

        Thanks Ray
        my pages are in ASP and VBscript
        would that be possible cause or is that a silly question?

        Raphael


        Comment

        • Ray at

          #5
          Re: popup window using ASP and VBscript

          The problem you're having has to do with javascript, not ASP. Try loading
          your page and doing a view-source and debugging the client-side code after
          checking what error the browser is reporting.

          Ray at work

          "Raphael Gluck" <iwish i could tell you @alas blame the spammers> wrote in
          message news:eMgvH8xaDH A.736@TK2MSFTNG P09.phx.gbl...[color=blue]
          > sorry if this a double post, but it doesnt look like it sent
          >
          > Thanks Ray
          > my pages are in ASP and VBscript
          > would that be possible cause or is that a silly question?
          >
          > Raphael
          >
          >[/color]


          Comment

          • Raphael Gluck

            #6
            Re: popup window using ASP and VBscript

            Thanks Ray, But still not

            Can i ask you again are you sure this code is the correct one?

            <A href="#"
            onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting("Grad e
            ID")%>',width=1 00,height=100)" ><%=rsSubListin g("Grades")%> </A>


            The error doesnt seem to be confined to one line, though the page displays.
            Maybe i need to tell you more.
            The page i am on is sublisting.asp
            The page i am trying to get to pop up is called info.asp
            When i roll over the mouse over the link, sublisting.asp? Item_ID etc...
            I know you're way better at this than me, but arent i supposed to see
            info.asp? etc...

            Do i need to insert something into the ahref tag? instead of "#"

            Please help

            Raphael


            Comment

            • Adrienne

              #7
              Re: popup window using ASP and VBscript

              Gazing into my crystal ball I observed "Raphael Gluck" <iwish i could
              tell you @alas blame the spammers> writing in
              news:eZRiTIyaDH A.2016@TK2MSFTN GP10.phx.gbl:
              [color=blue]
              > Thanks Ray, But still not
              >
              > Can i ask you again are you sure this code is the correct one?
              >
              ><A href="#"
              > onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting("G
              > rade ID")%>',width=1 00,height=100)" ><%=rsSubListin g("Grades")%> </A>
              >
              >
              > The error doesnt seem to be confined to one line, though the page
              > displays. Maybe i need to tell you more.
              > The page i am on is sublisting.asp
              > The page i am trying to get to pop up is called info.asp
              > When i roll over the mouse over the link, sublisting.asp? Item_ID etc...
              > I know you're way better at this than me, but arent i supposed to see
              > info.asp? etc...
              >
              > Do i need to insert something into the ahref tag? instead of "#"
              >
              > Please help
              >
              > Raphael
              >
              >
              >[/color]

              That's the problem with using javascript for links. You haven't provided a
              method for non-javascript users. <a href="#"> will only take the user to
              the top of the page.

              What you need to do is:
              <A href="info.asp? GradeID=<%=rsSu blisting("Grade ID")%>"
              onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting
              ("Grade ID")%>',width=1 00,height=100); return false" title="Open <%
              =rsSublisting(" Grade ID")%> in a new window" target="_blank" ><%
              =rsSubListing(" Grades")%></A>

              The above does three things:
              1. The return false allows users without javascript to open the page.
              2. The title attribute indicates that the page will open in a new window.
              For accessibility reasons, users should know that pages are going to open
              in new windows.
              3. The target attribute opens in a new window for non-javascript users.

              Note: users with pop-up stoppers may still have problems with
              target="_blank" , therefore, it might be better to omit it and suggest the
              user open in a new window.

              --
              Adrienne Boswell
              Please respond to the group so others can share

              Comment

              • Raphael Gluck

                #8
                Re: popup window using ASP and VBscript

                Thank you Adrienne

                I tried your script yesterday, but it gave me errors as you can see,
                I have just tried again, and now it's not giving me errors, but still not
                achieving its purpose

                It's opening the new page, but as a full sized browser window.
                It's because i am VB illiterate, I guess that's bad.
                I hope you can help me if you have a minute

                Thanks so much

                Raphael


                Comment

                • Dave Anderson

                  #9
                  Re: popup window using ASP and VBscript

                  "Adrienne" wrote:[color=blue]
                  >
                  > What you need to do is:
                  > <A href="info.asp? GradeID=<%=rsSu blisting("Grade ID")%>"
                  > onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting
                  > ("Grade ID")%>',width=1 00,height=100); return false" title="Open <%
                  > =rsSublisting(" Grade ID")%> in a new window" target="_blank" ><%
                  > =rsSubListing(" Grades")%></A>[/color]

                  Everybody keeps mixing up the order of the parameters in window.open():
                  Gain technical skills through documentation and training, earn certifications and connect with the community


                  Here's a better idea -- instead of "_blank", use TARGET="nameofw indow" and
                  omit the [return false]. And use a more descriptive window name, for crying
                  out loud. Your link should look something like this:

                  <A HREF="info.asp? GradeID=<%=rsSu blisting.Fields ("Grade ID").Value%>"
                  ONCLICK="window .open('','grade Details','heigh t=100,width=100 ')"
                  TITLE="Open <%=rsSublisting .Fields("Grade ID").Value%> in a new
                  window"
                  TARGET="gradeDe tails"[color=blue]
                  >[/color]

                  If scripting is defective or absent, this will open in a default-sized
                  window named "gradeDetai ls". If scripting is functional, the properly sized
                  (and named) window will be created with the click event, and will
                  immediately be used as the target of the anchor.


                  Tested successfully in the following browsers:
                  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)
                  Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.4) Gecko/20030624
                  Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2) Opera 7.11 [en]


                  --
                  Dave Anderson

                  Unsolicited commercial email will be read at a cost of $500 per message. Use
                  of this email address implies consent to these terms. Please do not contact
                  me directly or ask me to contact you directly for assistance. If your
                  question is worth asking, it's worth posting.


                  Comment

                  • Raphael Gluck

                    #10
                    Re: popup window using ASP and VBscript

                    thank you very much, i will try this option too.
                    I appreciate it

                    Raphael
                    "Dave Anderson" <GTSPXOESSGOQ@s pammotel.com> wrote in message
                    news:eqdji5yaDH A.1748@TK2MSFTN GP12.phx.gbl...[color=blue]
                    > "Adrienne" wrote:[color=green]
                    > >
                    > > What you need to do is:
                    > > <A href="info.asp? GradeID=<%=rsSu blisting("Grade ID")%>"
                    > > onclick="window .open('nameofwi ndow','info.asp ?GradeID=<%=rsS ublisting
                    > > ("Grade ID")%>',width=1 00,height=100); return false" title="Open <%
                    > > =rsSublisting(" Grade ID")%> in a new window" target="_blank" ><%
                    > > =rsSubListing(" Grades")%></A>[/color]
                    >
                    > Everybody keeps mixing up the order of the parameters in window.open():
                    >[/color]
                    http://msdn.microsoft.com/workshop/a...ods/open_0.asp[color=blue]
                    >
                    > Here's a better idea -- instead of "_blank", use TARGET="nameofw indow" and
                    > omit the [return false]. And use a more descriptive window name, for[/color]
                    crying[color=blue]
                    > out loud. Your link should look something like this:
                    >
                    > <A HREF="info.asp? GradeID=<%=rsSu blisting.Fields ("Grade ID").Value%>"
                    > ONCLICK="window .open('','grade Details','heigh t=100,width=100 ')"
                    > TITLE="Open <%=rsSublisting .Fields("Grade ID").Value%> in a new
                    > window"
                    > TARGET="gradeDe tails"[color=green]
                    > >[/color]
                    >
                    > If scripting is defective or absent, this will open in a default-sized
                    > window named "gradeDetai ls". If scripting is functional, the properly[/color]
                    sized[color=blue]
                    > (and named) window will be created with the click event, and will
                    > immediately be used as the target of the anchor.
                    >
                    >
                    > Tested successfully in the following browsers:
                    > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)
                    > Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.4) Gecko/20030624
                    > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2) Opera 7.11 [en]
                    >
                    >
                    > --
                    > Dave Anderson
                    >
                    > Unsolicited commercial email will be read at a cost of $500 per message.[/color]
                    Use[color=blue]
                    > of this email address implies consent to these terms. Please do not[/color]
                    contact[color=blue]
                    > me directly or ask me to contact you directly for assistance. If your
                    > question is worth asking, it's worth posting.
                    >
                    >[/color]


                    Comment

                    • Raphael Gluck

                      #11
                      Re: popup window using ASP and VBscript

                      Thank you Adrienne

                      Is it possible to help me with one more thing, can you show me where to
                      place the screen. how can i specify the x and y coordinates.

                      Thank you very much


                      Comment

                      • Raphael Gluck

                        #12
                        Re: popup window using ASP and VBscript

                        well actually i did post to scripting.vbscr ipt 24 hours ago, with not a
                        single reply

                        Raphael


                        Comment

                        Working...