Jump to content

can not open xml inputs in xsl stylesheets


eng.mohamed_elqpany

Recommended Posts

hi every body,this is the first thread for me in your forums and i hope i find help and i hope to be able to help you later.My problem is that i'm working on a project somebody started it before me. and i just try to fix it. My problem now is that i'm tring to access a mdb database i build my page using asp.net with c# so the extention is .aspx and i just pass the prameters to this page from a .htm page using this small script

<script type="text/javascript" language="JavaScript">function Redirect(mail,status){ if(mail=="")   alert("mail is not in valid format")  else  location.href = 'as.aspx?Email=' + mail + '&status=' + status}</script>

when i'm running it from visual studio it works, but when tring to run it with IE i got this error:**********The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. --------------------------------------------------------------------------------A name was started with an invalid character. Error processing resource 'file:///C:/Documents and Settings/Admin/Desktop/Mo...<%@ Page Language="C#" AutoEventWireup="true" CodeFile="aa.aspx.cs" Inherits="aa" %>-^**********and when i tried to run it on a network with virtual directory i got this error****Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. ****i just need your help but as quick as you can please.with regards..

Link to comment
Share on other sites

So where exactly is

<script type="text/javascript" language="JavaScript">function Redirect(mail,status){if(mail=="")   alert("mail is not in valid format") else  location.href = 'as.aspx?Email=' + mail + '&status=' + status}</script>

this located?In the same ASP.NET file that is using the C# class or whatever? If so, then the reason for the error in IE is that the ASP file is read literally. When you launch an ASP (or any other server scripting) file, the server does the things in the file and returns an output. When you just run the code from your computer as you have (the "'file:///C:..." is what gives that out) there are no transformations done. IE expects to find plain XML file (in which a start like "<%" is truly illegal), not an ASP page.Install IIS on your computer and run that file from it. I mean, there's no way this will work without some sort of compiler, be it a server like IIS or VS.

Link to comment
Share on other sites

O...k... so exactly does the source of the output page (the one giving the error) looks like?

Link to comment
Share on other sites

Blank? As in "no source code at all"? a file looking like this:?Then where could IE invent the "<%@ Page Language="C#" AutoEventWireup="true" CodeFile="aa.aspx.cs" Inherits="aa" %>" thing? Or does the ASP itself have some sort of error, that forces a blank output.

Link to comment
Share on other sites

sorry there are missunderstanding it's just a default page.this the code :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ad.aspx.cs" Inherits="ad" %><!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>		</div>	</form></body></html>

thanx for ur response and i hope you answer me again to find a solution...

Link to comment
Share on other sites

What you're showing me is the source of an ASP.NET page. The source of the file BEFORE being processed by IIS.If you're trying to run this file without IIS, the error is obvious and predictable and what you need is to process this page over IIS.If you DO run it with IIS, then the question is what the source code of the page is AFTER processing. For example, if ad.aspx.cs returned nothing, the output of the file should be:

<!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>		</div>	</form></body></html>

Which should render fine. True, it won't show nothing, as it doesn't have anything visible in it, but you'll at least see "Untitled Page" in the title bar and a blank screen, instead of an error.If the output source code is the same as the ASP.NET source, then for some reason, your IIS server is not processing *.aspx files, resulting in the error.

Link to comment
Share on other sites

the page.aspx.cs code is jsut like that.

using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class Admin_news : System.Web.UI.Page{	protected void Page_Load(object sender, EventArgs e)	{	}	}

and when i run it from .net it works fine but when trying to call this page from another html page it gives me this error.thanx for your response.

Link to comment
Share on other sites

You are just not allowed to call this page from an ordinary HTML page. I mean... you just can't. Forget it. Apparently, that page is made in a way that requres it to be called from .NET in order to be processed.

Link to comment
Share on other sites

so what will hapen when i publish it? will it work fine?..
It should work perfectly fine if that server supports ASP.NET as well as everything that might be needed to run this ASP.NET script. If not- it won't work.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...