一、JS添加代码,判断是否有OnSubmit事件
文件位置:YZSoft/Forms/src/Validator.js
//=====判断是否有OnSubmit事件===== if (typeof (OnSubmit) != 'undefined') { var func = OnSubmit; if (func(validationGroup) === false) return false; }
二、OnSubmit方法
代码位置:需要判断的表单中
三、ajax一般处理程序
<%@ WebHandler Language="C#" Class="CollectionManagement" %>using System;using System.Web;using System.Linq;using System.Collections.Generic;using System.Collections;public class CollectionManagement : IHttpHandler { public void ProcessRequest (HttpContext context) { string PID=context.Request["PID"]; //PID = "GC422444"; //string json = "{\"P\":\"F\"}"; string flag = "true"; using (CollectionManagementDataClassesDataContext cm = new CollectionManagementDataClassesDataContext()) { ListP = cm.EngineeringManagement.Where(r => r.ProjectID == PID).ToList(); if (P.Count != 0) { flag = "false"; } } context.Response.Write(flag); context.Response.End(); } public bool IsReusable { get { return false; } } }