zoukankan      html  css  js  c++  java
  • 利用JS调用aspx页面(转载)

    在实际开发中如新闻系统就需要利用js来调用某分类的新闻等.

    非Codebehind版
    Showjs.aspx
    ----------------------------
    <%Response.Write ("document.write('output')")%>
    Showjs.html
    ---------------------------
    <script language="JavaScript" Src="Showjs.aspx"></script>
    这样就可以正常查看showjs.html输出"output"

    Codebehind版
    用Vs.Net新建showjs.aspx然后把除此句以外的html代码全部删除
    <%@ Page language="c#" Codebehind="showjs.aspx.cs" AutoEventWireup="false" Inherits="Hover.showjs" %>
    然后在showjs.aspx.cs里Page_Load()里
    Response.Write ("document.write('output')");
    这样就能正常输出
    否则在Showjs.html里调用此Showjs.aspx时会报脚本错误了
    因为当你查看showjs.aspx运行时的html代码你就明白了因为它的输出不光是document.write('output')

    还包括aspx的默认文档的html代码所以调用不了!

    转自: http://www.cnblogs.com/hover/archive/2004/04/30/8191.aspx

    云码素材一个分享开发技术,分享精品源码素材的好平台!
  • 相关阅读:
    防止网站被镜像,被iframe
    PHP实现图片批量压缩
    常规正则表达式
    git安装项目步骤
    Laravel创建自定义 Artisan 控制台命令实例教程
    git常规命令
    JS验证身份证号
    Lucene-索引库的维护
    Lucene-分词器
    Lucene-全文检索
  • 原文地址:https://www.cnblogs.com/3rocks/p/1883965.html
Copyright © 2011-2022 走看看