Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Re: How to write a GUI-less page (http://www.velocityreviews.com/forums/t63065-re-how-to-write-a-gui-less-page.html)

Jerry III 08-22-2003 12:08 AM

Re: How to write a GUI-less page
 
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:OawIjTAaDHA.440@tk2msftngp13.phx.gbl...
> 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 08-22-2003 12:37 AM

Re: How to write a GUI-less page
 
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" <jerryiii@hotmail.com> wrote in message
news:ObK7%23FEaDHA.2572@TK2MSFTNGP09.phx.gbl...
> 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:OawIjTAaDHA.440@tk2msftngp13.phx.gbl...
> > 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 08-22-2003 06:00 AM

Re: How to write a GUI-less page
 
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:u3jdeWEaDHA.2136@TK2MSFTNGP10.phx.gbl...
> 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" <jerryiii@hotmail.com> wrote in message
> news:ObK7%23FEaDHA.2572@TK2MSFTNGP09.phx.gbl...
> > 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:OawIjTAaDHA.440@tk2msftngp13.phx.gbl...
> > > 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
> > >
> > >

> >
> >

>
>





All times are GMT. The time now is 10:04 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.