asp 页面提交时,禁止修改页面的输入项,有什么好办法吗

raulcdp 2009-06-19 03:27:30
页面代码

<table style="width: 1120px; height: 120px;">

<tr>
<td style="width: 141px; height: 10px;" align="left" valign="middle">
<label>ttt</label></td>
<td style="width: 328px; height: 10px;" align="left">
<asp:CheckBoxList ID="aaa" runat="server" Height="24px" RepeatDirection="Horizontal"
Width="296px" >
<asp:ListItem Value="1">a</asp:ListItem>
<asp:ListItem Value="2">b</asp:ListItem>
<asp:ListItem Value="3">c</asp:ListItem>
</asp:CheckBoxList></td>
<td style="height: 10px">
<asp:DropDownList ID="nodenameButton" runat="server">
<asp:ListItem>1</asp:ListItem>
</asp:DropDownList></td>

</tr>

<tr>
<td style="width: 119px" >
<asp:Button ID="submit" runat="server" OnClick="submit_Click"/>
</tr>
</table>


protected void searchButton_Click(object sender, EventArgs e)
{
//do some
}
...全文
68 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
xue08161981 2009-06-22
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 gdjlc 的回复:]
页面的控件置为不可用,用Enabled= false;

HTML code
<table style="width: 1120px; height: 120px;">
<tr>
<td style="width: 141px; height: 10px;" align="left" valign="middle">
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox></td>
<td style="width: 328px; height: 10px;" align="left">
<asp:CheckBoxList …
[/Quote]

支持楼主,关注当中
mahui19780126 2009-06-22
  • 打赏
  • 举报
回复
程序思路,值保存,弹出js显示数据,原页面关闭。
调皮的蟠桃 2009-06-22
  • 打赏
  • 举报
回复
不过,我想的是在asp中怎样实现这个功能,原来是.net的,不过还好,也学习一下.
raulcdp 2009-06-21
  • 打赏
  • 举报
回复
下拉框,checkbox 没有readOnly 属性
lzp4881 2009-06-21
  • 打赏
  • 举报
回复
readonly
raulcdp 2009-06-21
  • 打赏
  • 举报
回复
不好意思 描述的不清楚。
总的想法是:
点击提交按钮后,页面的控件置为不可用,同时要把文本框,下拉框,checkbox的值传到后台,有什么好的办法吗?
我开始的想法是,点击提交按钮,页面控件disabled,但是disabled的控件,后台取不到值。
各位大侠 有什么好办法吗?
gdjlc 2009-06-21
  • 打赏
  • 举报
回复
页面的控件置为不可用,用Enabled= false;

<table style="width: 1120px; height: 120px;">
<tr>
<td style="width: 141px; height: 10px;" align="left" valign="middle">
<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox></td>
<td style="width: 328px; height: 10px;" align="left">
<asp:CheckBoxList ID="aaa" runat="server" Height="24px" RepeatDirection="Horizontal"
Width="296px">
<asp:ListItem Value="1">a </asp:ListItem>
<asp:ListItem Value="2">b </asp:ListItem>
<asp:ListItem Value="3">c </asp:ListItem>
</asp:CheckBoxList>
</td>
<td style="height: 10px">
<asp:DropDownList ID="nodenameButton" runat="server">
<asp:ListItem>1 </asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width: 119px">
<asp:Button ID="submit" runat="server" Text="提交" OnClick="submit_Click" />
</tr>
</table>



protected void submit_Click(object sender, EventArgs e)
{
TextBox1.Enabled = false;
aaa.Enabled = false;
nodenameButton.Enabled = false;
Response.Write(TextBox1.Text);
Response.Write("<br />");
Response.Write(aaa.SelectedValue);
Response.Write("<br />");
Response.Write(nodenameButton.SelectedItem);

}

lzj34 2009-06-19
  • 打赏
  • 举报
回复
搞清楚再发贴好不好?
moonzap 2009-06-19
  • 打赏
  • 举报
回复
不是asp版块的 去.net版块发把
newdomer 2009-06-19
  • 打赏
  • 举报
回复
搞清楚再发贴好不好?
xiaojing7 2009-06-19
  • 打赏
  • 举报
回复
嘛意思?
oywkkai 2009-06-19
  • 打赏
  • 举报
回复
关注。。。
  • 打赏
  • 举报
回复
怎么都不到NET版问呢?

28,406

社区成员

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

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