Custom Validator无法获得Combobox ID(Custom Validator fails to get Combobox ID)
我使用自定义验证器作为必需字段验证器失败的Ajax Combobox,但我无法解决Combobox,但是当我将自定义验证器控件中的另一个文本框的Id传递给验证选项时,它工作正常。
以下是我的代码:已更新
<ajax:ComboBox ID="Cmbx" runat="server" Width="100px" CssClass="AquaStyle textfont" AutoPostBack="true" DropDownStyle="DropDown" AutoCompleteMode="SuggestAppend" CaseSensitive="false" ItemInsertLocation="Append" ValidationGroup="Validate" CausesValidation="true" />
<asp:CustomValidator ID="cvRequired" ControlToValidate="InstCmbx$TextBox" runat="server" ClientValidationFunction="validate" Display="None" ValidationGroup="Validate"/>
这不起作用,我也检查了Ajax网站上的问题跟踪器,但是他们说我必须在Id中添加“$ TextBox”并且它会起作用,但是它也不起作用。
我无法从相同的方式调用简单的javascript函数:
function validate(sender, args) { alert("gasfkgsjkds"); }
I am using the custom Validator as Required Field validator fails for the Ajax Combobox, but I am not able to work it out for the Combobox, howeverr when I pass the Id of another Textbox in the custom Validator control to validate option, it works fine.
Below is my code:Updated
<ajax:ComboBox ID="Cmbx" runat="server" Width="100px" CssClass="AquaStyle textfont" AutoPostBack="true" DropDownStyle="DropDown" AutoCompleteMode="SuggestAppend" CaseSensitive="false" ItemInsertLocation="Append" ValidationGroup="Validate" CausesValidation="true" />
<asp:CustomValidator ID="cvRequired" ControlToValidate="InstCmbx$TextBox" runat="server" ClientValidationFunction="validate" Display="None" ValidationGroup="Validate"/>
This is not working, I checked out the issue tracker on Ajax site as well, but they said that I must append "$TextBox" in the Id and it will work, but then also it is not working.
I am not able to call a simple javascript function from the same:
function validate(sender, args) { alert("gasfkgsjkds"); }
原文:https://stackoverflow.com/questions/15705714
最满意答案
cd
不是一个真正的可执行文件 - 它是一个shell内置命令。另外,我认为你想要做的是在Java 6中使用
Desktop
,特别是open
方法 ,它试图用平台上的默认注册应用程序(如果存在)打开一个文件。http://download.oracle.com/javase/6/docs/api/java/awt/Desktop.html
cd
is not a real executable - it is a shell built-in command.Additionally, I think what you want to do is use
Desktop
in Java 6, specifically theopen
method, which attempts to open a file with the default registered application on the platform (if it exists).http://download.oracle.com/javase/6/docs/api/java/awt/Desktop.html
相关问答
更多-
您可以使用Desktop类。 Desktop API(java.awt.Desktop)API,它允许Java应用程序与主机平台上与特定文件类型关联的默认应用程序进行交互。 在此处阅读更多内容如何与桌面课程集成 You can use Desktop class. the Desktop API (java.awt.Desktop) API, which allows Java applications to interact with default applications associated wit ...
-
在看完这个问题的答案之后,我终于弄明白了问题是什么。 所以,我把脚本改为这个,它运行得很好。 我在调用prettyPrint之前删除了漂亮的类。