String 变量和Session变量如何绑定到TextBox

vcforeverya 2005-08-25 01:19:13
rt
...全文
80 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aaron_lly 2005-08-25
  • 打赏
  • 举报
回复
textbox1.text=string


textbox1.text=session("text")
mathsword 2005-08-25
  • 打赏
  • 举报
回复
textbox的 string变量直接赋值了,texbox1.text=string变量
session 的话,现判断是否存在,Session["xxx"]是否为null,不为null转换成string 赋值
hchxxzx 2005-08-25
  • 打赏
  • 举报
回复
this.TextBox1.Text = this.Session["xxx"] == null?"":this.Session["xxx"].ToString();
1. 简述 private、 protected、 public、 internal 修饰符的访问权限。 答 . private : 私有成员, 在类的内部才可以访问。 protected : 保护成员,该类内部和继承类中可以访问。 public : 公共成员,完全公开,没有访问限制。 internal: 在同一命名空间内可以访问。 2 .列举ASP.NET 页面之间传递值的几种方式。 答. (1).使用QueryString, 如....?id=1; response. Redirect().... (2).使用Session变量 (3).使用Server.Transfer 3. 一列数的规则如下: 1、1、2、3、5、8、13、21、34...... 求第30位数是多少, 用递归算法实现。 答:public class MainClass { public static void Main() { Console.WriteLine(Foo(30)); } public static int Foo(int i) { if (i <= 0) return 0; else if(i > 0 && i <= 2) return 1; else return Foo(i -1) + Foo(i - 2); } } 4.C#中的委托是什么?事件是不是一种委托? 答 : 委托可以把一个方法作为参数代入另一个方法。 委托可以理解为指向一个函数的引用。 是,是一种特殊的委托 5.override与重载的区别 答 :override 与重载的区别。重载是方法的名称相同。参数或参数类型不同,进行多次重载以适应不同的需要 Override 是进行基类中函数的重写。为了适应需要。 6.如果在一个B/S结构的系统中需要传递变量值,但是又不能使用Session、Cookie、Application,您有几种方法进行处理? 答 : this.Server.Transfer 7.请编程遍历页面上所有TextBox控件并给它赋值为string.Empty? 答: foreach (System.Windows.Forms.Control control in this.Controls) { if (control is System.Windows.Forms.TextBox) { System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ; tb.Text = String.Empty ; } } 8.请编程实现一个冒泡排序算法? 答: int [] array = new int ; int temp = 0 ; for (int i = 0 ; i < array.Length - 1 ; i++) { for (int j = i + 1 ; j < array.Length ; j++) { if (array[j] < array[i]) { temp = array[i] ; array[i] = array[j] ; array[j] = temp ; } } }
1. 一列数的规则如下: 1、1、2、3、5、8、13、21、34...... 求第30位数是多少, 用递归算法实现。 答:public class MainClass { public static void Main() { Console.WriteLine(Foo(30)); } public static int Foo(int i) { if (i <= 0) return 0; else if(i > 0 && i <= 2) return 1; else return Foo(i -1) + Foo(i - 2); } } 2.C#中的委托是什么?事件是不是一种委托? 答 :委托可以把一个方法作为参数代入另一个方法。 委托可以理解为指向一个函数的引用。 是,是一种特殊的委托。 3.override与重载的区别 答 :overrider与重载的区别。重载是方法的名称相同。参数或参数类型不同,进行多次重载以适应不同的需要。 Overrider是进行基类中函数的重写。为了适应需要。 4.如果在一个B/S结构的系统中需要传递变量值,但是又不能使用Session、Cookie、Application,您有几种方法进行处理? 答 : this.Server.Transfer 5.请编程遍历页面上所有TextBox控件并给它赋值为string.Empty? 答: foreach (System.Windows.Forms.Control control in this.Controls) { if (control is System.Windows.Forms.TextBox) { System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ; tb.Text = String.Empty ; } } 6.请编程实现一个冒泡排序算法? 答: int [] array = new int[] {1,3,5,8,0,2,3,10,8,10}; int temp = 0 ; for (int i = 0 ; i < array.Length - 1 ; i++) { for (int j = i + 1 ; j < array.Length ; j++) { if (array[j] < array[i]) { temp = array[i] ; array[i] = array[j] ; array[j] = temp ; } } }

62,041

社区成员

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

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

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

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