PRB: ASCX forms loaded into PlaceHolder generates wrong __DoPostBack method

D

david mccormack

I have the same problem, came here looking for the answer
to this very question. Any ideas anyone, please?
 
I

Ishigava Butahhi

After some exploration, found that problem lies somewhere
in method System.Web.UI.Page.RenderPostBackScript(...).

My quick and raw override for this case is to correct
__doPostBack script after it is generated by mentioned
method (just string find&replace) and wait for MS patch
for the issue :(

General approach:
provide custom HtmlTextWriter class for Host page (see
method CreateHtmlTextWrite());
in custom HtmlTextWriter class perform script analysis.


If you need more details (source list), just confirm your
interest in conference (email address is fake because of
spamers)

With best wishes, ishigava.
-----Original Message-----
I have the same problem, came here looking for the answer
to this very question. Any ideas anyone, please?
-----Original Message-----
Background: into host form PlaceHolder control,
dynamically loaded .ASCX control, which contains form.

Issue: if .ASCX form requires generation of __DoPostBack
method, this method generated with error: page failed to
load into browser with syntax error message: "Error:
Expected ";""

Cause:
__DoPostBack method contains invalid identifier for
dynamically loaded form:
----------
<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase
().indexOf("netscape") > -1) {
theform = document.forms
["_ctl0:Form1"];
}
else {
theform = document._ctl0:Form1;
}
theform.__EVENTTARGET.value =
eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value =
eventArgument;
theform.submit();
}
// -->
</script>
----------------

It is obviously, that form name generated wronly:
theform = document._ctl0:Form1;

instead of

theform = document._ctl0_Form1;

How to override this issue?


.
.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top