1
A
回答
0
创建您自己的控件。正如你在RecaptchaControl的RenderContents方法中看到的那样,它使用一个iframe。 Iframe不符合HTML严格标准,因此您必须使用HTML对象标签。
protected override void RenderContents(HtmlTextWriter output)
{
output.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
output.RenderBeginTag(HtmlTextWriterTag.Script);
output.Indent++;
output.WriteLine("var RecaptchaOptions = {");
output.Indent++;
output.WriteLine("theme : '{0}',", this.theme ?? string.Empty);
if (this.customThemeWidget != null)
{
output.WriteLine("custom_theme_widget : '{0}',", this.customThemeWidget);
}
output.WriteLine("tabindex : {0}", this.TabIndex);
output.Indent--;
output.WriteLine("};");
output.Indent--;
output.RenderEndTag();
output.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
output.AddAttribute(HtmlTextWriterAttribute.Src, this.GenerateChallengeUrl(false), false);
output.RenderBeginTag(HtmlTextWriterTag.Script);
output.RenderEndTag();
output.RenderBeginTag(HtmlTextWriterTag.Noscript);
output.Indent++;
output.AddAttribute(HtmlTextWriterAttribute.Src, this.GenerateChallengeUrl(true), false);
output.AddAttribute(HtmlTextWriterAttribute.Width, "500");
output.AddAttribute(HtmlTextWriterAttribute.Height, "300");
output.AddAttribute("frameborder", "0");
output.RenderBeginTag(HtmlTextWriterTag.Iframe); // Change this to object HTML tag
output.RenderEndTag();
output.WriteBreak();
output.AddAttribute(HtmlTextWriterAttribute.Name, "recaptcha_challenge_field");
output.AddAttribute(HtmlTextWriterAttribute.Rows, "3");
output.AddAttribute(HtmlTextWriterAttribute.Cols, "40");
output.RenderBeginTag(HtmlTextWriterTag.Textarea);
output.RenderEndTag();
output.AddAttribute(HtmlTextWriterAttribute.Name, "recaptcha_response_field");
output.AddAttribute(HtmlTextWriterAttribute.Value, "manual_challenge");
output.AddAttribute(HtmlTextWriterAttribute.Type, "hidden");
output.RenderBeginTag(HtmlTextWriterTag.Input);
output.RenderEndTag();
output.Indent--;
output.RenderEndTag();
}
1
我会通过NuGet软件包参考推荐Microsoft Web Helpers库。
相关问题
- 1. 严格的doctype causeing在IE
- 2. asp.net mvc and recaptcha action
- 3. Asp.net MVC recaptcha set language not working
- 4. 如何检测ASP.NET中的DOCTYPE(过渡或严格)服务器端?
- 5. “data”属性是XHTML严格Doctype的标准属性吗?
- 6. 严格的doctype阻止访问FireFox中的DOM变量
- 7. XSL为XHTML严格DOCTYPE - META标签验证问题
- 8. 嵌入Flash使用SWFObject与严格的DOCTYPE
- 9. 浏览器渲染严格/过渡DOCTYPE之间的区别
- 10. 使用严格的DOCTyPE定义时jQuery可拖动扩展
- 11. IE9错误80020102,使用vbscript Preserve关键字与doctype严格
- 12. 如何使ASP.Net MVC的tinyMCE内容像XHTML一样严格?
- 13. 成员资格和asp.net MVC
- 14. 严格的DocType在FF/Chrome中规定了最小的表格行高度
- 15. 说明“骨干不是严格的MVC”
- 16. PlayFramework严格路线和ajax
- 17. Jena命令行和 - 严格
- 18. 严格混叠和在C
- 19. PHP 7:同时使用严格和非严格类型提示?
- 20. 什么是严格和非严格的模拟?
- 21. reCaptcha和SSL网站
- 22. Recaptcha和Windows Phone
- 23. ASP.NET XHTML严格验证和自动完成=关闭
- 24. 使用doctype DTD的好处XHTML + RDFa 1.0 // EN over XHTML 1.0严格吗?
- 25. 提交使用JavaScript形式,以一个新的窗口 - 与严格的DOCTYPE
- 26. 材料为asp.net mvc 1和asp.net mvc 2和asp.net mvc 3
- 27. ASP.NET MVC Metro风格
- 28. ASP.NET MVC部分视图和表格
- 29. ASP.NET MVC路由。空格和类别
- 30. Perl严格decode_base64
你想要什么帮助? – roryf 2010-10-03 16:39:20
让它通过严格的文档类型验证 – Jon 2010-10-03 16:41:32
我刚才看了看源代码,它使用了一个iframe,所以它不会传递。耻辱。 – Jon 2010-10-03 17:56:17