I have an Index.cshtml file. In that I have two div elements. I rendered partial view in one div like this:
<div id="div1">
@Html.Partial("_FutureAddEditClaim", Model.NewClaim)
</div>
<div id="div2"></div>
And in javascript, I created two new div elements. In one of these I appended div1. And in _FutureAddEditClaim.cshtml I have a function which runs on load:
$(function() {
alert("called");
});
When the application runs the alert message is showing twice. Can any one please tell me why this is happening in _FutureAddEditClaim.cshtml.
I had the page load function in Index.cshtml. This works fine.