Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

error Cannot view XML input using style sheet.

Posted on 2006-05-01
7
Medium Priority
?
1,242 Views
Last Modified: 2013-11-19
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!!!
0
Comment
Question by:ANAT2403
  • 4
  • 3
7 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 16576585
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
 

Author Comment

by:ANAT2403
ID: 16577385
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
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 16577468
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:ANAT2403
ID: 16577734
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
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 16578119
%@ 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
 

Author Comment

by:ANAT2403
ID: 16578223
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
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1000 total points
ID: 16578825
> 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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question