<%@ Page Title="" Language="C#" MasterPageFile="~/AdminMaster.Master" AutoEventWireup="true" CodeBehind="MedicalCategory.aspx.cs" Inherits="SanatanJeevan.MedicalCategory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
<link href="assets/admin/pages/Prescription.css" rel="stylesheet" />
<script>
//update button click
var btnUpdate = document.getElementById('<%= btnUpdate.ClientID %>');
$(function () {
$("[id*=btnDelete]").removeAttr("onclick");
$('#dialogMedicalCategory').text("Are you sure you want to update?");
$('#dialogMedicalCategory').dialog({
modal: true,
autoOpen: false,
title: "Alert",
resizable: true,
height: "auto",
width: 400,
buttons: {
Ok: function () {
$("[id*=btnUpdate]").attr("rel", "delete");
$("[id*=btnUpdate]").click();
$(this).dialog('close');
},
cancel: function () {
$(this).dialog("close");
return false;
}
},
open: function () {
$('.ui-dialog-titlebar').find('button').remove();
$('.ui-dialog-buttonset').find('button').removeClass('ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover').addClass('btn btn-danger');
}
});
$(btnUpdate).click(function (e) {
if ($(this).attr("rel") != "delete") {
$('#dialogMedicalCategory').dialog('open');
return false;
} else {
__doPostBack(this.name, '');
//return true;
}
});
});
<asp:Button ID="btnUpdate" CssClass=" btn btn-success" runat="server" Style="display: none" Text="Update" OnClick="btnUpdate_Click" />
__ doPostBack(this.name,'');是不是函数错误被抛出,而点击确定按钮,而iam在aspx页面使用它将工作正常,但当我使用母版页时,它只显示错误。我在过去5天遇到这个错误,请帮助我。
答案 0 :(得分:0)
使用,
SubmitBehavior="false"
按钮中的属性。 它会正常工作。