简单问题:

xayzmb 2003-11-06 09:00:38
两个页面
第二个页面的一个数据是从第一个页面的文本框中取得的
为什么不能显示?
下面是代码:
第一个页面(asptop.asp)****************************************
<%language=vbscript%>
<%
response.write "<html>"
response.write "<title></title>"
response.write "<body>"
response.write "<form method=post action=callEXCEL.asp>"
response.write "<input type=""text"" name=""t1"">"
response.write "<input type=""submit"" name=""nn"" value=""kkkkkkkkk"" >"
response.write "</form>"
response.write "</body>"
response.write "</html>"
%>
'*************************************************
第二个页面(callEXCEL.asp)****************************************
<%@ Language=VBScript %>
<%
dim aa
aa = request.form("t1")

Response.Buffer = true
Response.ContentType = "application/vnd.ms-excel"

%>

<table border="1">
<tr>
<th bgcolor="red">项目 A</th>
<th>项目 B</th>
<th>合计</th>
<th>项目 C</th>
<th>项目 D</th>
<th>合计</th>
</tr>
<tr>
<td height="30" bgcolor="red"><% response.write aa %></td>
<td>4</td>
<td>5</td>
<td>6</td>
<td><%response.write aa%></td>
<td><font color="red">=sum(a2:e2)*100</font></td>
</tr>
<tr>
<td>2</td>
<td>1</td>
<td colspan="4"><font color="red">=sum(a3:b3)+f2</font></td>
</tr>
</table>
'*************************************************
但是如果不调用EXCEL则正常
还有就是如果直接给callEXCEL.asp中的变量aa赋值,就可以显示在EXCEL中
现在的问题是如何把从另一页面取得的数据
填入EXCEL中去

msn: xayzmb@msn.com
...全文
83 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
xayzmb 2003-12-30
  • 打赏
  • 举报
回复
没有一个回答正确的
怎么给分嘛!!!!!!!!!!!!!!!!!!!!
xayzmb 2003-11-06
  • 打赏
  • 举报
回复
还是不行
我想还是与EXCEL之间的问题
因为只要去掉 Response.ContentType = "application/vnd.ms-excel"
就可以写出数据
summercat 2003-11-06
  • 打赏
  • 举报
回复
把值放在SESSION里
xayzmb 2003-11-06
  • 打赏
  • 举报
回复
还有没有人知道怎么回事?
问题主要是出在这一句上
Response.ContentType = "application/vnd.ms-excel"
只要去掉就可以
但这一句又是必须的
因为我希望能将生成的结果保存成EXCEL表.
xayzmb 2003-11-06
  • 打赏
  • 举报
回复
请 jiank(一钱不值) 贴代码出来好吗?

TO: colee(长夜多浪漫) 你说的方法我试过,不行

TO: lovehwq21(winson) 如果去掉 Response.ContentType = "application/vnd.ms-excel"这一句的话,就能取到传过来的值.
jiank 2003-11-06
  • 打赏
  • 举报
回复
搞定
colee 2003-11-06
  • 打赏
  • 举报
回复
response.write "<input type=""text"" name=""t1"">"
=>
response.write "<input type='text' name='t1'>"
xeimm 2003-11-06
  • 打赏
  • 举报
回复
楼上ok
lovehwq21 2003-11-06
  • 打赏
  • 举报
回复
我们公司上班时间不给上MSN,这里帮你解决吧
查查看IIS的设置,是不是有设置有匿名访问,打开IIS设置,找到你的这个站点,分别修改网站的属性、callEXCEL.asp文件所在的文件夹的属性,还有callEXCEL.asp文件的属性,修改方法一样:右键单击=》选属性=》选目录安全性=》单击编辑=》匿名访问那一项去除,也就是不选=》确定=》确定,最好重启服务,再试试,我昨天刚用这种方法解决跟你一样的问题
ygghost 2003-11-06
  • 打赏
  • 举报
回复
aa = request.form("t1")
换成
aa = request("t1")
zykj_2000 2003-11-06
  • 打赏
  • 举报
回复
response.write request.form("t1")
看看,有值吗
leiaming 2003-11-06
  • 打赏
  • 举报
回复
把两个双引号改成单引号试试
summercat 2003-11-06
  • 打赏
  • 举报
回复
就现在你给的这个程序不能显示AA的值吗?
pepos 2003-11-06
  • 打赏
  • 举报
回复
aa = request.form("t1")
把form去掉试试看
lovehwq21 2003-11-06
  • 打赏
  • 举报
回复
你看看按我的方法行不行,如果行,那你把你的文件备份一次,删了虚拟站点再建一次,不用设置匿名访问,看看怎么样
vivisogood 2003-11-06
  • 打赏
  • 举报
回复
注意在iis里把execl目录设置为“写入”。
vivisogood 2003-11-06
  • 打赏
  • 举报
回复
http://www.blueidea.com/tech/program/2003/879.asp
xayzmb 2003-11-06
  • 打赏
  • 举报
回复
还有人知道不?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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