Looking for ASP.NET Advice

J

Jonathan Wood

I'm having a difficult time making the transition to .NET. I came up with
some projects to get me started and, in every case, they involved tasks that
were apparently difficult to accomplish and/or difficult to get information
about.

One item is a menu that is based on a database. My thinking is that I would
create some custom controls that query the database and display several
menus based on the data. I posted questions about this months ago and got
virtually no response.

Can anyone here tell me the basics of what is involved in creating custom
controls like this? I have a book that seems to suggest I need to create a
separate DLL. Can't I just create a class that emits the appropriate data
when called? Do I need to do anything special? Any examples?

Thanks for any input.
 
M

Mark Rae

I'm having a difficult time making the transition to .NET. I came up with
some projects to get me started and, in every case, they involved tasks
that
were apparently difficult to accomplish and/or difficult to get
information
about.

Since you've posted in a newsgroup dedicated to ASP.NET, I'll assume your
current .NET question relates to web applications...
One item is a menu that is based on a database. My thinking is that I
would
create some custom controls that query the database and display several
menus based on the data. I posted questions about this months ago and got
virtually no response.

There is no need to create a custom control to provide menus in ASP.NET 2,
as there is already a built-in one - <asp:Menu>, in fact... It can be
hard-coded:

http://msdn2.microsoft.com/en-us/library/ecs0x9w5.aspx

or created dynamically, as your requirements dictate... This could be
constructed from data fetched from a database, or from an XML source:

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.menuitem.aspx
I have a book that seems to suggest I need to create a separate DLL.

There's no need whatever to create a separate DLL to create a menu in
ASP.NET.
 
J

Jonathan Wood

Mark,
Since you've posted in a newsgroup dedicated to ASP.NET, I'll assume your
current .NET question relates to web applications...

Yes, I wasn't aware ASP.NET was being used for anything else.
There is no need to create a custom control to provide menus in ASP.NET 2,
as there is already a built-in one - <asp:Menu>, in fact... It can be
hard-coded:

As indicated, I want to create a custom control.

There are two reasons for this: 1) I have a completely unique look needed
for these menus using bitmaps and links based on data in a custom database,
and 2) I want to learn how to create completely custom Web objects.
There's no need whatever to create a separate DLL to create a menu in
ASP.NET.

Unfortunately, I'm now left wondering if this is true because I can simply
create custom classes that emit whatever HTML I want, or it's true only if
one assumes I'll be using the ASP Menu control.
 
E

Erik Funkenbusch

I'm having a difficult time making the transition to .NET. I came up with
some projects to get me started and, in every case, they involved tasks that
were apparently difficult to accomplish and/or difficult to get information
about.

It might help if you could define your problem more clearly.
One item is a menu that is based on a database. My thinking is that I would
create some custom controls that query the database and display several
menus based on the data. I posted questions about this months ago and got
virtually no response.

If this is the extent of your problem description it's understandable why
you got no response. You've not given any real detail about what you want.
Your question is vague. What kind of menu? A drop-down menu? a
navigation menu? a combo-box?

If you want help, the more detailed you are the more information someone
has to help you.
Can anyone here tell me the basics of what is involved in creating custom
controls like this? I have a book that seems to suggest I need to create a
separate DLL. Can't I just create a class that emits the appropriate data
when called? Do I need to do anything special? Any examples?

Controls in ASP.NET are web pages, just like any other, except they can be
embedded in other pages. They can use DLL's or not.
 
J

Jonathan Wood

Interesting site. I've added it to my favorites and will try my luck with it
later.

Thanks!
 
J

Jonathan Wood

Erik,

It might help if you could define your problem more clearly.

I thought I did below. I was just express some frustration I'm having. I
didn't for a minute ever think anyone would be able to resolve all of the
issues I'm experiencing.
If this is the extent of your problem description it's understandable why
you got no response. You've not given any real detail about what you
want.
Your question is vague. What kind of menu? A drop-down menu? a
navigation menu? a combo-box?

If you want help, the more detailed you are the more information someone
has to help you.

That's really not the question. In this case, it would be a type of
navigation menu. But what I want is to create a custom control that I render
myself from scratch by emitting the HTML code. That seems fairly specific to
me as I'll worry about exactly what those contents will be.
 
R

Robbe Morris [C# MVP]

I think you are looking for stuff like this for modifying
native controls to custom controls.

http://www.eggheadcafe.com/tutorial...9355-f85da3698fbc/an-xmldriven-selfcachi.aspx

--
Robbe Morris - 2004-2006 Microsoft MVP C#
I've mapped the database to .NET class properties and methods to
implement an multi-layered object oriented environment for your
data access layer. Thus, you should rarely ever have to type the words
SqlCommand, SqlDataAdapter, or SqlConnection again.
http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp
 
R

Registered User

I'm having a difficult time making the transition to .NET. I came up with
some projects to get me started and, in every case, they involved tasks that
were apparently difficult to accomplish and/or difficult to get information
about.

One item is a menu that is based on a database. My thinking is that I would
create some custom controls that query the database and display several
menus based on the data. I posted questions about this months ago and got
virtually no response.

Can anyone here tell me the basics of what is involved in creating custom
controls like this?
MSDN is a good place to start. Include the word walkthrough in your
search terms.
I have a book that seems to suggest I need to create a
separate DLL. Can't I just create a class that emits the appropriate data
when called?
A DLL is not required unless the control is intended for use in
multiple projects.
Do I need to do anything special? Any examples?
The MSDN walkthroughs should provide all the basics.

regards
A.G.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top