LinkButton does not POST

O

Oscar Thornell

Hi,

Problem: LinkButton control does not POST
Environment: Win 20003, ASP.NET 2.0, XHTML
Target/device: Symbian v.9/Opera 8.60 (168) based smartphones

I am developing a mobile web application (VS.NET 2005/xhtml) the target
device(s) are Symbian (v.9) based smartphones. We recently recived a new
"batch" of test devices with upgraded software..

For months now the Link Button with code like this: "<a
id="ctl00_mainContent_btnLogin" class="link"
href="javascript:__doPostBack('ctl00$mainContent$btnLogin','')">Login</a>"
have worked...

Unfortunately that is no longer the case and the browser in the device(s)
don't POST when clicking the links...

The LinkButton control does not trigger a POST in .NET 2.0. If the same code
is recompiled and run under .NET 1.1 everything works.
The cause of the problem is probably the generated Javascript method
"__doPostBack"


//.NET 1.1 (Here everything works..)
<a id="LinkButton1"
href="javascript:__doPostBack('LinkButton1','')">LinkButton</a>

<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
theform = document.Form1;
}
else {
theform = document.forms["Form1"];
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->



//.NET 2.0 (Does not work..)
<a id="ctl00_mainContent_LinkButton1"
href="javascript:__doPostBack('ctl00$mainContent$LinkButton1','')">LinkButton</a>

<!--
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();
}
}
// -->



Have anyone a solution?

Regards
/Oscar
 

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

Top