ASP.NET tutorial - User Control

Reply Forum
Forum postAnthony @ 2009-06-02 16:27:53
ReplyReply to
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


Forum postWebmaster @ 2009-06-03 18:38:40
ReplyReply to
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 :)


Forum postVeeresh @ 2009-06-30 13:22:55
ReplyReply to
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.


Forum postVeeresh @ 2009-06-30 13:35:05
ReplyReply to
Agian this is Veeresh...

I got Solution for this.













© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com