0

ok guys, so here's another weird one:

i have the following form:

<form method="post" autocomplete="off">
    <fieldset>
        <legend>Edit article</legend>

        <label>Description<textarea name="txtDescription"><%=article.Description %></textarea></label>
        <label>Content<textarea name="txtContent"><%=article.Content %></textarea></label>

    </fieldset>
    <input type="submit" class="fr" value="save changes" />
</form>

there is nothing on the code behind page beside getting the article. the page loads very fast, under 1 second, with that data in the textarea's.

when i try to submit this form, the page takes forever to load (actualy, it does not load at all, but fails after a few minuets with No data received. the textarea content is just some html, not large (about 2-4kb each text area)

i have tried adding enctype="multipart/form-data", with no success, the same thing happens. i have managed to narrow it down to the txtContent textarea, (i removed the description textarea) and the page fails.

what makes this even worse is that if i open the page in the browser on my server, it works with no problem, i can post, and it is all working as it should. if i try to access the page from a remote machine, the post fails.

Anyone has any idea as to what happens here?

EDIT: just to make sure, i have created a simple HTML document with the following in it:

<!DOCTYPE html>
<html>
<head>

</head>
<body>
    <div id="header">
        <nav>
            <ul>
                <li><a href="/admin/">Dashboard</a></li>
                <li><a href="/admin/articles/">Articles</a></li>
            </ul>
        </nav>
    </div>
    <div id="content">
    <form method="post" action="test.html">
        <fieldset>
            <legend>Edit article</legend>

            <label>Content<textarea name="txtcontent"></textarea></label>

        </fieldset>
        <input type="submit" class="fr" value="save changes" />
    </form>
    </div>
    <div id="footer"></div>

</body>
</html>

this still fails.

EDIT: the test code shown here is the minimal code that is not working. the actual form is larger, and if i remove the txtcontent textarea from the form, the form submits with no problem, including the description textarea.

EDIT: Content-Length: 1555 / Content-Type: application/x-www-form-urlencoded

EDIT: i have uninstalled and reinstalled iis, and re-registered .NET the problem is still there.

4

2 回答 2

0

最后说明:我已经卸载了 IIS,重新安装了 IIS,重新注册了 .net 框架,现在它似乎工作正常。原始问题的原因,未知

于 2013-07-28T11:19:39.010 回答
0

有几件事要检查......

您使用什么语言,例如 ASP.NET WebForms、ASP.NET MVC 和版本?

我可以看到你正在使用

<form method="post" autocomplete="off">

在 ASP.NET Web 表单中,您通常会将表单标记声明为

<form runat="server">

在 ASP.NET MVC 中,它类似于

@using(Html.BeginForm(......))
{
}

另一个问题是您发布 HTML 标记,由于安全原因,默认情况下 ASP.NET 不允许这样做。查找 XSS 并确保在禁用此功能之前了解风险。

于 2013-07-28T10:13:43.113 回答