在c#中 @“” 可以完整的输出你想要的字符
可是如果中间有引号的话要怎么转义呢?我不用@的话 \可以转义 ,可是还是不能得到结果例子:
<a onclick="OpenNamedScrollingPopup('propertypublish.aspx?propertyId=<%# DataBinder.Eval(Container.DataItem,"PropertyId") %>', 'VirtualTour', 720 , 520);"  target='VirtualTour' href='propertypublish.aspx?propertyId=<%# DataBinder.Eval(Container.DataItem,"PropertyId") %>'>View</a>用转义后的
"<a onclick=\"OpenNamedScrollingPopup('propertypublish.aspx?propertyId=<%# DataBinder.Eval(Container.DataItem,\"PropertyId\") %>', 'VirtualTour', 720 , 520);\"  target='VirtualTour' href='propertypublish.aspx?propertyId=<%# DataBinder.Eval(Container.DataItem,\"PropertyId\") %>'>View</a>";请大家帮忙了
解决马上给分

解决方案 »

  1.   

    @"<a onclick=""OpenNamedScrollingPopup('propertypublish.aspx?propertyId=<%# DataBinder.Eval(Container.DataItem,""PropertyId"") %>', 'VirtualTour', 720 , 520);""  target='VirtualTour' href='propertypublish.aspx?propertyId=<%# DataBinder.Eval(Container.DataItem,""PropertyId"") %>'>View</a>"每个"都写成""
      

  2.   

    <a onclick='<%#"OpenNamedScrollingPopup(propertypublish.aspx?propertyId=" + DataBinder.Eval(Container.DataItem,"PropertyId") + " , 'VirtualTour', 720 , 520);" %>'  target='VirtualTour' href='<%# "propertypublish.aspx?propertyId=" + DataBinder.Eval(Container.DataItem,"PropertyId") %>'View</a>
      

  3.   

    // 在 @ 后面用 "" 表示 " :
    @"He said: ""Hello!"""
      

  4.   

    转义后,有两个引号代替一个引号!@"Hello""!" --> Hello"!