从aspx访问HTML表单数据 [英] Accessing html form data from aspx

查看:171
本文介绍了从aspx访问HTML表单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用用户名和密码以html格式创建了一个登录表单..
现在,我希望使用aspx中的该用户名和密码来处理该怎么办?

I have created a login form in html with username and password..
now i want this user name and password in aspx for processing how could i do it ?

推荐答案

有两种方法

1)AJAX方式:单击登录"按钮后,向ASPX页面发出AJAX请求(使用用户名和密码). ASPX将处理凭据并将成功或失败标志发送到HTML,在那里您可以显示消息或让用户登录.

2)HTML表单:在表单标签的action属性中设置ASPX页面url,并将方法设置为post.将登录按钮类型设置为提交".在aspx页面上,您将能够在Request对象中获取密码和用户名.

There are two ways

1) AJAX Way: On click of Login button make an AJAX request (with username & password) to ASPX page. ASPX will process the credential and send the success or failure flag to HTML, there you can show message or let user login.

2) HTML Form: set ASPX page url in action attribute of form tag and set method as post. Make login button type as "submit". on aspx page you will be able to get password and username in Request object.

<form action="login.aspx" method="post">
<input type="submit" value="Login" />




希望对您有帮助




I hope this helps


这篇关于从aspx访问HTML表单数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆