question regarding __doPostBack

M

Marcelo

Hello,
I am trying to create a postback event, and it is working, just not calling
the sub.
I have a datagrid which has
<asp:DataGrid id="Mensajes"
...
<Columns>
<asp:HyperLinkColumn
....

DataNavigateUrlFormatString="javascript:__doPostBack('loadMessage','{0}')"

I also placed the following javascript function:
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape")
theform = document.forms["_ctl0"];
}
else {
theform = document._ctl0;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}


In the Sub Page_Load
I have
response.write ("__EVENTTARGET " & request("__EVENTTARGET") & "<br>")
response.write ("__EVENTARGUMENT " & request("__EVENTARGUMENT") & "<br>")

and I do receive both parameters, but the sub 'loadMessage' never gets
called.
Right now I patched it using a switch/case __EVENTTARGET then calling the
sub "manually".

What did I miss?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top