The C# WebForm outputs illegal JavaScript to the client. The C# WebForm outputs an HTML form named "default" and then references that form with "document.default".
For example:
In JavaScript, "document.default" is an illegal usage of the keyword "default". Therefore, the browser displays a run-time error.
This illegal code is generated by any control that performs a PostBack.
For example:
This illegal code is generated by any control that performs a PostBack.
Resolution
To work around this problem, rename the form in the Default.aspx WebForm by following these steps:
- Open Default.aspx in Visual Studio .NET designer.
- Click the HTML tab to view the HTML code.
- Change the following HTML code
Status
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
More Information
Steps to Reproduce the Problem
- Open Microsoft Visual Studio .NET.
- On the File menu, point to New, and then click Project.
- In the New Project dialog box, click Visual C# Projects under Project Type, and then click ASP.NET Web Application under Templates.
- In the Location text box, type the project name as TestApplication by replacing the default 'WebApplication#' name in the URL path.
- Add a LinkButton server control to WebForm1.aspx.
- On the File menu, click Save.
- On the Build menu, click Build Solution.
- In the Solution Explorer window, right-click WebForm1.aspx, and then click View in Browser.
No comments:
Post a Comment