how do i find .where from the request is coming


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: how do i find .where from the request is coming

  1. #1
    Ghanta Sunil Krishna Guest

    how do i find .where from the request is coming


    hi,
    i am sunil,working as a Software programmer. Well i do have a question
    for u. Consider this scenario.

    Step 1:
    I have a asp page which queries the database using ADO 2.5 to retrieve the
    data.

    Example:-rs.open "select statement"

    Step 2:
    Suppose the request came from a pc then i wanna apply one style sheet(XSL)
    or else if the request came from a mobile phone i should apply another style
    sheet.That is done like this:

    If Pc then
    response.write PC.xsl
    else if mobile phone then
    response.write mobile.xsl
    end if

    Step 3:
    Then i save my recordset to response object.

    Example:-rs.save response,adpersistxml


    This is fine .But in Step2 how do i find out where the request came from
    so that i can apply different style sheets to my xml content.

  2. #2
    Joar Vatnaland Guest

    Re: how do i find .where from the request is coming


    This is not my field, but I had a look since the question is interesting.
    I would GUESS that Request.ServerVariables("SERVER_PROTOCOL") would be different
    if the request was coming from a mobile phone - possibly it would be WML/1.0
    or something else. I hope this can get you in the right direction.



    "Ghanta Sunil Krishna" <ghantasunil@usa.net> wrote:
    >
    >hi,
    > i am sunil,working as a Software programmer. Well i do have a question
    >for u. Consider this scenario.
    >
    >Step 1:
    > I have a asp page which queries the database using ADO 2.5 to retrieve

    the
    >data.
    >
    > Example:-rs.open "select statement"
    >
    >Step 2:
    > Suppose the request came from a pc then i wanna apply one style sheet(XSL)
    >or else if the request came from a mobile phone i should apply another

    style
    >sheet.That is done like this:
    >
    > If Pc then
    > response.write PC.xsl
    > else if mobile phone then
    > response.write mobile.xsl
    > end if
    >
    >Step 3:
    > Then i save my recordset to response object.
    >
    > Example:-rs.save response,adpersistxml
    >
    >
    >This is fine .But in Step2 how do i find out where the request came from
    >so that i can apply different style sheets to my xml content.



  3. #3
    Joar Vatnaland Guest

    Re: how do i find .where from the request is coming


    See also this link, that seems to relate to this subject - particularly the
    ASP code at the end of the page:

    http://allnetdevices.com/faq/?pair=04.006


    "Ghanta Sunil Krishna" <ghantasunil@usa.net> wrote:
    >
    >hi,
    > i am sunil,working as a Software programmer. Well i do have a question
    >for u. Consider this scenario.
    >
    >Step 1:
    > I have a asp page which queries the database using ADO 2.5 to retrieve

    the
    >data.
    >
    > Example:-rs.open "select statement"
    >
    >Step 2:
    > Suppose the request came from a pc then i wanna apply one style sheet(XSL)
    >or else if the request came from a mobile phone i should apply another

    style
    >sheet.That is done like this:
    >
    > If Pc then
    > response.write PC.xsl
    > else if mobile phone then
    > response.write mobile.xsl
    > end if
    >
    >Step 3:
    > Then i save my recordset to response object.
    >
    > Example:-rs.save response,adpersistxml
    >
    >
    >This is fine .But in Step2 how do i find out where the request came from
    >so that i can apply different style sheets to my xml content.



  4. #4
    Russell Jones Guest

    Re: how do i find .where from the request is coming

    Use the Request.ServerVariables collection to find information about the
    requestor. For example, the combination of the
    Request.ServerVariables("SERVER_SOFTWARE") or
    Request.ServerVariables("HTTP_USER_AGENT") values probably contains what you
    need.

    "Ghanta Sunil Krishna" <ghantasunil@usa.net> wrote in message
    news:3a41d1d4$1@news.devx.com...
    >
    > hi,
    > i am sunil,working as a Software programmer. Well i do have a question
    > for u. Consider this scenario.
    >
    > Step 1:
    > I have a asp page which queries the database using ADO 2.5 to retrieve the
    > data.
    >
    > Example:-rs.open "select statement"
    >
    > Step 2:
    > Suppose the request came from a pc then i wanna apply one style sheet(XSL)
    > or else if the request came from a mobile phone i should apply another

    style
    > sheet.That is done like this:
    >
    > If Pc then
    > response.write PC.xsl
    > else if mobile phone then
    > response.write mobile.xsl
    > end if
    >
    > Step 3:
    > Then i save my recordset to response object.
    >
    > Example:-rs.save response,adpersistxml
    >
    >
    > This is fine .But in Step2 how do i find out where the request came from
    > so that i can apply different style sheets to my xml content.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center