我把代码贴出来(不太难),大家帮我看看错哪里了(在我发生疑问的地方我做了标记,后面有说明)

yem9 2003-07-22 10:45:01
<html>
<head>
<title>Holiday Page</title>
</head>
<body>
<form action="holidayresponses.aspx" method="" runat="server">
*******************************************************************
以上这句代码中,加了runat="server",则不会移动到另一界面,但是,我去了runat="server"后,页面显示出错,说类型“TextBox”的控件“FullName”必须放在具有 runat=server 的窗体标记内。
*******************************************************************
<h1>Feiertag Holidays</h1>
Please enter your details here.
<br/><br/>

Name:<asp:textbox id="FullName" runat="server"/>
<br/><br/>

Address:<asp:textbox id="Address" rows=5 textmode="multiline" runat="server"/>
<br/><br/>

Sex-
<asp:radiobuttonlist id="sex" runat="server">
<asp:listitem value="Male"/>
<asp:listitem value="Female"/>
</asp:radiobuttonlist>

please select the destination you would like details on:
<asp:dropdownlist id="Destination" runat="server">
<asp:listitem value="Madrid"/>
<asp:listitem value="Barcelona"/>
<asp:listitem value="Lisbon"/>
<asp:listitem value="Oslo"/>
<asp:listitem value="Prague"/>
</asp:dropdownlist>
<br/><br/>

<input type="submit">
<input type="reset">
*******************************************************************
以上,我添加的重置按钮为什么起不了效果???
*******************************************************************
</form>
</body>
</heml>
...全文
38 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
yem9 2003-07-23
  • 打赏
  • 举报
回复
to xrll()
嗯,我这就试一下,我觉得其它人告诉我的,都是修改服务器控件,可是,我就是想要实现使用服务器控件来传递
xrll 2003-07-23
  • 打赏
  • 举报
回复
如果要求重置按钮将文本框置空:
<input type="reset" onServerClick="Reset_Click" runat="server">
代码加上:
public void Reset_Click(Object sender, EventArgs E)
{
FUNAME.Text="" ;
Address.Text="";
}
xrll 2003-07-23
  • 打赏
  • 举报
回复
你需要的重置不是将文本框置空吧,它实际的意思是回到上次输入的值,当然是在提交按钮未按下前,下面代码调试正常:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<html>
<head>
<title>Holiday Page</title>
<script language="C#" runat="server">
public void GetAuthors_Click(Object sender, EventArgs E)
{
Response.Redirect("holidayresponses.aspx?a=ccc&b=eee") ;
}
</script>
</head>
<body>
<form runat="server">
<h1>Feiertag Holidays</h1>
Please enter your details here.
<br/><br/>
Name:<asp:textbox id="FullName" runat="server"/>
<br/><br/>
Address:<asp:textbox id="Address" rows=5 textmode="multiline" runat="server"/>
<br/><br/>
Sex-
<asp:radiobuttonlist id="sex" runat="server">
<asp:listitem value="Male"/>
<asp:listitem value="Female"/>
</asp:radiobuttonlist>
please select the destination you would like details on:
<asp:dropdownlist id="Destination" runat="server">
<asp:listitem value="Madrid"/>
<asp:listitem value="Barcelona"/>
<asp:listitem value="Lisbon"/>
<asp:listitem value="Oslo"/>
<asp:listitem value="Prague"/>
</asp:dropdownlist>
<br/><br/>
<input type="submit" onServerClick="GetAuthors_Click" runat="server">
<input type="reset">
</form>
</body>
</heml>
cmsoft 2003-07-23
  • 打赏
  • 举报
回复
不要runat=server也行,你里面的控件不要runat=server,就行了
yem9 2003-07-23
  • 打赏
  • 举报
回复
to cmsoft(韦小宝是我的老乡.net)
不加runat=server我试过了,不行的,那些控件,甚至不会显示
panyee 2003-07-22
  • 打赏
  • 举报
回复
你要实现什么东东偶还是明白了一点儿
ruyedian 2003-07-22
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2031/2031463.xml?temp=.5900995
ruyedian 2003-07-22
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2059/2059115.xml?temp=.4414179
你看一下
其实我以前也没有用过
yem9 2003-07-22
  • 打赏
  • 举报
回复
大家来看看吧,帮帮忙
yem9 2003-07-22
  • 打赏
  • 举报
回复
to ruyedian(710℃ 高烧):
此页的视图状态无效,可能已损坏。
***************
对不起,本人为菜鸟。。。
yem9 2003-07-22
  • 打赏
  • 举报
回复
to panyee(快乐王子) :
不成功
to ruyedian(710℃ 高烧):
我试看看
ruyedian 2003-07-22
  • 打赏
  • 举报
回复
为form命名:
<form runat="server" action="" ID="MainForm" method="post">
加入下面的语句:
<script language="vbscript">
sub window_onload()
Document.All("MainForm").action="holidayresponses.aspx"
End Sub
</script>
yem9 2003-07-22
  • 打赏
  • 举报
回复
to panyee(快乐王子) :
我添加看看
panyee 2003-07-22
  • 打赏
  • 举报
回复
你可以在服务端处理完提交后用 Response.Redirect("cc.aspx", true);来转移页面
yem9 2003-07-22
  • 打赏
  • 举报
回复
没人回答么?应该不难啊
yem9 2003-07-22
  • 打赏
  • 举报
回复
1、我知道不能去掉runat="server",但是,添上去后,页面转移不到下一个页面
2、那个地方method是我漏拷贝了,代码中是有的
shenlongju 2003-07-22
  • 打赏
  • 举报
回复
up
panyee 2003-07-22
  • 打赏
  • 举报
回复
<form action="holidayresponses.aspx" method="" runat="server">

其中的method="post"
cmsoft 2003-07-22
  • 打赏
  • 举报
回复
不能去掉runat=server

62,075

社区成员

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

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

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

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