Hi,
I like other people posting to this web site have limited to no experience of ASP.NET or C# but I am manfully trying to work my way through the tutorial.
I have just started doing the bit about user controls and have tried to create the user control as directed but I am not sure where I put the code on the CodeBehind page. What I mean is in the previous example we put the code between the {} brackets and did nothing else.
Do I put this code in the same place? If not where do I put it?
Thanks,
Anthony
I like other people posting to this web site have limited to no experience of ASP.NET or C# but I am manfully trying to work my way through the tutorial.
I have just started doing the bit about user controls and have tried to create the user control as directed but I am not sure where I put the code on the CodeBehind page. What I mean is in the previous example we put the code between the {} brackets and did nothing else.
Do I put this code in the same place? If not where do I put it?
Thanks,
Anthony
Hi Anthony,
Actually, I think your question is answered in this chapter: http://asp.net-tutorials.com/user-controls/using/
If not, then please let me know exactly what you're having problems with
Actually, I think your question is answered in this chapter: http://asp.net-tutorials.com/user-controls/using/
If not, then please let me know exactly what you're having problems with

Hi,
I am following this tut for usercontol concept.
As told in this tut
I added the following code in code behind file of the page.
-----------------
protected void Page_Load(object sender, EventArgs e)
{
// These values can come from anywhere, but right now, we just hardcode them
MyUserInfoBoxControl.UserName = "Jane Doe";
MyUserInfoBoxControl.UserAge = 33;
MyUserInfoBoxControl.UserCountry = "Germany";
}
-------
Even though i am getting errors like
-----------------------------------
'UserInfoBoxControl.UserName' is inaccessible due to its protection level
'UserInfoBoxControl.UserAge' is inaccessible due to its protection level
'UserInfoBoxControl.UserCountry' is inaccessible due to its protection level
-------------------------------------
There is no result even, I Tried this code in the code behind file of usercontrol page Also.
So please clarify me....as soon as possible.
I am following this tut for usercontol concept.
As told in this tut
I added the following code in code behind file of the page.
-----------------
protected void Page_Load(object sender, EventArgs e)
{
// These values can come from anywhere, but right now, we just hardcode them
MyUserInfoBoxControl.UserName = "Jane Doe";
MyUserInfoBoxControl.UserAge = 33;
MyUserInfoBoxControl.UserCountry = "Germany";
}
-------
Even though i am getting errors like
-----------------------------------
'UserInfoBoxControl.UserName' is inaccessible due to its protection level
'UserInfoBoxControl.UserAge' is inaccessible due to its protection level
'UserInfoBoxControl.UserCountry' is inaccessible due to its protection level
-------------------------------------
There is no result even, I Tried this code in the code behind file of usercontrol page Also.
So please clarify me....as soon as possible.
Agian this is Veeresh...
I got Solution for this.
I got Solution for this.