ページに非表示のフィールドを作成し、ページを送信するときにその値を設定します。再びページの読み込み時に、値のチェックを配置する必要があります
。aspx で
<asp:HiddenField ID="hdnfld" runat="server"/>
今JSで:-
<script type="text/javascript">
$(document).ready(function () {
var myval=$("#hdnfld").val();
if(myval=="submitted"){
// this will execute after submit:-// you can add necessary code here :-
$('.modal_part').fadeIn('slow');
$('#tn_select').load('OnBoarding.aspx');
// Set its value again to null;
$("#hdnfld").val("");
}
else
{
// This will execute when page will load first time :-
$('.modal_part').fadeIn('slow');
$('#tn_select').load('OnBoarding.aspx');
}
});
</script>
そしてコードビハインドで: -
protected void btn1_clicked(object sender,EventArgs e){
// set the hdn field:-
hdnfld.value="submitted";
}