我在文本框上放了jquery蒙版。
jQuery(function ($) {
$("#txtBoxLawyerCNIC").mask("99999-9999999-9", { placeholder: "" });
$("#txtBoxLawyerContactNo").mask("+99-999-9999999", { placeholder: "" });
});
<asp:TextBox runat="server" ID="txtBoxLawyerCNIC" placeholder="XXXXX-XXXXXXX-X" MaxLength="15" ClientIDMode="Static" CssClass="form-control">
</asp:TextBox>
直到我点击gridview中的edit
按钮调用RowCommand
并且文本框丢失了所有屏蔽,它才有效。为什么?
protected void grdviewLawyers_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
int LawyerID = Convert.ToInt32(grdviewLawyers.DataKeys[Convert.ToInt32(e.CommandArgument)].Value);
short UserID = Convert.ToInt16(Session["UserID"]);
if (e.CommandName == "cmdEdit")
{
DataTable dt = MngLawyers.SelectLawyersByLawyerID(LawyerID);
DataRow r = dt.Rows[0];
txtBoxLawyerCNIC.Text = r["LawyerCNICNo"].ToString();
txtBoxLawyerContactNo.Text = r["LawyerContactNo"].ToString();
}
}
为什么它会在RowCommand上丢失掩码?