I have 2 aspx pages... neither of which do anything out of the ordinary.
One of the pages automatically generates this block of code when viewed at
the client:
------------------------------------------------------------
<form name="webfrmFor m" method="post" action="pokedex .aspx" id="webfrmForm" >
<input type="hidden" name="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="[extensive data]" />
<script language="javas cript">
<!--
function __doPostBack(ev entTarget, eventArgument) {
var theform = document.forms["webfrmForm "];
theform.__EVENT TARGET.value = eventTarget.rep lace(/\$/g, ":");
theform.__EVENT ARGUMENT.value = eventArgument;
theform.submit( );
}
// -->
</script>
------------------------------------------------------------
The other asp page generates only this:
------------------------------------------------------------
<form name="wfrmPoked at" method="post" action="pokedat .aspx"
id="wfrmPokedat ">
<input type="hidden" name="__VIEWSTA TE" value="[data]" />
------------------------------------------------------------
The net result is that the first page can have objects onclick perform a
__doPostBack, and the other page throws a javascript error about an expected
object; and rightfully so, the __dopostback routine isn't there. But why
isn't it?
What triggers the asp.net creation of the __doPostBack code block? It's
also missing it's __EVENTTARGET and __EVENTARGUMENT hidden values. I can't
find any significant differences in either of my pages that would cause
this. I'm using framework 1.1 and 2003 rc2/iis6 server & notepad as an
editor.