something like                  public string URL 
{
get
{
object o = ViewState["URL"];
if (o != null)
return (string)ViewState["URL"];
return "";
}
set
{
ViewState["URL"] = value;
}
}
then on your control:
<cc:whatever URL="http://www.csdn.net" />

解决方案 »

  1.   

    <cc:whatever URL="http://www.csdn.net" />URL我要在程序里赋值.
    <cc:whatever id="uc1" />
    可是找不到用户控件的id,好象是要先定义一下,但我不知道怎么定义。
      

  2.   

    我这么写
    // editor.ascx.cs
    public string Text
    {
      get
      {
        return this.HtmlEdit.Text;
      }
      set
      {
        this.HtmlEdit.Text = value;
      }
    }/// edit.aspx
    protected editor uc1;uc1="test";可是不行,请问那里有误?
      

  3.   

    上面写错
    uc1.Text = "text";