• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

表单和HTML辅助方法(第4章)原文内容


Recommended Posts

一.表单的两大属性特性

(1.)动作属性特征

Action用于告诉web浏览器信息发送到哪里,因此action值指定一个URL,它可以是相对路径或绝对路径。

(2.)方法属性特征

method属性告诉web浏览器是使用[HttpPost]还是[HttpGet]。默认情况下,表单的提示方法是method="get "。这种方法提交方法一般用于显示数据,因为这种提交方法会将数据暴露给浏览器的地址栏,无法提交大量数据。但是当我们要进行搜索或者注册的时候,提交的表单包含了大量的数据或者敏感的私有数据,get方法是不安全的,不能传输大量的数据,所以这个时候会优先考虑method="POST"。这种方法对提交的数据量没有限制,非常安全。

fl1mxosmcqa3651.png

nvftwy3xkd13652.png

weko0q1p3em3653.png

二.使用HTML辅助方法输出超链接和生成表单标签

(1)用来输出超链接的HTML辅助方法是HTML。ActionLink,常用以下三种方式编写;

@Html。ActionLink("链接文本"," ActionName ")

@Html。ActionLInk ("link text "," actionname ",new {id=123,page=5})

@Html。ActionLink("链接文本"、" actionname "、"控制器名称")

注意:@Html的第一个参数。ActionLink辅助方法表示链接文本,不能为空字符串或null,否则会抛出异常。

bd54fdiibxz3654.png

三、其他辅助方法

uibfrm1ueae3655.png

t3dziye51jl3656.png

fk14qaba1yc3657.png

luqnrjaj1023658.png

xtxojql4zi43659.png

zpm435hatyr3660.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now