有没有办法从添加表到HTML中停止ASP.NET的CreateUserWizard? [英] Is there a way to stop ASP.NET CreateUserWizard from adding tables into HTML?

查看:194
本文介绍了有没有办法从添加表到HTML中停止ASP.NET的CreateUserWizard?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能删除HTML <表> 由该CreateUserWizard控件生成验证登录页面对HTML 5的元素呢?

我设法让我的整个网站以验证HTML 5,除了在我的登录页面造成的CreateUserWizard 3个错误。

这是code会导致该错误,我似乎无法停止生成:

 <表ID =ContentPlaceHolder1_CreateUserWizard1>
< TR风格=高度:100%;>
    < TD><表CELLSPACING =0的cellpadding =0的风格=高度:100%;宽度:100%;边境崩溃:崩溃;>
        &所述; TR>
            < TD风格=高度:100%;宽度:100%;>


解决方案

使用jQuery:

  $('表')。replaceWith($('表')。HTML()
   .replace(/< TBODY / GI,< D​​IV ID ='表')
   .replace(/< TR / GI,<格)
   .replace(/< \\ / TR> / GI,< / DIV>中)
   .replace(/< TD / GI,<跨度)
   .replace(/&下; \\ / TD&GT / GI,&所述; /跨度>中)
   .replace(/< \\ / TBODY / GI,< \\ / DIV)
);

或者,你可以试试
https://github.com/ryandoom/jquery-plugin-table-to-div

How can I remove the html <table> elements that are generated by the CreateUserWizard to validate the login page against HTML 5?

I've managed to get my entire site to validate to HTML 5, except for 3 errors caused by the CreateUserWizard in my login page.

This is the code that causes the errors, which I can't seem to stop from being generated:

<table id="ContentPlaceHolder1_CreateUserWizard1">
<tr style="height:100%;">
    <td><table cellspacing="0" cellpadding="0" style="height:100%;width:100%;border-collapse:collapse;">
        <tr>
            <td style="height:100%;width:100%;">

解决方案

with jquery:

$('table').replaceWith( $('table').html()
   .replace(/<tbody/gi, "<div id='table'")
   .replace(/<tr/gi, "<div")
   .replace(/<\/tr>/gi, "</div>")
   .replace(/<td/gi, "<span")
   .replace(/<\/td>/gi, "</span>")
   .replace(/<\/tbody/gi, "<\/div")
);

or, you can try https://github.com/ryandoom/jquery-plugin-table-to-div

这篇关于有没有办法从添加表到HTML中停止ASP.NET的CreateUserWizard?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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