Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am getting an error on my pages


XML Parsing Error: no element found
Location: http://localhost:22888/UpdateConfig.aspx
Line Number 1, Column 1:
^

What I have tried:

C#
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Configuration;

namespace Test
{
    public partial class UpdateConfig : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            try
            {
                
            }
            catch (Exception ex)
            {
                Response.Write("Exception: " + ex.Message);
            } 
        }
    }
}
Posted
Updated 29-Mar-23 0:04am
v4
Comments
VR Karthikeyan 7-Jun-16 7:23am    
Unclear question. Provide some more information, show some code of what you have tried. Just improve your question.
ZurdoDev 7-Jun-16 15:43pm    
You got an error about the aspx page but posted the aspx.cs code.

By some weird reason, you .aspx is not well-formed. Please check it up. Try to compile your ASP.NET solution with this file; it it's fine, check up that it is deployed correctly (most likely, it is, because you probably work with the HTTP server embedded in Visual Studio, in this case, you have exact same files an in the project).

Also, for a simple checkup, you can rename your .aspx file to .xml and test with any Web browser; it will show you the wrong point in the file.

—SA
 
Share this answer
 
just put Application_error tag in Global.asax


protected void Application_Error(object sender, EventArgs e)
{

}



No need to add any error handling code inside
 
Share this answer
 
Comments
ZurdoDev 7-Jun-16 15:21pm    
The error was about UpdateConfig.aspx. Is there some reason to think global.asax is the problem?
Member 8513598 6-Jun-17 6:18am    
m
I think you added  <httpErrors errorMode="Custom" existingResponse="PassThrough"/>
in <system.webserver> (web.config).
Please remove this for a while so that you can see the actual error.
After you get error you can search for actual error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900