Re: How to write a GUI-less page

Discussion in 'ASP .Net' started by Jerry III, Aug 22, 2003.

  1. Jerry III

    Jerry III Guest

    You are not sending any response body so you should not see anything at all,
    that's the expected result. The fact that one configuration shows something
    is probably because you have customErrors turned off in that configuration.

    Jerry

    "Alek Davis" <alek_DOT_davis_AT_intel_DOT_com> wrote in message
    news:...
    > Hi,
    >
    > I need to implement a health check page as part of a Web site. This page

    is
    > supposed to be invoked programmatically from a script and it does not need
    > any GUI. When the script attempts to access the page, it is supposed to
    > query the HTTP status code (e.g. 200, 500, etc), to determine whether the
    > operation was successful or not. So how can I programmatically make the

    ASPX
    > return a status code without generating any HTML output? I tried this:
    >
    > (1) Set EnableViewState="false" EnableViewStateMac="false" in the @Page
    > directive of the ASPX
    > (2) Set Response.StatusCode to the appropriate status code, e.g. 500 in

    the
    > Page_Load, followed by Response.End.
    >
    > This seems to work on one system (VS.NET 2002 used to build the project +
    > VS.NET 2003 also installed + CLR 1.0 + CLR 1.1), i.e. when an error status
    > code is returned, it is shown in the IE window. When I attempt to do the
    > same on another system (VS.NET 2002 + CLR 1.0), errors are never

    generated,
    > i.e. the browser always displays a blank page irrespective of the returned
    > status code.
    >
    > Am I not doing this correctly? Is there a better way of accomplishing the
    > same?
    >
    > Thanks,
    >
    > Alek
    >
    >
     
    Jerry III, Aug 22, 2003
    #1
    1. Advertising

  2. Jerry III

    Alek Davis Guest

    This is exactly what I expected, but to my surprise on VS.NET 2002 and CLR
    1.0, I always receive a blank HTML page (with empty body). I used the
    identical steps to generate projects on two systems (both using VS.NET
    2002), so I do not expect them to have different customError sections, but I
    will double check this.

    Alek

    "Jerry III" <> wrote in message
    news:ObK7%...
    > You are not sending any response body so you should not see anything at

    all,
    > that's the expected result. The fact that one configuration shows

    something
    > is probably because you have customErrors turned off in that

    configuration.
    >
    > Jerry
    >
    > "Alek Davis" <alek_DOT_davis_AT_intel_DOT_com> wrote in message
    > news:...
    > > Hi,
    > >
    > > I need to implement a health check page as part of a Web site. This page

    > is
    > > supposed to be invoked programmatically from a script and it does not

    need
    > > any GUI. When the script attempts to access the page, it is supposed to
    > > query the HTTP status code (e.g. 200, 500, etc), to determine whether

    the
    > > operation was successful or not. So how can I programmatically make the

    > ASPX
    > > return a status code without generating any HTML output? I tried this:
    > >
    > > (1) Set EnableViewState="false" EnableViewStateMac="false" in the @Page
    > > directive of the ASPX
    > > (2) Set Response.StatusCode to the appropriate status code, e.g. 500 in

    > the
    > > Page_Load, followed by Response.End.
    > >
    > > This seems to work on one system (VS.NET 2002 used to build the project

    +
    > > VS.NET 2003 also installed + CLR 1.0 + CLR 1.1), i.e. when an error

    status
    > > code is returned, it is shown in the IE window. When I attempt to do the
    > > same on another system (VS.NET 2002 + CLR 1.0), errors are never

    > generated,
    > > i.e. the browser always displays a blank page irrespective of the

    returned
    > > status code.
    > >
    > > Am I not doing this correctly? Is there a better way of accomplishing

    the
    > > same?
    > >
    > > Thanks,
    > >
    > > Alek
    > >
    > >

    >
    >
     
    Alek Davis, Aug 22, 2003
    #2
    1. Advertising

  3. Jerry III

    Jerry III Guest

    Oh yeah, it may be a Visual Studio thinking you're not smart enough and
    providing an empty body for you (you did ask it to create a web page after
    all ;) If that is the case you can write your pages in something more
    programmer friendly, I personally write my code in old Visual Studio 6, it's
    effectively a notepad with basic syntax highlighting.

    Jerry

    "Alek Davis" <alek_DOT_davis_AT_intel_DOT_com> wrote in message
    news:...
    > This is exactly what I expected, but to my surprise on VS.NET 2002 and CLR
    > 1.0, I always receive a blank HTML page (with empty body). I used the
    > identical steps to generate projects on two systems (both using VS.NET
    > 2002), so I do not expect them to have different customError sections, but

    I
    > will double check this.
    >
    > Alek
    >
    > "Jerry III" <> wrote in message
    > news:ObK7%...
    > > You are not sending any response body so you should not see anything at

    > all,
    > > that's the expected result. The fact that one configuration shows

    > something
    > > is probably because you have customErrors turned off in that

    > configuration.
    > >
    > > Jerry
    > >
    > > "Alek Davis" <alek_DOT_davis_AT_intel_DOT_com> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > I need to implement a health check page as part of a Web site. This

    page
    > > is
    > > > supposed to be invoked programmatically from a script and it does not

    > need
    > > > any GUI. When the script attempts to access the page, it is supposed

    to
    > > > query the HTTP status code (e.g. 200, 500, etc), to determine whether

    > the
    > > > operation was successful or not. So how can I programmatically make

    the
    > > ASPX
    > > > return a status code without generating any HTML output? I tried this:
    > > >
    > > > (1) Set EnableViewState="false" EnableViewStateMac="false" in the

    @Page
    > > > directive of the ASPX
    > > > (2) Set Response.StatusCode to the appropriate status code, e.g. 500

    in
    > > the
    > > > Page_Load, followed by Response.End.
    > > >
    > > > This seems to work on one system (VS.NET 2002 used to build the

    project
    > +
    > > > VS.NET 2003 also installed + CLR 1.0 + CLR 1.1), i.e. when an error

    > status
    > > > code is returned, it is shown in the IE window. When I attempt to do

    the
    > > > same on another system (VS.NET 2002 + CLR 1.0), errors are never

    > > generated,
    > > > i.e. the browser always displays a blank page irrespective of the

    > returned
    > > > status code.
    > > >
    > > > Am I not doing this correctly? Is there a better way of accomplishing

    > the
    > > > same?
    > > >
    > > > Thanks,
    > > >
    > > > Alek
    > > >
    > > >

    > >
    > >

    >
    >
     
    Jerry III, Aug 22, 2003
    #3
    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. Chris Jackson

    Re: How to write a GUI-less page

    Chris Jackson, Aug 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    398
    Alek Davis
    Aug 21, 2003
  2. Giscard

    Re: How to write a GUI-less page

    Giscard, Aug 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    319
    Alek Davis
    Aug 22, 2003
  3. jiajia wu
    Replies:
    0
    Views:
    378
    jiajia wu
    Oct 1, 2009
  4. 6668
    Replies:
    0
    Views:
    172
  5. lllll
    Replies:
    0
    Views:
    162
    lllll
    Jun 8, 2009
Loading...

Share This Page