User706407582 posted
Hi
We are in a process of replacing i-frames with Div in our application (ASP.NET,C# framework 4.6.2) . Some how we were able to render pages in Div too.
But when we do any Postback action such as (Button click, Dropdown item change, navigate with hyperlink or any post back action)
nothing happens. When checked with DOM explorer, there is java script runtime error for null references.
We are doing ajax call to render the page inside a DIV using below code -
$(document).ready(function () {
$.ajax({
url: url,
success: function (html) {
$("#content").html(html);
}
});
});
Basically any server side code is not working which is related with post back. When I tried to select a dropdown rendered in iframe replaced Div, server side code for drop down change is not get triggered, instead Metadata sccript code giving error
as shown below.
"Unhandled exception 0x800a138f - Javascript runtime error: Unable to set property 'value' of undefined or null reference"
Meta data code ->
//<![CDATA[
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();
}
}
//
function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl,
trackFocus, clientSubmit) {
this.eventTarget = eventTarget;
this.eventArgument = eventArgument;
this.validation = validation;
this.validationGroup = validationGroup;
this.actionUrl = actionUrl;
this.trackFocus = trackFocus;
this.clientSubmit = clientSubmit;
}
Can someone please suggest what could be going wrong here ? Immediate help will be highly appreciated.