且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

验证局部视图的文本框

更新时间:2023-10-19 18:00:04

一种方法是在view或.js文件中编写验证功能.从第二个局部视图调用该函数,它将起作用.
one way is to write validation function in view or .js file. Call the function from 2nd partial view and it will work.


Ultimatley,任何局部视图都将在客户端呈现为标记.因此,在主视图中放置一个JQUery或Javascript函数,您可以在其中基于两个文本框的ID对其进行访问.
Ultimatley, any partial view will be rendered as markup on client side. So put a JQUery or Javascript function in Main view, in which you can access both the Textboxes based on their IDs.