Letoncse
Letoncse

Reputation: 722

Postback not working in production server - IE 11

I am using .net 4.0 . Please see this following code

 <asp:DropDownList ID="ddlCountry" runat="server" CssClass="input-xlarge" OnSelectedIndexChanged="CountrySelection_Changed" AutoPostBack="true" ></asp:DropDownList> 

Any type of post back not working like as click on button or linkbutton on production server.

This working fine all browser in production & local server except IE 11. How can solve this? Thanks in Advance!!

Upvotes: 3

Views: 11934

Answers (3)

stalin.vs
stalin.vs

Reputation: 1

//add this in html head section
<script type="text/javascript">

//<![CDATA[
    if ($('#__EVENTTARGET').length <= 0 && $('#__EVENTARGUMENT').length <= 0) {
        $('#aspnetForm').prepend('<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /><input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />');
    }
    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();
        }
    }

//]]>

</script>





<%--add this client side function onchange="__doPostBack(this,this);"  --%>
<asp:DropDownList id="DDL"  Runat="server" AutoPostBack="true" OnSelectedIndexChanged="BindCategoryData"  onchange="__doPostBack(this,this);"></asp:DropDownList>

Upvotes: -1

Nikhil D
Nikhil D

Reputation: 2509

Check

There are two ways to fix this: one is a machine-wide fix, the other is a way to fix individual sites.

Upvotes: 1

Vignesh Kumar A
Vignesh Kumar A

Reputation: 28413

To make it work properly, you need to make you application IE11 compatible by adding a file "ie.browser" in App_Browser folder... Check Out here

Upvotes: 2

Related Questions