FIRST TIME - (he he)

N

news.microsoft.com

Hi there,
Yes it's my first time building ASP.NET controls.
I need to add specific functinality to an Infragistics TreeView control.
So I try to create my FilippoTreeView, inheriting from the Infragistics one.

Please tell me if I am wrong.
1) First, you add to a new page your Infragistics control and then make the
changes you want to mimic your expected behaviour.
2) Second, you rename the new page to *.ASCX
3) Third, you rename the <%@ Page ... to <% @Control...

4) Fourth, you add a ASPX page to test the new control.
5) Fifth, and this is where I get lost, you drop the newly created component
on your ASPX form


Well, here is my problem.
1) When droppping the control the ASPX form, Visually at design time, it
does not display appear as on the ASCX.
2) When I right click on my control, it does not show the Infragistics
PopupMenu.
3) On the CodeBehind, I do not get a variable reference to my control.

HELPPPP !!!!

Thanks for your comprehension ...:)
Filippo.
 
V

Victor Garcia Aprea [MVP]

Hi Filippo,

I don't know the Infragistics controls but it seems like you're actually
looking to create an user control containing an Infragistics's TreeView? or
do you want to create a brand new control deriving from Infragistics's
TreeView?

Please give us some more details,

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
 
F

Filippo Pandiani

Well,
I have a web site that has over 300 pages.
Each page has an TreeView that displays the current selected node, what
sections are currently expanded and what major root level sections have been
already succesfully answered.

For each page, I have to hardcode the current node with a different color,
and then run a procedures that reads from my session object what sections
have been successfully answered.

So I thought that if I did create a Custom Control from my current TreeView
(which happens to be Infragistics),
I could write some events on the Page_Load that read specific session values
that will identify what sections are answered, and I could store on another
specific session value the current node selected.

This will allow me to reduce my coding ...repeated coding in more than 300
pages, so you can immagine the ammount of time saved.

Therefore, mainly I need the following.
to have a Treeview that allows me to create Nodes at wish (using the
existing right click capabilities offered by the Infragistics component) and
that on each page load, reads or saves it state on the session variable.

Something like
==================
if (!Page.IsPostBack)
{
ReadTreeValuesFromSession();
}
else
{
SaveTreeValuesToSession();
}
====================

Then on each procedure I will simply save specific values on the session
object.
I know I can do that using another language, and I am pretty sure it's
duable using ASP.NET

Thanks,
Filippo.
 
V

Victor Garcia Aprea [MVP]

So I thought that if I did create a Custom Control from my current
TreeViewI believe you're looking into creating an user control (not a custom
control), that is, an .ascx. You should definitively try to avoid hardcoding
300 pages.
variable.
I don't know the specifics for the Ingragistics control, but I would assume
that -as with any other treeview control- you could dynamically add and
remove nodes to it. So it should be pretty simple to generate its node tree
based on some data stored on session. What specific problems are you getting
while trying an approach like this? It is an Infragistic's TreeView's error?
If so, have you tried their tech support?

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
 
F

Filippo Pandiani

Current problems?

Well,
I wrote the code for the component but when I drop it on a test webform:
1) I don't get the Node Editor that normally comes up using the right click,
2) I don't get a variable on the codebehind that will allow me to reach the
component from my code...

I am not quite sure what exactly is the difference between custom control
and user control.


P.S> So far each page has 4-5 lines of code only, so it's good to be able to
use OO on web pages... still, I would like to optimize the HTML side now and
that's why I want to be able
to write my own component that read from the session it's values.

HELP !!!!!

Thanks Victor ....:)
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top