读书人

引,该怎么解决

发布时间: 2012-03-02 14:40:28 作者: rapoo


在cs有s1

string s1= " <a style= 'CURSOR: hand ' onClick=\ " "+ "window.open( 'shenqing.aspx?id_no= <%# DataBinder.Eval(Container.DataItem,\ "id_no\ ") %> ', ' ', 'height=265,width=595,top=200,left=200 ')\ " "+ " > <font color=#0063dc> 申请 </font> </a> ";


的引有些

我想得到s1的值(.aspx里的值)

<a style= 'CURSOR: hand ' onClick= "window.open( 'shenqing.aspx?id_no= <%# DataBinder.Eval(Container.DataItem, "id_no ") %> ', ' ', 'height=265,width=595,top=200,left=200 ') " > <font color=#0063dc> 申请 </font> </a>

怎修改些引才能正示

[解决办法]
string s1 = " <a style= 'CURSOR: hand ' onClick=\ "window.open( 'shenqing.aspx?id_no= <%# DataBinder.Eval(Container.DataItem,\ "id_no\ ") %> ', ' ', 'height=265,width=595,top=200,left=200 ')\ " > <font color=#0063dc> 申请 </font> </a> ";
[解决办法]
//楼主的写法就可以得到.我对比了一下.没问题.
//其它地方可能有问题
<a style= 'CURSOR: hand ' onClick= "window.open( 'shenqing.aspx?id_no= <%# DataBinder.Eval(Container.DataItem, "id_no ") %> ', ' ', 'height=265,width=595,top=200,left=200 ') " > <font color=#0063dc> 申请 </font> </a>

<a style= 'CURSOR: hand ' onClick= "window.open( 'shenqing.aspx?id_no= <%# DataBinder.Eval(Container.DataItem, "id_no ") %> ', ' ', 'height=265,width=595,top=200,left=200 ') " > <font color=#0063dc> 申请 </font> </a>

[解决办法]
想打印双引号就用转义字符 \ " 单引号直接加上就可以了
[解决办法]
可以这样

<script type= "text/javascript ">
function XX()
{
window.open( ' <%# DataBinder.Eval(Container, "DataItem.id_no ") %> ', ' ', 'height=265,width=595,top=200,left=200 ')
}
</script>

<a style= "CURSOR: hand " onClick= "XX(); "> <font color= "#0063dc "> 申请 </font> </a>

读书人网 >asp.net

热点推荐