user3345721
user3345721

Reputation: 85

Duplicate postback when using nicedit script in chrome

I have a .net framework web-forms project that uses the nicedit script, to makes an inline content editor on my page. (see https://nicedit.com/)

Page.aspx:

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script src="nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function () {
        var myNicEditor = new nicEditor();
        myNicEditor.setPanel('myNicPanel');
        myNicEditor.addInstance('txtData');
    });
   
    </script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div id="myNicPanel" style="width: 545px;"> </div>
    <textarea id="txtData" name="S1" rows="12" cols="100"></textarea>

    <input type="submit" value="sumbit form"/>
</asp:Content>


In IE it works fine. But in chrome something goes wrong.

I created a tiny project that contains the minimal things to demonstrate the problem.

The problem: For some reason in each postback (for example when clicking on the submit button etc.) page loads twice, instead of one time. (First time with the IsPostBack=true and second time with the IsPostBack=false)

It makes unwanted behavior in my real application so that I must prevent that duplicate postback.

Can someone help me?

Thanks.

Upvotes: 0

Views: 22

Answers (0)

Related Questions