禁用asp.net C#中的按钮

编程入门 行业动态 更新时间:2024-10-24 22:30:25
本文介绍了禁用asp C#中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有2个.aspx页面.第一页有两个按钮,第二页有两个按钮. 在第一页中,一个按钮控件已启用,而另一个按钮已禁用..当用户单击第一页的已启用按钮时,将显示第二页.在第二页上,用户单击一个按钮.首页的已禁用按钮.(即,在启用了两个按钮控件的情况下显示首页) 我正在使用asp,C#,Visual Studio 2005 .. 请帮我.. 谢谢你. 问候 karan

I have 2 .aspx pages . and there are two buttons in first page and two buttons in second page. In first page one button control is enabled and another is disabled.. when the user clicks on enabled button of first page second page will be displayed.. and on second page user clicks one button.. when this button is clicked i want enable the disabled button of first page..(i.e.,the first page is displayed with both the button controls enabled ) I am using asp , C#, visual studio 2005.. Plz help me.. thank u. regards karan

推荐答案

是什么阻止了您?听起来很简单. 您可以通过多种方式从第二个页面访问第一个页面,例如: 1.查询字符串(如果正在导航) 2. PreviousPage概念(如果不导航) 您所需要做的就是将标记从另一页面传递到一页.你有没有尝试过? 如果您遇到问题,请这样做并发布特定问题. Whats stopping you? All sounds straight and simple. You have various ways to access the 1st page from 2nd, for example: 1. Querystring (if navigating) 2. PreviousPage concept (if not navigating) All you need is to pass on the flag to one page from other. Did you try at all? Please do so and do post specific issue, if you face.

u可以将查询字符串从第二页传递到第一页 在第二页按钮上,单击u可以写 response.redirect(firstpage.aspx?id = 1); 那么在首页加载时,您就可以做到 if(Convert.Tostring(Request.Querystring ["id"])=="1") button.Enabled = true; u can pass querystring from second page to first page on second page button click u can write response.redirect(firstpage.aspx?id=1); then on first page load u can do if(Convert.Tostring(Request.Querystring["id"])=="1") button.Enabled=true;

第二页 按钮单击事件 in second page on button click event protected void Button1_Click(object sender, EventArgs e) { Response.Redrect("Ur firstpage.aspx?id=1"); }

在您的第一页page_load

in ur first page in page_load

if(convert.Tostring(Request.Querystring["id"]=="1"s) { button1.Enabled=True; } else { button1.Enabled=False; }

试试吧

try it

更多推荐

禁用asp.net C#中的按钮

本文发布于:2023-11-14 04:46:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586256.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!