K
Kevin
Hey guys,
I really can't narrow this one down but I hope someone can help. The
problem is intermittent and debugging is almost impossible. Nothing
strange in the IIS logs. Basically, sometimes the __doPostBack JS
method isn't injected into the HTML. Here are 2 HTML snippets of the
two different outputs of the same file. First one is the way it should
look:
<form name="aspnetForm" method="post" action="home.aspx?id=8338"
id="aspnetForm">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET"
value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT"
value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="[...blah blah...]" />
</div>
<script type="text/javascript">
<!--
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
AND here is a snippet, calling exactly the same file... and the
__doPostBack isn't rendered.
<form name="aspnetForm" method="post" action="/home.aspx?id=8338"
id="aspnetForm">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="[...blah blah...]/>
HERE is the C# code for the form that is supposed to trigger the
__doPostBack to be injected:
< %@ control language="C#" autoeventwireup="true"
inherits="Controls_HeaderSearch" CodeFile="HeaderSearch.ascx.cs" % >
< asp:TextBox ID="searchBox" runat="server" CssClass="searchbox"
MaxLength="128" Text="< %$ Resources:UI, Search % >" / >
< asp:LinkButton ID="btnSearch" runat="server"
CssClass="searchButton" OnClick="btnSearch_Click"
CausesValidation="false" / >
What could possibly be causing the __doPostBack to not show? It's
almost like .Net is just getting lazy on some requests. But we all
know that's not possible... or is it? :-b
Other possible factors (but don't think these would cause it)
We are running Ektron, but Ektron doesn't control whether the
__doPostBack appears, our C# code does.
Out content is cached over the Akamai network, but Akamai
shouldn't be stripping out content.
Anyone have any ideas?
Thanks so much,
Kevin
I really can't narrow this one down but I hope someone can help. The
problem is intermittent and debugging is almost impossible. Nothing
strange in the IIS logs. Basically, sometimes the __doPostBack JS
method isn't injected into the HTML. Here are 2 HTML snippets of the
two different outputs of the same file. First one is the way it should
look:
<form name="aspnetForm" method="post" action="home.aspx?id=8338"
id="aspnetForm">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET"
value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT"
value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="[...blah blah...]" />
</div>
<script type="text/javascript">
<!--
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
AND here is a snippet, calling exactly the same file... and the
__doPostBack isn't rendered.
<form name="aspnetForm" method="post" action="/home.aspx?id=8338"
id="aspnetForm">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="[...blah blah...]/>
HERE is the C# code for the form that is supposed to trigger the
__doPostBack to be injected:
< %@ control language="C#" autoeventwireup="true"
inherits="Controls_HeaderSearch" CodeFile="HeaderSearch.ascx.cs" % >
< asp:TextBox ID="searchBox" runat="server" CssClass="searchbox"
MaxLength="128" Text="< %$ Resources:UI, Search % >" / >
< asp:LinkButton ID="btnSearch" runat="server"
CssClass="searchButton" OnClick="btnSearch_Click"
CausesValidation="false" / >
What could possibly be causing the __doPostBack to not show? It's
almost like .Net is just getting lazy on some requests. But we all
know that's not possible... or is it? :-b
Other possible factors (but don't think these would cause it)
We are running Ektron, but Ektron doesn't control whether the
__doPostBack appears, our C# code does.
Out content is cached over the Akamai network, but Akamai
shouldn't be stripping out content.
Anyone have any ideas?
Thanks so much,
Kevin