User control confusion
-
Hi All, I struck against the meaning of user control. Please i need your comments for this issue As per my knowledge we use user control when there is reusable logic and UI present in the web application. But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page. Means they have almost n number of user controls for n number of pages. Is it proper way? Do we need to have concern for performance issue
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
playing with bugs ) wrote:
As per my knowledge we use user control when there is reusable logic and UI present in the web application.
Are you speaking about ascx files ? I think master pages are a good replacement for this.
playing with bugs ) wrote:
But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page.
I don't find any problem in in this design. There might be some reason that they chose this method. May be the user controls was developed by one programmer, and ASPX pages are done by other. So the person who created ASPX pages, don't need to understand what's happening inside the user control. I think it's for easy maintainability. You need to identify, why they used such a method. I don't think that it will make performance problems.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
playing with bugs ) wrote:
As per my knowledge we use user control when there is reusable logic and UI present in the web application.
Are you speaking about ascx files ? I think master pages are a good replacement for this.
playing with bugs ) wrote:
But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page.
I don't find any problem in in this design. There might be some reason that they chose this method. May be the user controls was developed by one programmer, and ASPX pages are done by other. So the person who created ASPX pages, don't need to understand what's happening inside the user control. I think it's for easy maintainability. You need to identify, why they used such a method. I don't think that it will make performance problems.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Navaneeth, thanks for your comments
N a v a n e e t h wrote:
Are you speaking about ascx files ?
Yes i am saying ASCX files.
N a v a n e e t h wrote:
I think it's for easy maintainability
That's what i wanted (specific answer) What will you say to this sentence.Please give your comments The user controls are used to simplify the amount of logic that is on the page
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Navaneeth, thanks for your comments
N a v a n e e t h wrote:
Are you speaking about ascx files ?
Yes i am saying ASCX files.
N a v a n e e t h wrote:
I think it's for easy maintainability
That's what i wanted (specific answer) What will you say to this sentence.Please give your comments The user controls are used to simplify the amount of logic that is on the page
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
playing with bugs ) wrote:
The user controls are used to simplify the amount of logic that is on the page
Well, I think when you use user controls, your logic is not getting simplified. But your code is getting simplified and gives easy readability. Commonly used things can be put in one centralized place.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Michael, Thanks for giving your comments
Michael Sync wrote:
If you are using ASP.NET 1x, the answer is Yes.
I am using ASP.NET 2.0. What makes the difference between 2 ?
Michael Sync wrote:
plus, the reason why we used to use the user control is that we want to create the basepage for website themes.
We can use master page for this. So what should we conclude ?
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
playing with bugs ) wrote:
I am using ASP.NET 2.0. What makes the difference between 2 ?
If you are using ASP.NET 2.0, one user control for one page won't be needed for you anymore. For performance, I don't think that there is any differences between the page and user control..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
playing with bugs ) wrote:
The user controls are used to simplify the amount of logic that is on the page
Well, I think when you use user controls, your logic is not getting simplified. But your code is getting simplified and gives easy readability. Commonly used things can be put in one centralized place.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
Well then here my question came again as you said
N a v a n e e t h wrote:
Commonly used things can be put in one centralized place
But that user control is going to use by one page and that also single time so there could not be any common things.It contains logic for populating the page(UI) and getting data from UI to data container
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
playing with bugs ) wrote:
I am using ASP.NET 2.0. What makes the difference between 2 ?
If you are using ASP.NET 2.0, one user control for one page won't be needed for you anymore. For performance, I don't think that there is any differences between the page and user control..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Michael but if i would have using ASP.NET 1.x then why i can use one user control for 1 page ? Means what makes this difference in 2.0 .. i don't know my question is making any sense or not ? ;P
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Well then here my question came again as you said
N a v a n e e t h wrote:
Commonly used things can be put in one centralized place
But that user control is going to use by one page and that also single time so there could not be any common things.It contains logic for populating the page(UI) and getting data from UI to data container
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
No idea exactly why the used this method. May be it's their style of coding. But I am sure that it won't make any performance difference.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
No idea exactly why the used this method. May be it's their style of coding. But I am sure that it won't make any performance difference.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
OK Navaneeth Thank you very much for your valuable comments :)
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Michael but if i would have using ASP.NET 1.x then why i can use one user control for 1 page ? Means what makes this difference in 2.0 .. i don't know my question is making any sense or not ? ;P
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
When we were using ASP.NET 1x, there is no build-in master page. So, we had to create the base class for that and added the user control dynamically to the page.. but when we moved to ASP.NET 2.0, we don't need that concept anymore..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
When we were using ASP.NET 1x, there is no build-in master page. So, we had to create the base class for that and added the user control dynamically to the page.. but when we moved to ASP.NET 2.0, we don't need that concept anymore..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Hmm Thanks Buddy :)
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "