G
Green
Hi,
I have a question concerning how to manipulate the properties in the user
control, and there is an interesting article about this from Microsoft:
http://msdn.microsoft.com/library/d...guide/html/cpconexposingpageletproperties.asp
My situation is i have a user control resides in the aspx page. And In
the aspx page's html, i set the following:
<ucl:myControl id="title" EditText="Add New Topic" ></ucl:myControl>
And in my control i declare:
protected System.Web.UI.WebControls.HyperLink EditButton;
public String EditText = null; // why use String instead of string
....
EditButton.Text = EditText;
....
Then i ran the program, the HyperLink button EditButton's text was set to
"Add New Topic". I just don't know how it works.(The article tell the
exactly the same technique.)
How come EditText will be automatically set to "Add New Topic"?
What i am thinking about is:
Then program first keep the value pair of EditText and "Add New Topic"
from the ucl section, then when run to the user section, it find the field
EditText and set it to the value provided in the ucl section. If i am wrong
please correct me.
I am more like to do the following way
protected System.Web.UI.WebControls.HyperLink EditButton;
public string EditButtonText{
get{return EditButton.Text;}
set{EditButton.Text = EditText;} // This is from the aspx's ucl
section.
}
public String EditText = null; // why use String instead of string
(if i set like: private String EditText = null; The program will not
locate it and set "Add New Topic to it, why?")
....
EditButton.Text = EditText;
....
I have a question concerning how to manipulate the properties in the user
control, and there is an interesting article about this from Microsoft:
http://msdn.microsoft.com/library/d...guide/html/cpconexposingpageletproperties.asp
My situation is i have a user control resides in the aspx page. And In
the aspx page's html, i set the following:
<ucl:myControl id="title" EditText="Add New Topic" ></ucl:myControl>
And in my control i declare:
protected System.Web.UI.WebControls.HyperLink EditButton;
public String EditText = null; // why use String instead of string
....
EditButton.Text = EditText;
....
Then i ran the program, the HyperLink button EditButton's text was set to
"Add New Topic". I just don't know how it works.(The article tell the
exactly the same technique.)
How come EditText will be automatically set to "Add New Topic"?
What i am thinking about is:
Then program first keep the value pair of EditText and "Add New Topic"
from the ucl section, then when run to the user section, it find the field
EditText and set it to the value provided in the ucl section. If i am wrong
please correct me.
I am more like to do the following way
protected System.Web.UI.WebControls.HyperLink EditButton;
public string EditButtonText{
get{return EditButton.Text;}
set{EditButton.Text = EditText;} // This is from the aspx's ucl
section.
}
public String EditText = null; // why use String instead of string
(if i set like: private String EditText = null; The program will not
locate it and set "Add New Topic to it, why?")
....
EditButton.Text = EditText;
....