日期:2014-05-17  浏览次数:20498 次

jquery 返回false后怎样不执行后台的事件
function wxTrueName() {
            var trueName = $("#<%=txtUserTrueName.ClientID%>").val();
            if (trueName.length == 0) {
                $("#lblUserTrueName").css({ color: "red" });
                $("#lblUserTrueName").text("请输入用户姓名!");
                return false;
            } else {
                $("#lblUserTrueName").text("");
            }
        }[code]
[code=csharp]<td class="td_class">姓名:
                            </td>
                            <td height="25">
                                <asp:TextBox ID="txtUserTrueName" runat="server" style="width: 200px;"></asp:TextBox>
                                <label id="lblUserTrueName" style="font-size: 14px; font-weight: normal; color: red;"></label>
                            </td>

<asp:Button ID="btnSave" CssClass="adminsubmit_short" OnClientClick="return wxTrueName()" OnClick="btnSave_ServerClick" runat="server" Text="保存" />


返回为家也进了后台时间

------解决方案--------------------
这样写完全没有问题的 不会进入后台事件吧!
------解决方案--------------------
返回fasle了 还怎么进后台呀,返回成true 不就进后台了么