User Controls
-
Hi, Please look at www.sahometraders.co.za. I have to do the website in ASP.NET, and I want to get started with the top menu. People say that I must use a user control for this. I'm not entirely sure how to do this. I will be using C#. COuld someone please send some sample code, or give me a link where I can download some good sample code on how to create this type of control. Any links to other good articles will be appreciated. When will I use user controls? People say I must use a an includes files, so if I were to use an include file in the old ASP, would I then just have to create a user control every time? BRENDAN
-
Hi, Please look at www.sahometraders.co.za. I have to do the website in ASP.NET, and I want to get started with the top menu. People say that I must use a user control for this. I'm not entirely sure how to do this. I will be using C#. COuld someone please send some sample code, or give me a link where I can download some good sample code on how to create this type of control. Any links to other good articles will be appreciated. When will I use user controls? People say I must use a an includes files, so if I were to use an include file in the old ASP, would I then just have to create a user control every time? BRENDAN
I think you care too much about what ppl say than to find out on your own.;) anywho, IMHO, you should read up on user controls, user controls are usually good for static content, for more advanced usage you can always take a look at the mighty server controls. As for examples you can google for it. As for including the file, in user controls all you have to do is to put a user control onto your file so that at the page rendering time, asp.net can render it for you.. HTH... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
Hi, Please look at www.sahometraders.co.za. I have to do the website in ASP.NET, and I want to get started with the top menu. People say that I must use a user control for this. I'm not entirely sure how to do this. I will be using C#. COuld someone please send some sample code, or give me a link where I can download some good sample code on how to create this type of control. Any links to other good articles will be appreciated. When will I use user controls? People say I must use a an includes files, so if I were to use an include file in the old ASP, would I then just have to create a user control every time? BRENDAN
Brendan Vogt wrote: COuld someone please send some sample code, or give me a link Have a look at some articles below that will give you some ideas on how to make a page template: http://authors.aspalliance.com/PaulWilson/Articles/?id=14[^] http://www.codeproject.com/aspnet/PageFramework.asp[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-simulatinginclude.asp[^] Surely, there are a number of resources available out there. Brendan Vogt wrote: When will I use user controls? In addition to the controls available to developers in the Toolbox, you also can use custom controls to encapsulate key aspects of user interface and program logic that you want to reuse throught out your application. Basically, there are three types of custom controls: Web User Control, Composite Control, and Template Control ( or Rendered Control). Web User controls reside in content files which have the .ascx extension, so they must be included in the application that you want to use. Both composite and template controls can be compiled and persisted as an assembly, so they can be shared between multiple applications. For more information see Developing ASP.NET Server Controls[^]