How can I keep a section of code from firing?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David P. Jessup

    How can I keep a section of code from firing?

    I am wondering if I am attempting the impossible on one page.

    CODE:
    set current= cConn.Execute(S QLCurrent)
    Do Until current.eof
    Response.Write "<p>Current Path: <b>" & current("CPath" ) & "</p></b>"
    'Response.Write "<p>Current Name: <b>" & current("Name") & "</p></b>"
    'Response.Write "<p>Current contact email: <b>" & current("Contac t") &
    "</p></b>"
    current.movenex t
    Loop
    'start of self posting form
    %>
    <form action="start.a sp" method="post">
    <P>What is the location?<BR><I NPUT id=PPath name=PPath><br>
    <INPUT id=submit type=submit value=Submit name=submit></P></form>
    <%
    'end of self posting form

    PPath=request.F orm("PPath")
    on error resume next
    Response.Write PPath & "<br>"
    Dim objFSO
    Set objFSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
    Dim objFolder
    set objFolder = objFSO.GetFolde r("PPath")
    dim objfile

    END CODE:

    As you can see I'm attempting to run a form in my asp page and then take the
    input from that form and then use it further down the page.

    Well I use the input as a physical path for the FSO call I use. As long as
    I have the on error resume next I can by-pass the error I would get until
    the user actually submits the form.

    So now to my question, is it possible 'hide' the FSO call until the form is
    submitted? I would prefer to keep all this on one page instead of posting
    and using request.form on another webpage.

    Thanks for any assistance.


  • Aaron Bertrand - MVP

    #2
    Re: How can I keep a section of code from firing?

    if ppath <> "" then
    ' fso code here
    end if


    "David P. Jessup" <davidATimntDAS HtechDOTcom> wrote in message
    news:eMk5E2VUDH A.2568@tk2msftn gp13.phx.gbl...[color=blue]
    > I am wondering if I am attempting the impossible on one page.
    >
    > CODE:
    > set current= cConn.Execute(S QLCurrent)
    > Do Until current.eof
    > Response.Write "<p>Current Path: <b>" & current("CPath" ) & "</p></b>"
    > 'Response.Write "<p>Current Name: <b>" & current("Name") & "</p></b>"
    > 'Response.Write "<p>Current contact email: <b>" & current("Contac t") &
    > "</p></b>"
    > current.movenex t
    > Loop
    > 'start of self posting form
    > %>
    > <form action="start.a sp" method="post">
    > <P>What is the location?<BR><I NPUT id=PPath name=PPath><br>
    > <INPUT id=submit type=submit value=Submit name=submit></P></form>
    > <%
    > 'end of self posting form
    >
    > PPath=request.F orm("PPath")
    > on error resume next
    > Response.Write PPath & "<br>"
    > Dim objFSO
    > Set objFSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
    > Dim objFolder
    > set objFolder = objFSO.GetFolde r("PPath")
    > dim objfile
    >
    > END CODE:
    >
    > As you can see I'm attempting to run a form in my asp page and then take[/color]
    the[color=blue]
    > input from that form and then use it further down the page.
    >
    > Well I use the input as a physical path for the FSO call I use. As long[/color]
    as[color=blue]
    > I have the on error resume next I can by-pass the error I would get until
    > the user actually submits the form.
    >
    > So now to my question, is it possible 'hide' the FSO call until the form[/color]
    is[color=blue]
    > submitted? I would prefer to keep all this on one page instead of posting
    > and using request.form on another webpage.
    >
    > Thanks for any assistance.
    >
    >[/color]


    Comment

    • David P. Jessup

      #3
      Re: How can I keep a section of code from firing?

      Sheesh,
      Yep I'm still an ASP newbie :)

      Thanks Aaron

      "Aaron Bertrand - MVP" <aaron@TRASHasp faq.com> wrote in message
      news:e1VfVCWUDH A.2152@TK2MSFTN GP09.phx.gbl...[color=blue]
      > if ppath <> "" then
      > ' fso code here
      > end if
      >
      >
      > "David P. Jessup" <davidATimntDAS HtechDOTcom> wrote in message
      > news:eMk5E2VUDH A.2568@tk2msftn gp13.phx.gbl...[color=green]
      > > I am wondering if I am attempting the impossible on one page.
      > >
      > > CODE:
      > > set current= cConn.Execute(S QLCurrent)
      > > Do Until current.eof
      > > Response.Write "<p>Current Path: <b>" & current("CPath" ) & "</p></b>"
      > > 'Response.Write "<p>Current Name: <b>" & current("Name") & "</p></b>"
      > > 'Response.Write "<p>Current contact email: <b>" & current("Contac t") &
      > > "</p></b>"
      > > current.movenex t
      > > Loop
      > > 'start of self posting form
      > > %>
      > > <form action="start.a sp" method="post">
      > > <P>What is the location?<BR><I NPUT id=PPath name=PPath><br>
      > > <INPUT id=submit type=submit value=Submit name=submit></P></form>
      > > <%
      > > 'end of self posting form
      > >
      > > PPath=request.F orm("PPath")
      > > on error resume next
      > > Response.Write PPath & "<br>"
      > > Dim objFSO
      > > Set objFSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
      > > Dim objFolder
      > > set objFolder = objFSO.GetFolde r("PPath")
      > > dim objfile
      > >
      > > END CODE:
      > >
      > > As you can see I'm attempting to run a form in my asp page and then take[/color]
      > the[color=green]
      > > input from that form and then use it further down the page.
      > >
      > > Well I use the input as a physical path for the FSO call I use. As long[/color]
      > as[color=green]
      > > I have the on error resume next I can by-pass the error I would get[/color][/color]
      until[color=blue][color=green]
      > > the user actually submits the form.
      > >
      > > So now to my question, is it possible 'hide' the FSO call until the form[/color]
      > is[color=green]
      > > submitted? I would prefer to keep all this on one page instead of[/color][/color]
      posting[color=blue][color=green]
      > > and using request.form on another webpage.
      > >
      > > Thanks for any assistance.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...