web form returning text/plain ?

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
 
S

Scott M.

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

Remove that line and run the page again.
 
R

Raghavendra T V

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top