First time building ASP.NET controls

N

news.microsoft.com

Hello there,
I need to add specific functionality to an Infragistics TreeView control.
So I decided to inherit from create the Infragistics control and create my
own one.

Please tell me what I am doing 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.


Filippo.


Here is the code of my Control.
==========================
<%@ Register TagPrefix="ignav"
Namespace="Infragistics.WebUI.UltraWebNavigator"
Assembly="Infragistics.WebUI.UltraWebNavigator.v2" %>
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="cmTree.ascx.cs" Inherits="cmTree.cmTree"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<ignav:ultrawebtree id="trvMain" runat="server" BackColor="#F1F1F1"
ForeColor="#102B46" Height="247px" Width="224px" FileFlags="StylesOnly"
Cursor="hand" Font-Size="11px" Font-Names="Verdana" Indentation="15"
ExpandImage="plus.gif" CollapseImage="minus.gif"
JavaScriptFilename="/ig_scripts2/ig_webtree2.js"
ImageDirectory="/ig_Images2/" WebTreeTarget="ClassicTree"
HoverClass="HoverClass">
<Styles>
<ignav:Style Font-Size="11px" Font-Names="Verdana" Font-Bold="True"
ForeColor="#102B46" CssClass="DefaultItemClass"></ignav:Style>
<ignav:Style Font-Size="11px" Font-Names="Verdana" ForeColor="#102B46"
CssClass="TreeClass"></ignav:Style>
<ignav:Style Font-Size="11px" Font-Names="Verdana" Font-Bold="True"
ForeColor="#FF6600" CssClass="HoverClass"></ignav:Style>
<ignav:Style Font-Size="11px" Font-Names="Verdana" ForeColor="#FF6600"
CssClass="HoverSubClass"></ignav:Style>
</Styles>
<Nodes>
<ignav:Node TagString="" Expanded="True" Text="1 - ONE" HiliteClass=""
CssClass="">
<Style Font-Bold="True" ForeColor="#FF6600">
</Style>
</ignav:Node>
<ignav:Node TagString="" Text="2 - TWO" HiliteClass="" CssClass="">
<Style Font-Bold="True">
</Style>
</ignav:Node>
</Nodes>
<Levels>
<ignav:Level LevelHoverClass="" LevelHiliteClass="" LevelClass=""
Index="0"></ignav:Level>
<ignav:Level LevelHoverClass="HoverSubClass" LevelClass="TreeClass"
Index="1"></ignav:Level>
</Levels>
</ignav:ultrawebtree>
==========================


AND THIS IS WHAT APPEARS ON MY TEST FORM
==========================
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false"
Inherits="cmTree.WebForm2" %>
<%@ Register TagPrefix="uc1" TagName="cmTree" Src="cmTree.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="WebForm2" method="post" runat="server">
<uc1:cmTree id="CmTree1" runat="server"></uc1:cmTree>
</form>
</body>
</HTML>
==========================


BUT LIKE I SAID, I GET NOT REFERENCE ON MY CODE BEHIND CS FILE.


?????
 
A

Alvin Bruney

this is not an infragistics support site. if you paid for the control, they
offer technical support on their website.
 
F

Filippo Pandiani

Thanks for your update,
I was simply looking to learn how to write a Custom Control.

Would it make a difference if the control I inherit from is a VS control?


Filippo.
 
A

Alvin Bruney

Yup, it makes a big difference. How does infragistics control come into the
picture? Are you wanting to build a control from infragistics template? or
MS control?
 
F

Filippo Pandiani

Maybe it's me,
....but I don't see the difference between starting from a MS control or from
an Infragistics control.

My ideal scenario is to have my TreeView control, inherited from
Infragistics with some code on the Page Load of the control itself. The
Control should allow me to add nodes at design time, via the standard
Infragistics popupmenu options.


F.
 
A

Alvin Bruney

There is a big difference. infragistics code are wrappers around stale COM
technology. .NET controls a pure bred. If the is not a big deal for you,
then it shouldn't matter, otherwise it will
 
A

Alvin Bruney

I apologize if I got this wrong. I was taught this in a tech ed class last
week.

You are saying that infragistics does not wrap COM objects, whether they be
for the chart products or otherwise?
Thanks for the correction.
 
F

Filippo Pandiani

Dear Tim,
The reason why I am posting this entry here is because I already posted the
same entry on the Infragistics long time ago, and got no answer from your
team or from other Infragsitics users.


Thanks,
Filippo.
 
F

Filippo Pandiani

OK,
So... what shall I do ??


F.




Filippo Pandiani said:
Maybe it's me,
...but I don't see the difference between starting from a MS control or from
an Infragistics control.

My ideal scenario is to have my TreeView control, inherited from
Infragistics with some code on the Page Load of the control itself. The
Control should allow me to add nodes at design time, via the standard
Infragistics popupmenu options.


F.
 

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,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top