.net + html 同意注册
.net 功能十分强大,其实可以直接在里面写一些html的代码,比如像这样
<asp:CheckBox ID="checksingup" runat="server" Text='I have read and agree to <a href="abc.aspx">This is ABC web</a>' onclick="ValidateTandCs" />
这种可以用于注册时的超链接到别的地方,当然可以发挥想像,所有Text都可以这么用。
<asp:CustomValidator ID="cvTerms" runat="server" ValidationGroup="signupGroup" Display="Dynamic"
ClientValidationFunction="ValidateTandCs" EnableViewState="false" ErrorMessage="<%$Resources:Message,needagree%>" />
//这边errormessage是调用全域的message这样改起来会更方便些
<script language="javascript" type="text/javascript">
function ValidateTandCs(source, args)
{
args.IsValid = document.getElementById('<%= checksingup.ClientID %>').checked;
}
</script>
对于js,这里.net得到当的方法还是很多的,这也是其中一种
相关文档:
// <summary>
/// 过滤html代码
/// </summary>
public static string RphtmlStr(string html)
{
&n ......
被Struts的html:checkBox标签使用的小问题郁闷了两天,今天终于找到了解决的办法。如果大家也遇到同样的问题,可以参考。
1)需求:
当通过菜单进入页面时,页面中的checkbox处于被选中状态,页面提交后forward回本页,对应的checkbox保持提交时的状态,也就是说:如果提交时check ......
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy=& ......
HTML相对路径与绝对路径
在网页制作的过程中,少不了跟路径打交道,比如,包含一个文件,插入一个图片等,与路径都有关系,如果使用了错误的文件路径,就会导致引用失效(无法浏览链接文件,或无法显示插入的图片等)。初学者可能会感到困惑,下面我就详细的介绍一下相对路径与 ......