开发者

How to validate an ajax combobox with empty text?

How sh开发者_运维知识库ould I validate if my AJAX ComboBox contains text? I have tried with the ASP.NET RequiredFieldValidator but it dosen't work.


If found a solution here: http://ajaxcontroltoolkit.codeplex.com/workitem/24417

Had to add javascript to change the controltovalidate property for the internal textbox.

string script = string.Format(@"if({0}) {0}.controltovalidate = ""{1}_TextBox"";", this.reqValidator.ClientID, this.ddlCombo.ClientID);

ScriptManager.RegisterStartupScript(this, this.GetType(), string.Format("validator trick for {0}", this.ClientID), script, true);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜