[Mono-bugs] [Bug 566541] New: Empty HtmlForm produces JavaScript Code

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 21 17:02:46 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=566541

http://bugzilla.novell.com/show_bug.cgi?id=566541#c0


           Summary: Empty HtmlForm produces JavaScript Code
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: sky.rage at yahoo.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other
           Blocker: No


Description of Problem:
A webform with an empty HtmlForm (<form runat="server"></form>)
produces javascript code which isn't needed.

Normally ASP.NET adds this javascript code only if there is a component that
needs that (such as FieldValidators or ASP.NET Ajax)

The input looks like that:
<%@ Page Language="C#" %>
<html>
    <head>
    </head>
    <body>
        <form runat="server">

        </form>
    </body>
</html>

The output looks like that:
<html>
    <head>
    </head>
    <body>
        <form method="post" action="test.aspx" id="ctl00">
<script type="text/javascript">
//<![CDATA[
    var theForm;
    if (document.getElementById) { theForm = document.getElementById ('ctl00');
}
    else { theForm = document.ctl00; }
//]]>
</script>
<div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="DAAAAA=="
/>

</div>


        </form>
    </body>
</html>

Assembly: System.Web
Namespace: System.Web.UI
Class: Page

The method that produces the code is:
RenderClientScriptFormDeclaration


Steps to reproduce the problem:
1. Create a new "Empty Webapplication Project"
2. Create a Webform (without codebehind!) called test.aspx or something like
that
3. Copy following code in your file

<%@ Page Language="C#" %>
<html>
    <head>
    </head>
    <body>
        <form runat="server">

        </form>
    </body>
</html>

4. Run it in your browser and look at the document source
5. If you don't believe, make this steps with microsofts ASP.NET and compare
the output



Actual Results:


Expected Results:


How often does this happen? 
Always


Additional Information:
Webserver: xsp 2.6.0.0
Language: C#
IDE: MonoDevelop 2.2

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list