Home Page is not open in browser - asp.net

Create Default.aspx in the asp.net;
And open folder in windows.
Right-Click on Default.aspx then OpenWidth and click on the Internet Explorer.
when Opend. view:
"
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:///G:/My Programming/Asp/My Project (90)/Defa...
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
-^
"

.aspx page are ASP.NET server side pages means they get rendered on the Server and return result back to webbrowser
So you cannot call them by directory path you will need to host them on a webserver and then call them by the wepath e.g. localhost/test.aspx
Please read the walkthrough it will give information on everything you need for ASPX http://msdn.microsoft.com/en-us/library/1y1404zt(v=vs.90).aspx

Related

XML Parsing Error: not well-formed ASP.NET

I Published a website using VS2012, ASP.NET C#, the publish succeeds however, when i open the .ASPX file, this shows ups:
XML Parsing Error: not well-formed
Location: file:///E:/Test/Default.aspx
Line Number 1, Column 2:
<%# page language="C#" autoeventwireup="true" inherits="_Default, App_Web_bf0k3pjd" maintainScrollPositionOnPostBack="true" %>
-^
any idea?
The file location should give a hint. That's a location on the file system and not being passed through a web server. When you view it using file:// then the browser simply displays the contents. The #Page directive in the first line doesn't conform to XML/XHTML/HTML standards so it throws this error. The browser knows nothing about the #Page or anything else in the page except the bits that are HTML. It will still attempt to display all the content, but it really doesn't know what to do with it other than view it as a plain html page. If you run this through an actual web server you shouldn't see this error and the page should be processed properly.

Where to find the codebehind?

I'm new to ASP, just inherited a database application. I'm having trouble with probably the most basic thing... how the file structures are set up.
I've confirmed I've found the right .aspx file of the page I'm working on, but it's just the template. I am looking for the code that is behind that file.
The page starts with:
<%# Page Title="" Language="C#" MasterPageFile="~/print.Master" AutoEventWireup="true"
CodeBehind="Servicecallreport.aspx.cs" Inherits="CrisisSupportApp.Secure.Reports.BriefSummaryReport" %>
I've done a search for "Servicecallreport.aspx.cs" and "CrisisSupportApp.Secure.Reports.BriefSummaryReport" on the server and I get nothing.
Where should I be looking for these .asp.cs files?
Look for a version control system like git, subversion, or TFS. The code is likely in there. ASP.Net does not need to deploy those code files to the web server at all, but instead allows you to pre-compile them.
try:
(what ever your root is)\CrisisSupportApp\Secure\Reports\BriefSummaryReport.cs

Error: "The file '/MasterPages/MainMaster.master' does not exist." (Yes, this file does exist!)

I just got a new desktop computer with Windows 7 Pro as the operating system. I installed Visual Studio 2008 on to this new computer and tried to open a previously existing ASP.NET 3.5 solution that displayed perfectly fine on my previous computer (this previous computer used the Windows XP operating system, IIS6, and IE7 browser). However, in Windows7/IE8, I’m receiving the following error:
Server Error in '/' Application.
Parser Error Description: An error
occurred during the parsing of a
resource required to service this
request. Please review the following
specific parse error details and
modify your source file appropriately.
Parser Error Message: The file
'/MasterPages/MainMaster.master' does not exist.
Source Error:
Line 1: <%# Page Language="C#"
AutoEventWireup="true"
CodeFile="default.aspx.cs"
Inherits="_Default"
MasterPageFile="~/MasterPages/MainMaster.master"%>
Line 2:
Line 3: <%# Register TagPrefix="SBLContent" TagName="SBLContentBlock"
Src="usercontrols/content.ascx"%>
Source File: /SBLWebSite/default.aspx
Line: 1
Version Information: Microsoft .NET
Framework Version:2.0.50727.4952;
ASP.NET Version:2.0.50727.4927
Please believe me when I tell you that the file ‘/MasterPages/MainMaster.master’ file does, in fact, exist.
In addition, this file’s location is properly referenced in the code (as indicated in Line 1 above), and as I said, was displayed properly by the browser in my previous computer. It might also be helpful to note that I’ve tried to navigate to other pages in this site, and this browser displays the same message for any and all master pages located in my MasterPages folder.
In summary, for some reason the browser cannot see any pages in the MasterPages folder. Can anybody tell me why I’m getting this error message when the folder and file is exactly where default.aspx says it is?
Thanks in advance!
I appreciate your response.
However, this issue turned out to be an IIS7 issue. The error message I described arose out of the distinction made in IIS7 between a "virtual directory" and an "application" (I don't know if such a distinction existed in IIS6). To fix this error, I opened IIS7, right-clicked on the virtual directory folder for this site, and selected "Convert to Application." I then refreshed the browser, and the error went away.
Sigh.
Two things to check:
When using "~" in a file path, make sure that the current application deployment believes the root directory is the same as it was before. (I've run into this sometimes moving an app from the VS Development Server and IIS.)
Make sure that the user account that the server is running under has permissions to access that directory. Since you just moved the code over from another computer and probably some intermediate storage devices, the security permissions may not be right.
the error comes on the web form like this
<%# Page Title="" Language="vb" AutoEventWireup="false"
MasterPageFile="~/Site1.Master" CodeBehind="add_drivers.aspx.vb"
Inherits="au_transport.WebForm1" %>
correction
<%# Page Title="" Language="vb" AutoEventWireup="false"
MasterPageFile="Site1.Master" CodeBehind="add_drivers.aspx.vb"
Inherits="au_transport.WebForm1" %>
Instead of the "~" I was able to simply change the directory to a relative ".." So, what I originally had that gave me the problem was something like: "~/MasterPage/TheMainMasterPage.master" and this caused me to get the same error message. Changing it to "../MasterPage/TheMainMasterPage.master" fixed everything for me.
I recently had to move my websites from one server(32 bit) to another server(64 bit). On the new server I experienced the file not found error "Parser Error Message: The file '~/Master.master' does not exist"
NB: some of my applications were built for x86, you still need to convert your website to an application :-)
Solution:
In IIS8, click Application Pool -> select an app pool eg DefaultAppPool -> click 'Advanced Settings' -> Under the 'General' section set 'Enable 32-Bit Applications' to 'True' -> Click OK
Refresh your website/webservice and that should do the trick
previous code:-
<%# Page Title="" Language="C#" MasterPageFile="~/admin.Master" AutoEventWireup="true" CodeBehind="outgoingform.aspx.cs" Inherits="OCS.outgoingform" %>
after code changed:-
<%# Page Title="" Language="C#" MasterPageFile="../ocs/admin.Master" AutoEventWireup="true" CodeBehind="outgoingform.aspx.cs" Inherits="OCS.outgoingform" %>
change the code from everywhere from "~/admin.Master" to "~/ocs/admin.Master"
previous code:-
after code changed:-
change the code from everywhere from "~/admin.Master" to "~/ocs/admin.Master"
OK, so this is old and it is 2021 but, the path for your mater page has ~/site name/MasterPage.master or similar.
What I did to fix and because I uploaded to the server all in same directory, remove this ~/site name/ leave the name of the master page IE: MasterPage.master and all is well. make sure master page in same directory as other pages. Done.
What I had after edit...
<%# Page Title="" Language="VB" MasterPageFile="MasterPage.master"
do this for all pages
no site name or ~/ etc. What a pain but once you realize it is just a directory issue which in retrospect should have been obvious from the start.. all better now. Site up.

ASP.NET Master Page frameworkName: Value cannot be null error

I'm going over some ASP.NET tutorials and the first one I'm looking at is how to make a Master Page. When I do create a master page, I get an error:
Value cannot be null. Parameter name: frameworkName
It occurs in the first line of my master page (MasterPage.master) and it's the default page that gets created- I haven't modified it at all:
<%# Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
Could somebody tell me what is the frameworkName parameter and how can I get rid of this error? FYI: I'm using Visual Studio 2010.
This is a bug in VS 2010:
The reason you are seeing this error is that there are assembly references in the xaml which you are failing to resolve. There is a startpage.csproj in the same directory as the .xaml file. Please copy both to the new folder and open the project file in VS 2010. This should work.
http://connect.microsoft.com/VisualStudio/feedback/details/485162/edit-startpage-xaml-frameworkname-value-cannot-be-null
Here is master file that I currently have, so I would check for missing assemblies?:
<%# Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>
Can you also recreate the solution and import into the new .sln file ?
I encountered this problem when I converted a file based asp.net web application to an IIS website. After several minutes of trying to see what was wrong, I decided to close and reopen this solution and that solved it.

ASP.NET XML parsing error only on FireFox

I get this wired error only when I try to access the web page in FireFox.. IE works just fine..
XML Parsing Error: not well-formed
Location: http://localhost/site/Home.aspx
Line Number 1, Column 2:<%# Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs"
Am I missing something?
You seem to be accessing the page from the file system directly. Check the URLs in the address bar.
Not the right answer.. but upgraded to FF 3.6 and it works just fine..

Resources