我有一个场景,我必须将用户名和密码值从 ext 文本字段传递到控制器操作以对数据库进行验证。我写了以下代码
<ext:TextField Name="Username" runat="server" ID="UserName"></ext:TextField>
<ext:TextField Name="Password" runat="server" ID="Password"></ext:TextField>
<ext:Button runat="server" ID="submit1" Type="Submit" Text="LOGIN" >
<Listeners>
<Click Fn="CallLogin">
</Click>
</Listeners>
</ext:Button>
函数调用登录(){
var username = document.getElementById('UserName').value;
var password = document.getElementById('Password').value;
//var url = '@Url.Action("Login", "Index")';
//window.location.href = url;
window.location.href = '/Login/Index/';
}
如何将这些值传递给控制器操作?
谢谢!