首页 > 编程知识 正文

netserver命令,net网络命令的使用

时间:2023-05-03 14:15:13 阅读:117885 作者:2206

必须按几个按钮调用同一模块以实现相似(不同)的功能。 需要使用按钮的CommandName动作的实现步骤如下。 创建新的1、VS2005站点项目,将其拖到两个web控件Button控件上,然后分别将CommandName设置为btn1;分别将CommandArgument设置为aand 这两个参数随Button_Command事件一起传递。 然后,分别将text属性设定为数字升序、数字降序、字母升序、字母降序。 得到的代码如下。 实体

form id=' form1' runat=' server ' method=' post ' action=' default.aspx '

ASP : button id=' button1' runat=' server ' command name=' btn1 ' text=' button1' /

ASP : button id=' button2' runat=' server ' command name=' btn2 ' text=' button2'/ASP 3360 button id=' button3'

/form

选中/bodyhttp://www.Sina.com/Button1按钮,在属性面板中选择“事件”,在“操作”下双击" Command "栏进入代码页,然后输入以下代码(将Button1_Command更改为Button_Command ) protectedvoidbutton _ command (对象发送器,命令事件) switch show numbband 布雷克; case 'btn2': Response.Write ('数字:'); shownumbers(e.commandargument; 布雷克; case 'btn3': Response.Write (字母); showletters(e.commandargument; 布雷克; case 'btn4': Response.Write ('字母); showletters(e.commandargument; 布雷克; } privatevoidshownumbers (objectcommandargument ) if (command argument.tostring )=='Asc ' ) { Response.Write ) ) asas } else if (command argument.tostring (==' desc ' ) { Response.Write ) )降序: 54321 ); }隐私保护软件(对象命令管理(if )命令管理. tostring )=='Asc ' )响应. write ) ) ASC } else if (命令协议. tostring (==' desc ' ) response.write ) ' edcba ' ); } }返回} } 2、前台编辑页面,分别选择Button1和Button2,然后button _ Command 3358 www.Sina.com /运行两者的command事件摘要:在Button_Command事件中传递的电子参数实际上是包含e.CommandName (字符类型)和e.commandargument (对象类型)的参数组。 根据这两个参数,可以很容易地将一组按钮分为四组功能。 是数字的升序、数字的降序、字母的升序、字母的降序。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。