Izgleda mi kao da radis u .NET1.1, asp.net2 je resio ovaj problem. Ovako izgleda fabricki publikovani doPostback:
Code:
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
Kao sto vidis prvo poziva onsubmit ako je prisutan i na osnovu return-a iz onsubmit postuje ili ne (mozes da sprecis submit forme). Kombinovano sa resenjem koje si dao moglo bi i ovako da se uradi:
Code:
<script type="text/javascript">
<!--
var __oldDoPostBack = __doPostBack;
__doPostBack = function(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
__oldDoPostBack (eventTarget, eventArgument);
}
}
// -->
</script>
Proveri samo dal 1.1 koristi identifikator theForm ili neki drugi....
▪ The word 'politics' is derived from the word 'poly', meaning 'many', and the word 'ticks', meaning 'blood sucking parasites' - Larry Hardiman
▪ If the good guy gets the girl, it's rated PG; if the bad guy gets the girl, it's rated R; and if everybody gets the girl, it's rated X
▪ Illegal aliens have always been a problem in the United States. Ask any Native American