Server Side Set of Request.Form Variables?

Discussion in 'ASP General' started by Thomas Lunsford, May 11, 2007.

  1. I have inherited a set of asp pages that I now need to augment. In
    order to minimize changes to production code, I would like to make a
    "call" to an asp page from a new asp page. Existing code is using
    many Request.Form variables, and I would very much prefer not to
    change this code. The new page will retrieve data that I would like
    to fill into Request.Form variables that are used in the old code.

    So, is it possible for me to set Request.Form variables from within an
    asp page and then fire off a second page that uses those variables as
    well as any Request.Form variables that were passed to the original
    page. Additionaly, it should all occur on the server, and the client
    would only get a response after all on the server is complete.

    Thanks.
    -Thomas
    Thomas Lunsford, May 11, 2007
    #1
    1. Advertising

  2. Thomas Lunsford wrote:
    > I have inherited a set of asp pages that I now need to augment. In
    > order to minimize changes to production code, I would like to make a
    > "call" to an asp page from a new asp page. Existing code is using
    > many Request.Form variables, and I would very much prefer not to
    > change this code. The new page will retrieve data that I would like
    > to fill into Request.Form variables that are used in the old code.
    >
    > So, is it possible for me to set Request.Form variables from within an
    > asp page and then fire off a second page that uses those variables as
    > well as any Request.Form variables that were passed to the original
    > page. Additionaly, it should all occur on the server, and the client
    > would only get a response after all on the server is complete.
    >

    No. the Request object collections are readonly.

    However, you can use Server.Execute to execute code in another page

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], May 11, 2007
    #2
    1. Advertising

  3. On May 11, 12:18 pm, "Bob Barrows [MVP]" <>
    wrote:
    > Thomas Lunsford wrote:
    > > I have inherited a set of asp pages that I now need to augment. In
    > > order to minimize changes to production code, I would like to make a
    > > "call" to an asp page from a new asp page. Existing code is using
    > > many Request.Form variables, and I would very much prefer not to
    > > change this code. The new page will retrieve data that I would like
    > > to fill into Request.Form variables that are used in the old code.

    >
    > > So, is it possible for me to set Request.Form variables from within an
    > > asp page and then fire off a second page that uses those variables as
    > > well as any Request.Form variables that were passed to the original
    > > page. Additionaly, it should all occur on the server, and the client
    > > would only get a response after all on the server is complete.

    >
    > No. the Request object collections are readonly.
    >
    > However, you can use Server.Execute to execute code in another page
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.


    Bob, Thanks for the reply. I have tried a number of things, and it
    appears that I need to create and populate a form on my new page that
    gets submitted to the other page. I would like to do this server side
    only. Is this possible? I have tried ServerXMLHTTP, and which works
    great, but Microsoft has warned against using it in IIS because it can
    cause thread deadlocking. So, if I could just perform the submit from
    the server, I think my problem would be solved.

    -Thomas
    Thomas Lunsford, May 15, 2007
    #3
  4. Thomas Lunsford wrote:
    > On May 11, 12:18 pm, "Bob Barrows [MVP]" <>
    > wrote:
    >> Thomas Lunsford wrote:
    >>> I have inherited a set of asp pages that I now need to augment. In
    >>> order to minimize changes to production code, I would like to make a
    >>> "call" to an asp page from a new asp page. Existing code is using
    >>> many Request.Form variables, and I would very much prefer not to
    >>> change this code. The new page will retrieve data that I would like
    >>> to fill into Request.Form variables that are used in the old code.

    >>
    >>> So, is it possible for me to set Request.Form variables from within
    >>> an asp page and then fire off a second page that uses those
    >>> variables as well as any Request.Form variables that were passed to
    >>> the original page. Additionaly, it should all occur on the server,
    >>> and the client would only get a response after all on the server is
    >>> complete.

    >>
    >> No. the Request object collections are readonly.
    >>
    >> However, you can use Server.Execute to execute code in another page
    >>

    >
    > Bob, Thanks for the reply. I have tried a number of things, and it
    > appears that I need to create and populate a form on my new page that
    > gets submitted to the other page. I would like to do this server side
    > only. Is this possible? I have tried ServerXMLHTTP, and which works
    > great, but Microsoft has warned against using it in IIS because it can
    > cause thread deadlocking.


    Could you provide a citation for this? I know they advise against using
    the XMLHTTPRequest object in server-side code, but I've never seen an
    admonishment against using the XMLHTTPServer object which was designed
    to be used in the IIS environment.
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], May 15, 2007
    #4
  5. The following link is a newsgroup posting from a Microsoft employee...

    http://groups.google.com/group/microsoft.public.xml.msxml-webrelease/msg/ed0c25d38c8680c2

    Our production environment is hallowed ground, so I'm leery of taking
    chances, especially after reading the posting in the above link. I
    have not yet found a good explanation of all the repercussions of
    Isolated Application Protection in IIS, so that spooks me a bit.

    I would like to know whether using ServerXMLHTTP is common practice
    and whether it has other known limitations/problems. I'm still
    learning and researching.

    Any information you can provide is greatly appreciated.

    Thanks.
    -Thomas
    Thomas Lunsford, May 15, 2007
    #5
  6. Thomas Lunsford wrote:
    > The following link is a newsgroup posting from a Microsoft employee...
    >
    > http://groups.google.com/group/microsoft.public.xml.msxml-webrelease/msg/ed0c25d38c8680c2
    >
    > Our production environment is hallowed ground, so I'm leery of taking
    > chances, especially after reading the posting in the above link. I
    > have not yet found a good explanation of all the repercussions of
    > Isolated Application Protection in IIS, so that spooks me a bit.
    >
    > I would like to know whether using ServerXMLHTTP is common practice
    > and whether it has other known limitations/problems. I'm still
    > learning and researching.
    >
    > Any information you can provide is greatly appreciated.
    >

    Ah! Now I remember that.
    I did not realize you were posting back to the same server.

    There are no repercussions outside of extra resource use to using Isolated
    Application Protection that i am aware of.

    That post was written back in 2001 so this may no longer be an issue for
    IIS6. I will run it by my fellow mvps.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 16, 2007
    #6
  7. Great. Thanks for the update. I am interested in hearing what your
    colleagues have to say.

    Thanks again.
    -Thomas
    Thomas Lunsford, May 16, 2007
    #7
  8. Thomas  Lunsford

    Evertjan. Guest

    Thomas Lunsford wrote on 16 mei 2007 in
    microsoft.public.inetserver.asp.general:

    >
    > Great. Thanks for the update. I am interested in hearing what your
    > colleagues have to say.


    What update?

    [please always quote on usenet]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 16, 2007
    #8
  9. Bob Barrows [MVP] wrote:
    > Thomas Lunsford wrote:
    >> The following link is a newsgroup posting from a Microsoft
    >> employee...
    >>
    >>

    http://groups.google.com/group/microsoft.public.xml.msxml-webrelease/msg/ed0c25d38c8680c2
    >>
    >> Our production environment is hallowed ground, so I'm leery of taking
    >> chances, especially after reading the posting in the above link. I
    >> have not yet found a good explanation of all the repercussions of
    >> Isolated Application Protection in IIS, so that spooks me a bit.
    >>
    >> I would like to know whether using ServerXMLHTTP is common practice
    >> and whether it has other known limitations/problems. I'm still
    >> learning and researching.
    >>
    >> Any information you can provide is greatly appreciated.
    >>

    > Ah! Now I remember that.
    > I did not realize you were posting back to the same server.
    >
    > There are no repercussions outside of extra resource use to using
    > Isolated Application Protection that i am aware of.
    >
    > That post was written back in 2001 so this may no longer be an issue
    > for IIS6. I will run it by my fellow mvps.
    >


    No replies to my queries as yet. However, I do want to point out that
    the version of ServerXMLHTTP in that article was 4.0. Version 6 of the
    MSXML Parser is the current version. Unfortunately, I do not know if the
    new version corrects the problem pointed out in that article. I'm not
    even certain whom I could ask, given the .Net emphasis these days.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], May 16, 2007
    #10
  10. Thomas  Lunsford

    Evertjan. Guest

    Thomas Lunsford wrote on 16 mei 2007 in
    microsoft.public.inetserver.asp.general:

    > http://groups.google.com/group/microsoft.public.inetserver.asp.general/
    > browse_thread/thread/d77516b4d97413d2/3f2c1eb9a8b6f27b?lnk=st&q=tlunsfo
    > rd&rnum=1&hl=en
    >


    Are you replying on something I wrote?

    [please always quote on usenet]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 16, 2007
    #11
  11. On May 16, 2:24 pm, "Bob Barrows [MVP]" <>
    wrote:
    > Bob Barrows [MVP] wrote:
    > > Thomas Lunsford wrote:
    > >> The following link is a newsgroup posting from a Microsoft
    > >> employee...

    >
    > http://groups.google.com/group/microsoft.public.xml.msxml-webrelease/...
    >
    >
    >
    >
    >
    >
    >
    > >> Our production environment is hallowed ground, so I'm leery of taking
    > >> chances, especially after reading the posting in the above link. I
    > >> have not yet found a good explanation of all the repercussions of
    > >> Isolated Application Protection in IIS, so that spooks me a bit.

    >
    > >> I would like to know whether using ServerXMLHTTP is common practice
    > >> and whether it has other known limitations/problems. I'm still
    > >> learning and researching.

    >
    > >> Any information you can provide is greatly appreciated.

    >
    > > Ah! Now I remember that.
    > > I did not realize you were posting back to the same server.

    >
    > > There are no repercussions outside of extra resource use to using
    > > Isolated Application Protection that i am aware of.

    >
    > > That post was written back in 2001 so this may no longer be an issue
    > > for IIS6. I will run it by my fellow mvps.

    >
    > No replies to my queries as yet. However, I do want to point out that
    > the version of ServerXMLHTTP in that article was 4.0. Version 6 of the
    > MSXML Parser is the current version. Unfortunately, I do not know if the
    > new version corrects the problem pointed out in that article. I'm not
    > even certain whom I could ask, given the .Net emphasis these days.
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.- Hide quoted text -
    >
    > - Show quoted text -


    Bob,

    Thank you very much for your help. Having done more research and not
    finding and significant issues myself, I am proceeding with using
    ServerXMLHTTP. If you do happen to find out additional info, please
    update the thread. I will do the same if this turns out badly. :)

    -Thomas
    Thomas Lunsford, May 17, 2007
    #12
  12. On May 16, 2:59 pm, "Evertjan." <> wrote:
    > Thomas Lunsford wrote on 16 mei 2007 in
    > microsoft.public.inetserver.asp.general:
    >
    > >http://groups.google.com/group/microsoft.public.inetserver.asp.general/
    > > browse_thread/thread/d77516b4d97413d2/3f2c1eb9a8b6f27b?lnk=st&q=tlunsfo
    > > rd&rnum=1&hl=en

    >
    > Are you replying on something I wrote?
    >
    > [please always quote on usenet]
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)


    Evertjan,

    Ok, enough already. EXCUUUUSSSEEE ME for breaking the "rules". I
    looked at your last twenty or so posts (Google Groups is very handy
    for such things, as well as for viewing an entire entire thread), and
    in most cases you provide little-to-no useful information. Your
    efforts at policing the newsgroups are actually producing more noise
    than you're preventing. You seem to know a thing or two about a thing
    or two, but enough with the policing already. You may be the greatest
    person around, but take a look at your posting history and try to
    think objectively about how the type of person who seems to be behind
    those posts.

    Don't make me type your email address here without the x'es... LOL...
    Just kidding... I wouldn't really do that.

    -Thomas
    Thomas Lunsford, May 17, 2007
    #13
  13. Thomas  Lunsford

    Evertjan. Guest

    Thomas Lunsford wrote on 17 mei 2007 in
    microsoft.public.inetserver.asp.general:

    > On May 16, 2:59 pm, "Evertjan." <> wrote:
    >> Thomas Lunsford wrote on 16 mei 2007 in


    >> [please always quote on usenet]


    > Ok, enough already. EXCUUUUSSSEEE ME for breaking the "rules".


    Excuse accepted. You seem to have learned from it.

    > I
    > looked at your last twenty or so posts (Google Groups is very handy
    > for such things, as well as for viewing an entire entire thread), and
    > in most cases you provide little-to-no useful information.


    So you think usenet is for providing useful information?

    That is what I think too, but that is not in itself the goal of usenet,
    as I read it in the Netiquette.

    The "rule" [your word] of quoting is in netiquette and is an important
    one helping people to quickly and easily understand what you are
    responding to. I hope you have learned from it.

    > Your
    > efforts at policing the newsgroups are actually producing more noise
    > than you're preventing.


    It could be youe meaning, not mine. But that could be because you are
    easily annoyed if someone shows you your mistake publicly.

    > You seem to know a thing or two about a thing
    > or two, but enough with the policing already.


    > You may be the greatest person around,


    If you say so, not my words or idea. To be such is not my goal in
    cyberlife. Perhaps it is yours?

    > but take a look at your posting history and try to
    > think objectively about how the type of person who seems to be behind
    > those posts.


    Why would I? I really don't think that is very useful, unless one thinks
    a person should leave his principles behind and just act to be liked.

    > Don't make me type your email address here without the x'es... LOL...
    > Just kidding... I wouldn't really do that.


    I am glad you don't.

    Giving the possibility to be privately emailed seems polite to me,
    as I have done for the last 12+ years on usenet.

    I am glad you practice the same principle, Thomas.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 17, 2007
    #14
  14. "Thomas Lunsford" <> wrote in message
    news:...
    > On May 16, 2:24 pm, "Bob Barrows [MVP]" <>
    > wrote:
    > > Bob Barrows [MVP] wrote:
    > > > Thomas Lunsford wrote:
    > > >> The following link is a newsgroup posting from a Microsoft
    > > >> employee...

    > >
    > > http://groups.google.com/group/microsoft.public.xml.msxml-webrelease/...
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > > >> Our production environment is hallowed ground, so I'm leery of taking
    > > >> chances, especially after reading the posting in the above link. I
    > > >> have not yet found a good explanation of all the repercussions of
    > > >> Isolated Application Protection in IIS, so that spooks me a bit.

    > >
    > > >> I would like to know whether using ServerXMLHTTP is common practice
    > > >> and whether it has other known limitations/problems. I'm still
    > > >> learning and researching.

    > >
    > > >> Any information you can provide is greatly appreciated.

    > >
    > > > Ah! Now I remember that.
    > > > I did not realize you were posting back to the same server.

    > >
    > > > There are no repercussions outside of extra resource use to using
    > > > Isolated Application Protection that i am aware of.

    > >
    > > > That post was written back in 2001 so this may no longer be an issue
    > > > for IIS6. I will run it by my fellow mvps.

    > >
    > > No replies to my queries as yet. However, I do want to point out that
    > > the version of ServerXMLHTTP in that article was 4.0. Version 6 of the
    > > MSXML Parser is the current version. Unfortunately, I do not know if the
    > > new version corrects the problem pointed out in that article. I'm not
    > > even certain whom I could ask, given the .Net emphasis these days.
    > >
    > > --
    > > Microsoft MVP -- ASP/ASP.NET
    > > Please reply to the newsgroup. The email account listed in my From
    > > header is my spam trap, so I don't check it very often. You will get a
    > > quicker response by posting to the newsgroup.- Hide quoted text -
    > >
    > > - Show quoted text -

    >
    > Bob,
    >
    > Thank you very much for your help. Having done more research and not
    > finding and significant issues myself, I am proceeding with using
    > ServerXMLHTTP. If you do happen to find out additional info, please
    > update the thread. I will do the same if this turns out badly. :)
    >
    > -Thomas
    >


    I don't think there have been any significant changes in the way WinHTTP /
    IIS works to make the danger of deadlocks go away allthough IIS6 does
    contain a means to kill a dead process. The fundemental problem will be
    that a worker thread in the process will be waiting for a request to
    complete that requires the use of another worker thread in the process.

    You could use a test machine to reproduce it. Set AspProcessorThreadMax to
    2. Have Page1.asp do something that takes a few seconds to complete
    (preferable not too CPU intensive, I use a small VB6 dll that exposes the
    sleep API) then makes a ServerXMLHTTP (or WinHTTP) request to Page2.asp.
    What page2.asp does doesn't really matter.

    Now fireup a couple of browser instances (don't use tabs in the same
    browser) and in each in quick succession visit page1.asp. If you have a
    dual processor machine you may need 4 (or even 8 if you have a monster).

    Now, if the deadlock problem remains, what will happen is that the page1
    executions will be occupying all the available worker threads by the time
    each of them make a request to page2. All requests to page2 will queue
    waiting for a worker thread to become available, however, none ever do
    because they all busy waiting for these queued requests to complete.


    There is also another deadlock situation relevant to what you are trying to
    do if the application makes use of session variables. In order make the
    original form target believe that the request is coming from an existing
    session the ASPSESSIONxxxxxx cookie will need to be copied from the original
    request to the WinHTTP one.

    Unfortunately that will imeadiately deadlock no matter how many worker
    threads are available. The problem is that the Session object single
    threaded. Since the current thread making the request all ready has the
    session object the request is queued waiting for the current thread to
    release it, however, that won't happen until the queued request is
    completed. Deadlock.

    Hence if the form target page uses the session object this approach is
    doomed.


    I think you may need to reconsider the 'untouchable' status of the existing
    page.
    Anthony Jones, May 18, 2007
    #15
  15. Thomas Lunsford wrote:
    >>>> Our production environment is hallowed ground, so I'm leery of
    >>>> taking chances, especially after reading the posting in the above
    >>>> link. I have not yet found a good explanation of all the
    >>>> repercussions of Isolated Application Protection in IIS, so that
    >>>> spooks me a bit.

    >>
    >>>> I would like to know whether using ServerXMLHTTP is common practice
    >>>> and whether it has other known limitations/problems. I'm still
    >>>> learning and researching.

    >>
    >>>> Any information you can provide is greatly appreciated.

    >>
    >>> Ah! Now I remember that.
    >>> I did not realize you were posting back to the same server.

    >>
    >>> There are no repercussions outside of extra resource use to using
    >>> Isolated Application Protection that i am aware of.

    >>

    > Thank you very much for your help. Having done more research and not
    > finding and significant issues myself, I am proceeding with using
    > ServerXMLHTTP. If you do happen to find out additional info, please
    > update the thread. I will do the same if this turns out badly. :)
    >

    Just had a response from Carl Daniels, a fellow MVP:
    **************************
    I can't say absolutely for certain, but I wouldn't expect the situation to
    have changed in IIS6, since it's not really an IIS bug, nor is it really a
    ServerXMLHTTP bug. Rather, it's a natural consequence of thread starvation
    in the IIS worker thread pool. As long as the target application and the
    requesting application are served by different processes ("high" isolalation
    or different app pools) there shouldn't be a problem.
    **************************
    Definitely look into assigning separate app pools to each application
    involved. This will remove the requirement for "high" isolation.

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], May 19, 2007
    #16
  16. "Bob Barrows [MVP]" <> wrote in message
    news:...
    > Thomas Lunsford wrote:
    > >>>> Our production environment is hallowed ground, so I'm leery of
    > >>>> taking chances, especially after reading the posting in the above
    > >>>> link. I have not yet found a good explanation of all the
    > >>>> repercussions of Isolated Application Protection in IIS, so that
    > >>>> spooks me a bit.
    > >>
    > >>>> I would like to know whether using ServerXMLHTTP is common practice
    > >>>> and whether it has other known limitations/problems. I'm still
    > >>>> learning and researching.
    > >>
    > >>>> Any information you can provide is greatly appreciated.
    > >>
    > >>> Ah! Now I remember that.
    > >>> I did not realize you were posting back to the same server.
    > >>
    > >>> There are no repercussions outside of extra resource use to using
    > >>> Isolated Application Protection that i am aware of.
    > >>

    > > Thank you very much for your help. Having done more research and not
    > > finding and significant issues myself, I am proceeding with using
    > > ServerXMLHTTP. If you do happen to find out additional info, please
    > > update the thread. I will do the same if this turns out badly. :)
    > >

    > Just had a response from Carl Daniels, a fellow MVP:
    > **************************
    > I can't say absolutely for certain, but I wouldn't expect the situation to
    > have changed in IIS6, since it's not really an IIS bug, nor is it really a
    > ServerXMLHTTP bug. Rather, it's a natural consequence of thread

    starvation
    > in the IIS worker thread pool. As long as the target application and the
    > requesting application are served by different processes ("high"

    isolalation
    > or different app pools) there shouldn't be a problem.
    > **************************
    > Definitely look into assigning separate app pools to each application
    > involved. This will remove the requirement for "high" isolation.
    >


    Using a separate app pool is the same as "high" isolation, its just that the
    former is a IIS6 concept where the latter is IIS5 concept. They deliver
    somewhat similar advantages but with app pools being more flexable.

    Thomas hasn't actually specified the version of IIS involved, if 5 then
    "high" isolation mat still be necessary to avoid the chance of a dead lock.
    Assuming he wishes to pursue this approach at all now.

    Problem with having two separate apps may be that the two parts of this
    problem may need to share session info.
    Anthony Jones, May 19, 2007
    #17
  17. Gazing into my crystal ball I observed Thomas Lunsford
    <> writing in news:1179382158.487771.220030
    @q75g2000hsh.googlegroups.com:

    > EXCUUUUSSSEEE ME for breaking the "rules". I
    > looked at your last twenty or so posts (Google Groups is very handy
    > for such things, as well as for viewing an entire entire thread)


    The problem is that a lot of people use newsreaders and get their news from
    news servers, not Google. Those servers may only keep a message for a
    short amount of time, so the preceding message(s) may be gone by the time
    someone else is reading the response.

    If you already have your newsreader open, why would you want to open a
    browser as well to Google something?

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, May 20, 2007
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mythran
    Replies:
    2
    Views:
    497
    Mythran
    Jan 22, 2005
  2. Thor
    Replies:
    1
    Views:
    1,001
    Mikkel Heisterberg
    Jul 2, 2003
  3. Replies:
    0
    Views:
    428
  4. Replies:
    1
    Views:
    6,263
  5. Keithb
    Replies:
    1
    Views:
    803
    bruce barker
    Feb 26, 2007
Loading...

Share This Page