English 中文(简体)
ASP. 所需经费净额 D. 外地客户资格评价
原标题:ASP.Net RequiredFieldValidator custom EvaluationFunction property

我的习俗协会。 所需外地净额 标签使标记与......

var af1_ctl00 = document.all ? document.all["af1_ctl00"] : document.getElementById("af1_ctl00");
af1_ctl00.controltovalidate = "af1_af1_txt";
af1_ctl00.display = "None";
af1_ctl00.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
af1_ctl00.initialvalue = ""; 

但是,似乎没有办法确定<斯特凡>评价功能财产。 我需要这样做,以提及某些习俗。

我尝试了以下方法。

  • Adding a new attribute when the control is rendered and when the attributes are rendered
  • Calling RemoveAttribute followed by Attributes.Add
  • Attempting to reset it via javascript.

似乎没有工作。

如果我能够找到一种解决办法,在《法典》中发挥作用,确定归属,然后才能使这一特性成为最佳办法。

最佳回答

具体做法如下。

ASP. 净有效器实际上界定了页上的一个长度,即 Java字中的DOM物体。 然后,它们将财产添加到该物体上。 因此,在协会制定的法典中,你也取得了这样的成绩。 净额

af1_ctl00.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";

然后,你可以将一些 j带入你的网页,如使用英文版。 页 次

function NewValidationFunction() {
    return (1 == 1);
}

var val = document.getElementById( af1_ct100 );
val.evaluationfunction = NewValidationFunction;

验证功能现已改变,以利用你的习俗功能。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签