web form returning text/plain ?

  • Thread starter Thread starter greg
  • Start date Start date
G

greg

I put the following code in Page_Load:

private void Page_Load(object sender, System.EventArgs e)

{

String res = "1";

Response.ContentType = "text/plain";

Response.Write(res);

Response.End();

}

But for some reason it tries to download aspx file ITSELF!!!!!!!!!!!!!!!!!!

What am I doing wrong!!!!!!!!!!!!!!!

Thanks,

GSL
 
Why do you need the response type set to plain text?

Remove that line and run the page again.
 
Hi Greg,

I think the mapping of ASP.NET with IIS is corrupted hence the reason you
are getting an option of downloading the aspx file when you access it.
[IIS is not able to recongnise the aspx page]

All you need to do is go to VS.NET command prompt and type
aspnet_regiis.exe -i

That's it.

Hope this helps you.

Thanks
Raghavendra
 
Back
Top