日期:2014-05-20  浏览次数:20405 次

关于response.write最简单的问题
<%@   Page   Language= "VB "   ContentType= "text/html "   ResponseEncoding= "gb2312 "   %>
<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题文档 </title>
</head>
<body>
<%
Response.Write( " <table   width= "100% "   border= "1 "   cellspacing= "0 "   cellpadding= "0 ">
    <tr>
        <td> hello&nbsp; </td>
        <td> &nbsp; </td>
        <td> &nbsp; </td>
    </tr>
    <tr>
        <td> &nbsp; </td>
        <td> &nbsp; </td>
        <td> &nbsp; </td>
    </tr>
</table> ")
%>
</body>
</html>

这是我全部的代码
这是我第一个asp.net的程序,还望各位成全啊

------解决方案--------------------
报错了没?
------解决方案--------------------
"中间还有 "号,没有任何转义
------解决方案--------------------
string a=@ " <table width= "100% " border= "1 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> hello&nbsp; </td>
<td> &nbsp; </td>
<td> &nbsp; </td>
</tr>
<tr>
<td> &nbsp; </td>
<td> &nbsp; </td>
<td> &nbsp; </td>
</tr>
</table> ";
Response.Write(a);
------解决方案--------------------
你直接用html代码写这个表格不行吗??
------解决方案--------------------

<%@ Page Language= "VB " ContentType= "text/html " ResponseEncoding= "gb2312 " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<body>
<% Response.Write( " <table width= '100% ' border= '1 ' cellspacing= '0 ' cellpadding= '0 '> ") %>
<% Response.Write( " <tr> ")%>
<% Response.Write( " <td> hello&nbsp; </td> ")%>
<% Response.Write( " <td> &nbsp; </td> ")%>
<% Response.Write( " <td> &nbsp; </td> ")%>
<% Response.Write( " </tr> ")%>
<% Response.Write( " <tr> ")%>
<% Response.Write( " <td> &nbsp; </td> ")%>