同意vzxq(灵感人)说的,
你的TxtZip.Text值是不是为null?
你的address.ascx控件中有TxtZip这个控件吗?
你的TxtZip.Text值是不是为null?
你的address.ascx控件中有TxtZip这个控件吗?
解决方案 »
- 在datalist控件中commandname为select对应的事件吗?
- 两个ListBox传值,只能得到ListBox的第一项
- oracle定义表变量
- 求解:不断开网络连接特别慢
- .Net 2.0高手请进~!!~!
- Body.onbeforeunload调用__doPostBack不成功,为什么? (100分)
- 下载别人的2010三层架构,2012转换后,不能调试编译,什么问题?
- 这个简单的问题应该如何解决?
- 请问:什么是工作流引擎?
- 在项目的web.config文件中设置了默认访问页,发布到iis,再通过ip访问的时候是一片空白呢?
- 急(在线等待)
- Infragistics UltraWebGrid问题,老大们来看看.
public class MyControl : System.Windows.Forms.UserControl
{
private System.Windows.Forms.TextBox textBox1;
private System.ComponentModel.Container components = null;
public MyControl()
{
InitializeComponent();
}
public string Zip
{
get
{
return textBox1.Text;
}
set
{
textBox1.Text = value;
}
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
this.textBox1.Location = new System.Drawing.Point(16, 16);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 0;
this.textBox1.Text = "100085";
this.Controls.Add(this.textBox1);
this.Name = "MyControl";
this.Size = new System.Drawing.Size(136, 56);
this.ResumeLayout(false);
}
#endregion
}
public class Show : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private MyControl myControl1;
private System.ComponentModel.Container components = null;
……
[STAThread]
static void Main()
{
Application.Run(new Show());
} private void Show_Load(object sender, System.EventArgs e)
{
MyControl Mycontrol1 = new MyControl();
textBox1.Text = "Zip is:" + Mycontrol1.Zip;
}
}
我设的初始值是“100085”,不设初始值也没有报错呀。
你检查一下编辑器产生的代码是否正常。
就是#region到#endregion这一段。
中的TxtZip有没有写错?
要不使用Return CStr(TxtZip.Text)试试?
Protected WithEvents address1 As address就放在Public Class default
Inherits System.Web.UI.Page的下面试试看吧。
Berfore you invoke the "address1.Zip",its value is null,so
Answer here: address1.Zip=lblMessage.Text