Having trouble understanding User Controls in C# -


I am new to user controllers, only one has been created so, so bear with me. I have read today that user control should be self-centered and parents should not rely on any information from the container. I get that part, but the principle that I have difficulty understanding is the "right" way of designing my program around that principle.

I am creating a web form in C #, which has a user control page on that page, I have created usercontrol in my ascx file and dragged it into my aspx page. User control is a gridview to show the results of a doubled date box and an SQL stored procedure.

I would really like to reuse this control, but I can not understand how the usercontrol is a stored procedure that I would like to run without any specific page which I am not violating Regarding the parent container "rule"

thanks

on the parent container Do not believe it does not mean the user can not communicate Expose a property in the battle in which parents have been set. But there is a default value, so this is not the accident.

In addition, if it is a very specific control, then there is no reason why it would be bad to trust the parents. It's not ideal, but you'll use user control to isolate the code.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -