error Cannot view XML input using style sheet.

I create a new website in asp.net 2.0 with one page containing a label.
I created a virtual directory for it in my comuter in inetpub\wwwroot.
I publish the website to that location and when I browse the default page I get the followinf error:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'http://localhost/test2/Default.aspx'. Line 1, Positio...

This is a marker file generated by the precompilation tool, and should not be deleted!
^

What is the problem here?
Please help!!!
ANAT2403Asked:
Who is Participating?
 
Geert BormansInformation ArchitectCommented:
> The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access

well, I have seen this before, but I am not sure what the resolution was.
The ASP runs as the Network Service, so you have to set write permissions for the Network Service on this temp folder
You would expect the installer to do this automatically.
Likely this happened correctly, but general system group permissions might have altered this on reapplying

Try to set this manually
if it goes wrong again after some time, you need to look at your general rules

if this doesn't get resolved with this simple explanation,
it might be wise to post a question in the ASP or the .net TA

cheers
0
 
Geert BormansInformation ArchitectCommented:
Hi ANAT2403,

It seems that you are giving a text file a text/xml mimetype
The browser assumes he is getting an XML file,
but what he gets is a text line
He is waiting for the XML declaration or a root XML tag

maybe your default is pointing to the wrong file,
or the XML you create isn't XML at all

Cheers!
0
 
ANAT2403Author Commented:
I repeat again:
I create a new website, add a new item default2.aspx and in it put a label.
That's it. I don't have any xml files. then I build the wesite and publish the the website to my computer
in Inetpub\wwwroot to a new folder I created and made it to be a virtual directory.
(this is all for testing before I do it with my real website).
Then in the explorer I write:
http://localhost/test2/default.aspx.
That's it I don't have any xml file. maybe the dot net create something.
I have the feeling that the problem is in the properties of the explorer but I don't know. Anyhow
I spend a lot of time on this . Do you know what is the problem?
Thankyou
Anat
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
Geert BormansInformation ArchitectCommented:
I repeat again:
It seems that you are giving a text file a text/xml mimetype

it could be that this index page has a mime-type XML.
That is the setting you should be looking for
0
 
ANAT2403Author Commented:
Hi Gertone,
Sorry if I was a bit rude with the repeat but the thing is I just take the standart page without changing anything.
where is the mime-type  setting is given? I don't even know what it is?
Hope you can help me.
This is my page while the first 3 lines are given automatically. Is ther something I have to change there?
This is the first time I try to publish something.

%@ Page Language="C#" AutoEventWireup="true" CodeFile="def2.aspx.cs" Inherits="def2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Font-Size="XX-Large" Height="59px" Style="z-index: 100;
            left: 322px; position: absolute; top: 95px" Text="this is a test " Width="164px"></asp:Label>
   
    </div>
    </form>
</body>
</html>

Thanks
Anat
0
 
Geert BormansInformation ArchitectCommented:
%@ Page Language

I assume you dropped the "<" in copying the page
it should be "<%@ Page Language..." if that is not the case

you can try to set this page to single-file page model for a start

<%@ Page Language="C#" %>

I don't think you are using the CodeFiles yet

then you could set the ContentType in this header, like this
ContentType="text/html"

so your first line should be
<%@ Page ContentType="text/html" Language="C#" %>

hope this helps
cheers


0
 
ANAT2403Author Commented:
Hi Gertone,
I finally solve the problem in my compuer by the commands:
aspnet_regiis  -u  and then  aspnet_regiis -i. so I didn't need the text/html.
But now I have problems in running in the server.
I get the error :

The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'

In the users of the server do I have to have a user named ASPNET? because I don't have one. Is this the problem?
And if it is do I have to insert it myself or it has to be entered automatically?
Thanks
Anat
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.