Microsoft KB Archive/892951

= When the Response.Charset property is set to NULL on an ASP.NET Web page, the source code of the Web page is returned instead of the Response content body if you try to open a form in Office InfoPath =

Article ID: 892951

Article Last Modified on 4/18/2007

-

APPLIES TO


 * Microsoft Office InfoPath 2007
 * Microsoft Office InfoPath 2003
 * Microsoft Office InfoPath 2003, Service Pack 1 (SP1)

-





SYMPTOMS
You visit a Microsoft ASP.NET Web page that contains the Response.Charset property set to NULL. When you try to open a form in Microsoft Office InfoPath 2007 or in Microsoft Office InfoPath 2003 from the Web page, you receive an error message that is similar to the following:

InfoPath cannot open the following file:.

The file is not a valid XML file.

When you click Show Details, you receive an error message that is similar to the following:

The form contains XML that cannot be parsed:

A name was started with an invalid character.

Line 1, Position 2

<%@ Page language=&quot;c#&quot; Codebehind=&quot; &quot; AutoEventWireup=&quot;false&quot; Inherits=&quot;. &quot; %>

-^

Note In this error message,  is the name of the Web form that you are trying to open. is the name of the ASP.NET Web application.

Note In the Show Details box, you notice that this is the source code of the ASP.NET Web page.



CAUSE
This problem occurs when you have read and write permissions to the file on the computer that is running the ASP.NET Web application. Typically, this problem occurs when you have administrator rights or if you are a member of the VS Developers group on the computer that is running the ASP.NET Web application. When you try to open the form in InfoPath, the actual source code of the ASP.NET Web page is returned.

Note Only users who are developing the application will experience this behavior. Users who are not developing the application and are just opening the .aspx page will not experience this behavior.



WORKAROUND
To work around this problem and to load the InfoPath form correctly, you must access the ASP.NET Web application by using an account that does not have read and write permissions to the ASP.NET Web page.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the problem
 Start Microsoft Visual Studio .NET 2003. On the File menu, click New, click Visual C# Projects, and then click ASP.NET Web Application. In the Location box, type InfoPathTest, and then click OK. In the Solution Explorer pane, right-click WebForm1.aspx, and then click View Code.  Add the following Visual C# code to the Page_load method: Response.Charset = &quot;&quot;; Response.ContentType = &quot;text/xml&quot;; Response.Write(&quot;<?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot;?><?mso-infoPathSolution solutionVersion=\&quot;1.0.0.1\&quot; href=\&quot;<path to Manifest.xsf or to a .xsn file>\&quot; PIVersion=\&quot;1.0.0.0\&quot; productVersion=\&quot;11.0.5120\&quot; ?><?mso-application progid=\&quot;InfoPath.Document\&quot;?><my:myFields xmlns:my=\&quot;http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-03-25T19:43:06\&quot; xml:lang=\&quot;en-us\&quot;><my:field1>some text</my:field1></my:myFields>&quot;); </li> On the Debug menu, click Start.</li> When you click Open, you receive the error message that is mentioned in the &quot;Symptoms&quot; section.</li></ol>

Additional query words: kbnoOfficeAlertID IP2007 ASPX

Keywords: kberrmsg kbaspnet kbbug kbnofix kbtshoot kbprb KB892951

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.