Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Parsing Error: no element found

Status
Not open for further replies.

ChristianWhite

Programmer
Jun 14, 2004
41
0
0
US
I'm revisiting an old application of mine--a comments page that sends an email--for an edit. But before I can do that, I'm trying to get it to run properly. I'm seeing an error I don't remember seeing during its development.

On trying to run the app for the first time since development, I saw this error:

XML Parsing Error: no element found
Location: Line Number 1, Column 1:
^


I proceeded to pare down elements of the page and run the app looking for the troublemaker.

When I open a new instance of Visual Studio 2005, I am able to watch the app progress through the breakpoints, send the email, and redirect to the "Thank You" htm page. But after closing the browser and kicking off a second runtime--or after clicking Back and trying another submit--I immediately see the above error, instead of my entry page, upon starting all subsequent runtimes until I restart Visual Studio 2005.


The pared-down body of the page looks like this :

<body>

<form id="frmContact" name="frmContact" method="post" runat="server" >

<asp:button id="Submit1" OnClick="Submit1_Click" Text="Submit" runat="server" />
</p>
</form>


</body>



The codebehind feeds the entry to an emailer class sending email to the party i created the page for--roughly along the lines of

string strMessage = Request.Form["message"];

c

Emailer Em = new Emailer();

Em.SendEmail(strMessage);



Really baffling...feel like I'm trying to nail Jell-O (TM) to a tree: Runs OK on initial runtime, then croaks on the next. Insight appreciated.
 
Oops--that line that says "c" above is supposed to say


HttpContext.Current.Response.End();
HttpContext.Current.Response.Expires = 0;
 
OK, think I eliminated the cause.

I had stripped down the project even further, and noted an exception thrown "File does not exist." Again, I had never seen that issue in the app before.

The issue stopped when I noted the project server was set to the built-in Visual Studio server, rather than IIS which is standard in our shop. I guess it wasn't finding the "element" it was looking for because it wasn't starting in the right directory. I still don't know why it ran intermittently.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top