在html页面中加入aspx页面 在线 50分

ttg520 2007-05-15 04:31:08
我把新闻生成html了 但是在新闻左测有个新闻搜索 我是反新闻搜索的内容 做成aspx的 然后再的html中调用 方法<iframe frameBorder="0" height="140" width="240" scrolling='no' src="../../inc/infoSearch.aspx"></iframe> 但是在打开的时候 新闻内容都出来了 那个iframe 还没有出来 这样还不如不生成html 有没有什么办法 在html中更快的调用aspx页面
...全文
400 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
ttg520 2007-05-15
  • 打赏
  • 举报
回复
现在还有个重要问题 生成后有很多页面 怎么分页呢
sbqcel 2007-05-15
  • 打赏
  • 举报
回复
这主意也不错~
ttg520 2007-05-15
  • 打赏
  • 举报
回复
问题解决了 直接打印出html

DataTable dt = InfoDAO.getTpyeList().Tables[0];
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" >");
stringBuilder.Append("<tr><td><img src=\"../../images/info2.jpg\" /></td></tr>");
stringBuilder.Append("<tr><td align=\"center\" height=\"25\" >文章分类:<select name=\"ddlType\" id=\"ddlType\">");
for (int i = 0; i < dt.Rows.Count; i++)
{
stringBuilder.Append("<option value=" + dt.Rows[i]["ID"].ToString() + ">" + dt.Rows[i]["name"].ToString() + "</option>");
}
stringBuilder.Append("</select></td></tr><tr>");
stringBuilder.Append("<td align=\"center\" height=\"25\" >搜索类别:<select name=\"ddlKind\" id=\"ddlKind\"><option value=\"0\">文章题目</option><option value=\"1\">文章内容</option></select></td>");
stringBuilder.Append("</tr><tr><td align=\"center\" height=\"25\" >关 键 词:<input name=\"txtKeyWord\" type=\"tex\" maxlength=\"20\" id=\"txtKeyWord\" class=\"text_form\" style=\"width:80px;\" /></td></tr><tr><td align=\"center\" height=\"25\" ><input type=\"image\" name=\"imgSearch\" id=\"imgSearch\" onclick=\"openSearch();\" src=\"../../images/searchs.gif\" style=\"border-width:0px;\" /></td></tr></table>");
dazhong23 2007-05-15
  • 打赏
  • 举报
回复
用Ajax可以吧....没试过..
talentfly9 2007-05-15
  • 打赏
  • 举报
回复
是啊 我也是这样 呵呵 希望楼上的兄弟 能讲得详细些啊
ttg520 2007-05-15
  • 打赏
  • 举报
回复
XMLHttpRequest 有没有例子啊
  • 打赏
  • 举报
回复
如果你在aspx中放一个iframe来装载html页面,你很可能反而会看到html页面滞后显示。

所以虽然你应该为aspx进行优化,例如应该缓存,但是大概并不能改变显示的先后次序。
ttg520 2007-05-15
  • 打赏
  • 举报
回复
那个搜索页面很简单 但是在加载的时候 至少3秒 <table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td><img src="../images/info2.jpg" /></td>
</tr>
<tr>
<td align="center" height="25" >
文章分类:<asp:DropDownList ID="ddlType" runat="server">
</asp:DropDownList></td>
</tr>
<tr>
<td align="center" height="25" >
搜索类别:<asp:DropDownList ID="ddlKind" runat="server">
<asp:ListItem Value="0">文章题目</asp:ListItem>
<asp:ListItem Value="1">文章内容</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td align="center" height="25" >
关 键 词:<asp:TextBox ID="txtKeyWord" CssClass="text_form" Width="80" MaxLength="20" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td align="center" height="25" >
<asp:ImageButton ID="imgSearch" ImageUrl="../images/searchs.gif" runat="server" OnClick="imgSearch_Click" />
</td>
</tr>
</table>
mdl821120 2007-05-15
  • 打赏
  • 举报
回复
学习,帮顶了啊
ustbwuyi 2007-05-15
  • 打赏
  • 举报
回复
楼上的不失为一个好办法..
sbqcel 2007-05-15
  • 打赏
  • 举报
回复
优化下你那个动态页面的代码
  • 打赏
  • 举报
回复
使用XMLHttpRequest直接把aspx读过来,或者把要查询的数据通过XMLHttpRequest传给后台aspx处理后,在读会来也可.不过都麻烦一点点...
zhouju2004 2007-05-15
  • 打赏
  • 举报
回复
js调

62,068

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧