asp.net中包含文件的代碼及使用方法

字號(hào):


    asp.net文件包含的方法基本與asp文件包含差不多!
    在asp.net包含文件的方法有:
    1.<% response.writefile(skin/default/footer.txt)%>
    2.<% server.execute(skin/default/footer.txt)%>
    3.streamreader 對(duì)象將包含文件寫到 http 內(nèi)容流中
    //me:網(wǎng)上說(shuō)asp.net中用include也可以的。。
    include和server.execute有什么區(qū)別?
    server.execute表示將頁(yè)面運(yùn)行過(guò)后的html代碼插入當(dāng)前位置
    include表示將頁(yè)面的源代碼加入當(dāng)前位置再做為一個(gè)整體運(yùn)行
    比方說(shuō)你定義一個(gè)變量dim a
    用server.execute后這個(gè)定義是無(wú)效的
    include的話,這個(gè)定義有效