473,699 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inclusion of user control within custom control

I am trying to create a project using the ASP.NET AJAX accordion control. I
would like to dynamically add panes to the control with a form template added
when the pane is added. I have tried unsuccessfully in creating the whole
pane as a user control and have succeeded in adding the pane and then
dynamically adding the content which is a user control to the pane,
dynamically within the page.

However I would like to have a single pane control which I can add which
includes the header and content. I therefore was trying to find a way to
create a custom control derived from Pane which has the User control as the
content. I cannot however find a way to add the user control to the custom
control. Is this possible to do, or do I need to just create the content from
the standard controls rather than as a user control?

Thanks,
Richard
Oct 2 '08 #1
4 2482
Hi Richard,

From your description you want to create a sub class of AccordionPane and
add your usercontrol as the header&content, right? If so one important
thing is, the initialization of the usercontrol is a bit different. We have
to use Page.LoadContro l to load the usercontrol, otherwise, the controls
defined in the aspx of the usercontrol will not be recognized.

I wrote a sample here that demonstrates how to do this in detail:

Default.aspx:
<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt.aspx.cs"
Inherits="_Defa ult" %>

<%@ Register Assembly="AjaxC ontrolToolkit" Namespace="Ajax ControlToolkit"
TagPrefix="cc1" %>
<%@ Register src="ContentUse rControl.ascx" tagname="Conten tUserControl"
tagprefix="uc1" %>
<%@ Register src="HeaderUser Control.ascx" tagname="Header UserControl"
tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptMana ger ID="ScriptManag er1" runat="server">
</asp:ScriptManag er>

<cc1:Accordio n ID="Accordion1 " runat="server">

</cc1:Accordion>
</div>

</form>
</body>
</html>
Default.aspx.cs :
using System;
using System.Configur ation;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.H tmlControls;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Xml.Linq ;
using AjaxControlTool kit;

public partial class _Default : System.Web.UI.P age
{
protected void Page_Init(objec t sender, EventArgs e)
{

for (int i = 0; i < 5; i++)
{
ContentUserCont rol cuc =
Page.LoadContro l("ContentUserC ontrol.ascx") as ContentUserCont rol;
cuc.TestText = "ContentTes t" + i.ToString();
HeaderUserContr ol huc =
Page.LoadContro l("HeaderUserCo ntrol.ascx") as HeaderUserContr ol;
huc.TestHeader = "HeaderTest " + i.ToString();
this.Accordion1 .Panes.Add(new MyPane(new MyContentTempla te() {
UserControl = cuc }, new MyHeaderTemplat e(i) { UserControl = huc }));
}

}
}

public class MyPane : AccordionPane //In this simple scenario we can use
AccordionPane directly. I use MyPane to leave some room for further
customization.
{
public MyPane(MyConten tTemplate c, MyHeaderTemplat e h)
{
this.Header = h;
this.Content = c;
}
}

public class MyContentTempla te : ITemplate
{
public UserControl UserControl;
public void InstantiateIn(C ontrol container)
{
if (UserControl != null)
{

container.Contr ols.Add(UserCon trol);
}

}

}

public class MyHeaderTemplat e : ITemplate
{
//I just use Gray color to distinguish header from content. In a simple
scenario we can use the same Template.
public UserControl UserControl;
object _data;
public MyHeaderTemplat e(object data) { _data = data; }
public void InstantiateIn(C ontrol container)
{
Panel p = new Panel();
container.Contr ols.Add(p);
p.BackColor = System.Drawing. Color.Gray;
if (UserControl != null)
{ p.Controls.Add( UserControl); }
}

}

ContentUserCont rol.ascx:
<%@ Control Language="C#" AutoEventWireup ="true"
CodeFile="Conte ntUserControl.a scx.cs" Inherits="Conte ntUserControl" %>
<asp:Button ID="Button1" runat="server" Text="Button" onload="Button1 _Load"
/>

ContentUserCont rol.ascx.cs:
using System;
using System.Collecti ons;
using System.Configur ation;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.H tmlControls;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Xml.Linq ;

public partial class ContentUserCont rol : System.Web.UI.U serControl
{
string _testtext;
public string TestText {
get
{
return _testtext;
}
set { _testtext = value; }
}

protected void Button1_Load(ob ject sender, EventArgs e)
{
this.Button1.Te xt = _testtext;

}
}

HeaderUserContr ol.ascx:
<%@ Control Language="C#" AutoEventWireup ="true"
CodeFile="Heade rUserControl.as cx.cs" Inherits="Heade rUserControl" %>
<asp:Label ID="Label1" runat="server" Text="Label"
onload="Label1_ Load"></asp:Label>

HeaderUserContr ol.ascx.cs:
using System;
using System.Collecti ons;
using System.Configur ation;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.H tmlControls;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Xml.Linq ;

public partial class HeaderUserContr ol : System.Web.UI.U serControl
{
string _testheader;
public string TestHeader
{
get
{
return _testheader;

}
set
{
_testheader = value;
}
}

protected void Label1_Load(obj ect sender, EventArgs e)
{
this.Label1.Tex t = _testheader;
}
}
Please test my code to see if it's what you need and feel free to ask if
you have further questions.

Regards,
Allen Chen
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: Inclusion of user control within custom control
| thread-index: Ackkb+hIoSw9Bbo 2QfiVKwNIfLYdyg ==
| X-WBNR-Posting-Host: 65.55.21.8
| From: =?Utf-8?B?UmljaEI=?= <ri**********@c ommunity.nospam >
| Subject: Inclusion of user control within custom control
| Date: Thu, 2 Oct 2008 02:19:01 -0700
| Lines: 16
| Message-ID: <31************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Path: TK2MSFTNGHUB02. phx.gbl
| Xref: TK2MSFTNGHUB02. phx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:7711 6
| NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| I am trying to create a project using the ASP.NET AJAX accordion control.
I
| would like to dynamically add panes to the control with a form template
added
| when the pane is added. I have tried unsuccessfully in creating the whole
| pane as a user control and have succeeded in adding the pane and then
| dynamically adding the content which is a user control to the pane,
| dynamically within the page.
|
| However I would like to have a single pane control which I can add which
| includes the header and content. I therefore was trying to find a way to
| create a custom control derived from Pane which has the User control as
the
| content. I cannot however find a way to add the user control to the
custom
| control. Is this possible to do, or do I need to just create the content
from
| the standard controls rather than as a user control?
|
| Thanks,
| Richard
|

Oct 3 '08 #2
Thanks Allen,

you have understood my question correctly, although I was hoping that I
could load the user control in MyPane and encapsulate header and footer
totally within MyPane so that within the aspx I could just have
this.Accordion1 .Panes.Add(new MyPane()); rather than the aspx having to
know what is needed to fill the pane.

I assume however if there was some equivalent LoadControl method for the
MyPane custom control that you would have described that as a solution. This
solution works fine, though is not quite as neat as I would have liked.

Richard

"Allen Chen [MSFT]" <v-******@online.m icrosoft.comwro te in message
news:1d******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Richard,

From your description you want to create a sub class of AccordionPane and
add your usercontrol as the header&content, right? If so one important
thing is, the initialization of the usercontrol is a bit different. We
have
to use Page.LoadContro l to load the usercontrol, otherwise, the controls
defined in the aspx of the usercontrol will not be recognized.

I wrote a sample here that demonstrates how to do this in detail:

Default.aspx:
<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt.aspx.cs"
Inherits="_Defa ult" %>

<%@ Register Assembly="AjaxC ontrolToolkit" Namespace="Ajax ControlToolkit"
TagPrefix="cc1" %>
<%@ Register src="ContentUse rControl.ascx" tagname="Conten tUserControl"
tagprefix="uc1" %>
<%@ Register src="HeaderUser Control.ascx" tagname="Header UserControl"
tagprefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitl ed Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptMana ger ID="ScriptManag er1" runat="server">
</asp:ScriptManag er>

<cc1:Accordio n ID="Accordion1 " runat="server">

</cc1:Accordion>
</div>

</form>
</body>
</html>
Default.aspx.cs :
using System;
using System.Configur ation;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.H tmlControls;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Xml.Linq ;
using AjaxControlTool kit;

public partial class _Default : System.Web.UI.P age
{
protected void Page_Init(objec t sender, EventArgs e)
{

for (int i = 0; i < 5; i++)
{
ContentUserCont rol cuc =
Page.LoadContro l("ContentUserC ontrol.ascx") as ContentUserCont rol;
cuc.TestText = "ContentTes t" + i.ToString();
HeaderUserContr ol huc =
Page.LoadContro l("HeaderUserCo ntrol.ascx") as HeaderUserContr ol;
huc.TestHeader = "HeaderTest " + i.ToString();
this.Accordion1 .Panes.Add(new MyPane(new MyContentTempla te() {
UserControl = cuc }, new MyHeaderTemplat e(i) { UserControl = huc }));
}

}
}

public class MyPane : AccordionPane //In this simple scenario we can use
AccordionPane directly. I use MyPane to leave some room for further
customization.
{
public MyPane(MyConten tTemplate c, MyHeaderTemplat e h)
{
this.Header = h;
this.Content = c;
}
}

public class MyContentTempla te : ITemplate
{
public UserControl UserControl;
public void InstantiateIn(C ontrol container)
{
if (UserControl != null)
{

container.Contr ols.Add(UserCon trol);
}

}

}

public class MyHeaderTemplat e : ITemplate
{
//I just use Gray color to distinguish header from content. In a simple
scenario we can use the same Template.
public UserControl UserControl;
object _data;
public MyHeaderTemplat e(object data) { _data = data; }
public void InstantiateIn(C ontrol container)
{
Panel p = new Panel();
container.Contr ols.Add(p);
p.BackColor = System.Drawing. Color.Gray;
if (UserControl != null)
{ p.Controls.Add( UserControl); }
}

}

ContentUserCont rol.ascx:
<%@ Control Language="C#" AutoEventWireup ="true"
CodeFile="Conte ntUserControl.a scx.cs" Inherits="Conte ntUserControl" %>
<asp:Button ID="Button1" runat="server" Text="Button"
onload="Button1 _Load"
/>

ContentUserCont rol.ascx.cs:
using System;
using System.Collecti ons;
using System.Configur ation;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.H tmlControls;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Xml.Linq ;

public partial class ContentUserCont rol : System.Web.UI.U serControl
{
string _testtext;
public string TestText {
get
{
return _testtext;
}
set { _testtext = value; }
}

protected void Button1_Load(ob ject sender, EventArgs e)
{
this.Button1.Te xt = _testtext;

}
}

HeaderUserContr ol.ascx:
<%@ Control Language="C#" AutoEventWireup ="true"
CodeFile="Heade rUserControl.as cx.cs" Inherits="Heade rUserControl" %>
<asp:Label ID="Label1" runat="server" Text="Label"
onload="Label1_ Load"></asp:Label>

HeaderUserContr ol.ascx.cs:
using System;
using System.Collecti ons;
using System.Configur ation;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.H tmlControls;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Xml.Linq ;

public partial class HeaderUserContr ol : System.Web.UI.U serControl
{
string _testheader;
public string TestHeader
{
get
{
return _testheader;

}
set
{
_testheader = value;
}
}

protected void Label1_Load(obj ect sender, EventArgs e)
{
this.Label1.Tex t = _testheader;
}
}
Please test my code to see if it's what you need and feel free to ask if
you have further questions.

Regards,
Allen Chen
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
| Thread-Topic: Inclusion of user control within custom control
| thread-index: Ackkb+hIoSw9Bbo 2QfiVKwNIfLYdyg ==
| X-WBNR-Posting-Host: 65.55.21.8
| From: =?Utf-8?B?UmljaEI=?= <ri**********@c ommunity.nospam >
| Subject: Inclusion of user control within custom control
| Date: Thu, 2 Oct 2008 02:19:01 -0700
| Lines: 16
| Message-ID: <31************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Path: TK2MSFTNGHUB02. phx.gbl
| Xref: TK2MSFTNGHUB02. phx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:7711 6
| NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| I am trying to create a project using the ASP.NET AJAX accordion
control.
I
| would like to dynamically add panes to the control with a form template
added
| when the pane is added. I have tried unsuccessfully in creating the
whole
| pane as a user control and have succeeded in adding the pane and then
| dynamically adding the content which is a user control to the pane,
| dynamically within the page.
|
| However I would like to have a single pane control which I can add which
| includes the header and content. I therefore was trying to find a way to
| create a custom control derived from Pane which has the User control as
the
| content. I cannot however find a way to add the user control to the
custom
| control. Is this possible to do, or do I need to just create the content
from
| the standard controls rather than as a user control?
|
| Thanks,
| Richard
|

Oct 3 '08 #3
Hi Richard,

This is also possible. Here's the updated version:

public partial class _Default : System.Web.UI.P age
{
protected void Page_Init(objec t sender, EventArgs e)
{

for (int i = 0; i < 5; i++)
{

this.Accordion1 .Panes.Add(new MyPane());
}

}
}

public class MyPane : AccordionPane
{
static Random random=new Random();
public MyPane()
{
this.Init += new EventHandler(My Pane_Init);

}

void MyPane_Init(obj ect sender, EventArgs e)
{
int test = random.Next(0, 100);
ContentUserCont rol cuc =
this.Page.LoadC ontrol("Content UserControl.asc x") as ContentUserCont rol;
cuc.TestText = "ContentTes t_" + test;
HeaderUserContr ol huc =
this.Page.LoadC ontrol("HeaderU serControl.ascx ") as HeaderUserContr ol;
huc.TestHeader = "HeaderTest _" + test;
this.Header = new MyHeaderTemplat e() { UserControl = huc };
this.Content = new MyContentTempla te() { UserControl = cuc };
}

}

The key point is to use the Control.Page property. Another note is, we
generally do this in the Init event handler. If we get the Page property in
the constructor method the property is null since no value has been
assigned to it. If we do this in a later event than the Init some page life
cycle puzzle would probably happen.

Please have a try and let me know if it works.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| From: "RichB" <ri**********@c ommunity.nospam >
| References: <31************ *************** *******@microso ft.com>
<1d************ **@TK2MSFTNGHUB 02.phx.gbl>
| Subject: Re: Inclusion of user control within custom control
| Date: Fri, 3 Oct 2008 14:17:55 +0100
| Lines: 317
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#l************ **@TK2MSFTNGP05 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 93-96-97-68.zone4.bether e.co.uk 93.96.97.68
| Path: TK2MSFTNGHUB02. phx.gbl!TK2MSFT NGP01.phx.gbl!T K2MSFTNGP05.phx .gbl
| Xref: TK2MSFTNGHUB02. phx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:7722 1
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thanks Allen,
|
| you have understood my question correctly, although I was hoping that I
| could load the user control in MyPane and encapsulate header and footer
| totally within MyPane so that within the aspx I could just have
| this.Accordion1 .Panes.Add(new MyPane()); rather than the aspx having to
| know what is needed to fill the pane.
|
| I assume however if there was some equivalent LoadControl method for the
| MyPane custom control that you would have described that as a solution.
This
| solution works fine, though is not quite as neat as I would have liked.
|
| Richard
|
| "Allen Chen [MSFT]" <v-******@online.m icrosoft.comwro te in message
| news:1d******** ******@TK2MSFTN GHUB02.phx.gbl. ..
| Hi Richard,
| >
| From your description you want to create a sub class of AccordionPane
and
| add your usercontrol as the header&content, right? If so one important
| thing is, the initialization of the usercontrol is a bit different. We
| have
| to use Page.LoadContro l to load the usercontrol, otherwise, the controls
| defined in the aspx of the usercontrol will not be recognized.
| >
| I wrote a sample here that demonstrates how to do this in detail:
| >
| Default.aspx:
| <%@ Page Language="C#" AutoEventWireup ="true"
CodeFile="Defau lt.aspx.cs"
| Inherits="_Defa ult" %>
| >
| <%@ Register Assembly="AjaxC ontrolToolkit"
Namespace="Ajax ControlToolkit"
| TagPrefix="cc1" %>
| >
| >
| <%@ Register src="ContentUse rControl.ascx" tagname="Conten tUserControl"
| tagprefix="uc1" %>
| <%@ Register src="HeaderUser Control.ascx" tagname="Header UserControl"
| tagprefix="uc2" %>
| >
| >
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
| >
| <html xmlns="http://www.w3.org/1999/xhtml">
| <head runat="server">
| <title>Untitl ed Page</title>
| </head>
| <body>
| <form id="form1" runat="server">
| <div>
| <asp:ScriptMana ger ID="ScriptManag er1" runat="server">
| </asp:ScriptManag er>
| >
| <cc1:Accordio n ID="Accordion1 " runat="server">
| >
| </cc1:Accordion>
| </div>
| >
| >
| >
| </form>
| </body>
| </html>
| >
| >
| Default.aspx.cs :
| using System;
| using System.Configur ation;
| using System.Data;
| using System.Linq;
| using System.Web;
| using System.Web.Secu rity;
| using System.Web.UI;
| using System.Web.UI.H tmlControls;
| using System.Web.UI.W ebControls;
| using System.Web.UI.W ebControls.WebP arts;
| using System.Xml.Linq ;
| using AjaxControlTool kit;
| >
| public partial class _Default : System.Web.UI.P age
| {
| protected void Page_Init(objec t sender, EventArgs e)
| {
| >
| for (int i = 0; i < 5; i++)
| {
| ContentUserCont rol cuc =
| Page.LoadContro l("ContentUserC ontrol.ascx") as ContentUserCont rol;
| cuc.TestText = "ContentTes t" + i.ToString();
| HeaderUserContr ol huc =
| Page.LoadContro l("HeaderUserCo ntrol.ascx") as HeaderUserContr ol;
| huc.TestHeader = "HeaderTest " + i.ToString();
| this.Accordion1 .Panes.Add(new MyPane(new MyContentTempla te()
{
| UserControl = cuc }, new MyHeaderTemplat e(i) { UserControl = huc }));
| }
| >
| }
| >
| >
| }
| >
| public class MyPane : AccordionPane //In this simple scenario we can
use
| AccordionPane directly. I use MyPane to leave some room for further
| customization.
| {
| public MyPane(MyConten tTemplate c, MyHeaderTemplat e h)
| {
| this.Header = h;
| this.Content = c;
| }
| }
| >
| public class MyContentTempla te : ITemplate
| {
| >
| >
| public UserControl UserControl;
| public void InstantiateIn(C ontrol container)
| {
| if (UserControl != null)
| {
| >
| container.Contr ols.Add(UserCon trol);
| }
| >
| }
| >
| }
| >
| public class MyHeaderTemplat e : ITemplate
| {
| //I just use Gray color to distinguish header from content. In a
simple
| scenario we can use the same Template.
| public UserControl UserControl;
| object _data;
| public MyHeaderTemplat e(object data) { _data = data; }
| public void InstantiateIn(C ontrol container)
| {
| Panel p = new Panel();
| container.Contr ols.Add(p);
| p.BackColor = System.Drawing. Color.Gray;
| if (UserControl != null)
| { p.Controls.Add( UserControl); }
| >
| >
| }
| >
| }
| >
| ContentUserCont rol.ascx:
| <%@ Control Language="C#" AutoEventWireup ="true"
| CodeFile="Conte ntUserControl.a scx.cs" Inherits="Conte ntUserControl" %>
| <asp:Button ID="Button1" runat="server" Text="Button"
| onload="Button1 _Load"
| />
| >
| ContentUserCont rol.ascx.cs:
| using System;
| using System.Collecti ons;
| using System.Configur ation;
| using System.Data;
| using System.Linq;
| using System.Web;
| using System.Web.Secu rity;
| using System.Web.UI;
| using System.Web.UI.H tmlControls;
| using System.Web.UI.W ebControls;
| using System.Web.UI.W ebControls.WebP arts;
| using System.Xml.Linq ;
| >
| public partial class ContentUserCont rol : System.Web.UI.U serControl
| {
| string _testtext;
| public string TestText {
| get
| {
| return _testtext;
| }
| set { _testtext = value; }
| }
| >
| protected void Button1_Load(ob ject sender, EventArgs e)
| {
| this.Button1.Te xt = _testtext;
| >
| }
| }
| >
| HeaderUserContr ol.ascx:
| <%@ Control Language="C#" AutoEventWireup ="true"
| CodeFile="Heade rUserControl.as cx.cs" Inherits="Heade rUserControl" %>
| <asp:Label ID="Label1" runat="server" Text="Label"
| onload="Label1_ Load"></asp:Label>
| >
| HeaderUserContr ol.ascx.cs:
| using System;
| using System.Collecti ons;
| using System.Configur ation;
| using System.Data;
| using System.Linq;
| using System.Web;
| using System.Web.Secu rity;
| using System.Web.UI;
| using System.Web.UI.H tmlControls;
| using System.Web.UI.W ebControls;
| using System.Web.UI.W ebControls.WebP arts;
| using System.Xml.Linq ;
| >
| public partial class HeaderUserContr ol : System.Web.UI.U serControl
| {
| string _testheader;
| public string TestHeader
| {
| get
| {
| return _testheader;
| >
| }
| set
| {
| _testheader = value;
| }
| }
| >
| protected void Label1_Load(obj ect sender, EventArgs e)
| {
| this.Label1.Tex t = _testheader;
| }
| }
| >
| >
| Please test my code to see if it's what you need and feel free to ask if
| you have further questions.
| >
| Regards,
| Allen Chen
| Microsoft Online Community Support
| >
| >
| Delighting our customers is our #1 priority. We welcome your comments
and
| suggestions about how we can improve the support we provide to you.
Please
| feel free to let my manager know what you think of the level of service
| provided. You can send feedback directly to my manager at:
| ms****@microsof t.com.
| >
| =============== =============== =============== =====
| Get notification to my posts through email? Please refer to
| >
http://msdn.microsoft.com/en-us/subs...#notifications.
| >
| Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
| where an initial response from the community or a Microsoft Support
| Engineer within 1 business day is acceptable. Please note that each
follow
| up response may take approximately 2 business days as the support
| professional working with you may need further investigation to reach
the
| most efficient resolution. The offering is not appropriate for
situations
| that require urgent, real-time or phone-based interactions or complex
| project analysis and dump analysis issues. Issues of this nature are
best
| handled working with a dedicated Microsoft Support Engineer by
contacting
| Microsoft Customer Support Services (CSS) at
| >
http://support.microsoft.com/select/...tance&ln=en-us.
| =============== =============== =============== =====
| This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| --------------------
| | Thread-Topic: Inclusion of user control within custom control
| | thread-index: Ackkb+hIoSw9Bbo 2QfiVKwNIfLYdyg ==
| | X-WBNR-Posting-Host: 65.55.21.8
| | From: =?Utf-8?B?UmljaEI=?= <ri**********@c ommunity.nospam >
| | Subject: Inclusion of user control within custom control
| | Date: Thu, 2 Oct 2008 02:19:01 -0700
| | Lines: 16
| | Message-ID: <31************ *************** *******@microso ft.com>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | Path: TK2MSFTNGHUB02. phx.gbl
| | Xref: TK2MSFTNGHUB02. phx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:7711 6
| | NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | I am trying to create a project using the ASP.NET AJAX accordion
| control.
| I
| | would like to dynamically add panes to the control with a form
template
| added
| | when the pane is added. I have tried unsuccessfully in creating the
| whole
| | pane as a user control and have succeeded in adding the pane and then
| | dynamically adding the content which is a user control to the pane,
| | dynamically within the page.
| |
| | However I would like to have a single pane control which I can add
which
| | includes the header and content. I therefore was trying to find a way
to
| | create a custom control derived from Pane which has the User control
as
| the
| | content. I cannot however find a way to add the user control to the
| custom
| | control. Is this possible to do, or do I need to just create the
content
| from
| | the standard controls rather than as a user control?
| |
| | Thanks,
| | Richard
| |
| >
|
|
|

Oct 6 '08 #4
Thanks Allen, exactly what I wanted... I had tried using Page.LoadContro l in
the constructor, but received the NullReferenceEx ception so thought that
this was a dead end.

Think I need to investigate deeper exactly what happens in the page
lifecycle, and in hindsight I probably could have asked the question better.

Many thanks though.

Richard
"Allen Chen [MSFT]" <v-******@online.m icrosoft.comwro te in message
news:e5******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hi Richard,

This is also possible. Here's the updated version:

public partial class _Default : System.Web.UI.P age
{
protected void Page_Init(objec t sender, EventArgs e)
{

for (int i = 0; i < 5; i++)
{

this.Accordion1 .Panes.Add(new MyPane());
}

}
}

public class MyPane : AccordionPane
{
static Random random=new Random();
public MyPane()
{
this.Init += new EventHandler(My Pane_Init);

}

void MyPane_Init(obj ect sender, EventArgs e)
{
int test = random.Next(0, 100);
ContentUserCont rol cuc =
this.Page.LoadC ontrol("Content UserControl.asc x") as ContentUserCont rol;
cuc.TestText = "ContentTes t_" + test;
HeaderUserContr ol huc =
this.Page.LoadC ontrol("HeaderU serControl.ascx ") as HeaderUserContr ol;
huc.TestHeader = "HeaderTest _" + test;
this.Header = new MyHeaderTemplat e() { UserControl = huc };
this.Content = new MyContentTempla te() { UserControl = cuc };
}

}

The key point is to use the Control.Page property. Another note is, we
generally do this in the Init event handler. If we get the Page property
in
the constructor method the property is null since no value has been
assigned to it. If we do this in a later event than the Init some page
life
cycle puzzle would probably happen.

Please have a try and let me know if it works.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| From: "RichB" <ri**********@c ommunity.nospam >
| References: <31************ *************** *******@microso ft.com>
<1d************ **@TK2MSFTNGHUB 02.phx.gbl>
| Subject: Re: Inclusion of user control within custom control
| Date: Fri, 3 Oct 2008 14:17:55 +0100
| Lines: 317
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#l************ **@TK2MSFTNGP05 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 93-96-97-68.zone4.bether e.co.uk 93.96.97.68
| Path: TK2MSFTNGHUB02. phx.gbl!TK2MSFT NGP01.phx.gbl!T K2MSFTNGP05.phx .gbl
| Xref: TK2MSFTNGHUB02. phx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:7722 1
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thanks Allen,
|
| you have understood my question correctly, although I was hoping that I
| could load the user control in MyPane and encapsulate header and footer
| totally within MyPane so that within the aspx I could just have
| this.Accordion1 .Panes.Add(new MyPane()); rather than the aspx having to
| know what is needed to fill the pane.
|
| I assume however if there was some equivalent LoadControl method for the
| MyPane custom control that you would have described that as a solution.
This
| solution works fine, though is not quite as neat as I would have liked.
|
| Richard
|
| "Allen Chen [MSFT]" <v-******@online.m icrosoft.comwro te in message
| news:1d******** ******@TK2MSFTN GHUB02.phx.gbl. ..
| Hi Richard,
| >
| From your description you want to create a sub class of AccordionPane
and
| add your usercontrol as the header&content, right? If so one important
| thing is, the initialization of the usercontrol is a bit different. We
| have
| to use Page.LoadContro l to load the usercontrol, otherwise, the
controls
| defined in the aspx of the usercontrol will not be recognized.
| >
| I wrote a sample here that demonstrates how to do this in detail:
| >
| Default.aspx:
| <%@ Page Language="C#" AutoEventWireup ="true"
CodeFile="Defau lt.aspx.cs"
| Inherits="_Defa ult" %>
| >
| <%@ Register Assembly="AjaxC ontrolToolkit"
Namespace="Ajax ControlToolkit"
| TagPrefix="cc1" %>
| >
| >
| <%@ Register src="ContentUse rControl.ascx"
tagname="Conten tUserControl"
| tagprefix="uc1" %>
| <%@ Register src="HeaderUser Control.ascx" tagname="Header UserControl"
| tagprefix="uc2" %>
| >
| >
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
| >
| <html xmlns="http://www.w3.org/1999/xhtml">
| <head runat="server">
| <title>Untitl ed Page</title>
| </head>
| <body>
| <form id="form1" runat="server">
| <div>
| <asp:ScriptMana ger ID="ScriptManag er1" runat="server">
| </asp:ScriptManag er>
| >
| <cc1:Accordio n ID="Accordion1 " runat="server">
| >
| </cc1:Accordion>
| </div>
| >
| >
| >
| </form>
| </body>
| </html>
| >
| >
| Default.aspx.cs :
| using System;
| using System.Configur ation;
| using System.Data;
| using System.Linq;
| using System.Web;
| using System.Web.Secu rity;
| using System.Web.UI;
| using System.Web.UI.H tmlControls;
| using System.Web.UI.W ebControls;
| using System.Web.UI.W ebControls.WebP arts;
| using System.Xml.Linq ;
| using AjaxControlTool kit;
| >
| public partial class _Default : System.Web.UI.P age
| {
| protected void Page_Init(objec t sender, EventArgs e)
| {
| >
| for (int i = 0; i < 5; i++)
| {
| ContentUserCont rol cuc =
| Page.LoadContro l("ContentUserC ontrol.ascx") as ContentUserCont rol;
| cuc.TestText = "ContentTes t" + i.ToString();
| HeaderUserContr ol huc =
| Page.LoadContro l("HeaderUserCo ntrol.ascx") as HeaderUserContr ol;
| huc.TestHeader = "HeaderTest " + i.ToString();
| this.Accordion1 .Panes.Add(new MyPane(new
MyContentTempla te()
{
| UserControl = cuc }, new MyHeaderTemplat e(i) { UserControl = huc }));
| }
| >
| }
| >
| >
| }
| >
| public class MyPane : AccordionPane //In this simple scenario we can
use
| AccordionPane directly. I use MyPane to leave some room for further
| customization.
| {
| public MyPane(MyConten tTemplate c, MyHeaderTemplat e h)
| {
| this.Header = h;
| this.Content = c;
| }
| }
| >
| public class MyContentTempla te : ITemplate
| {
| >
| >
| public UserControl UserControl;
| public void InstantiateIn(C ontrol container)
| {
| if (UserControl != null)
| {
| >
| container.Contr ols.Add(UserCon trol);
| }
| >
| }
| >
| }
| >
| public class MyHeaderTemplat e : ITemplate
| {
| //I just use Gray color to distinguish header from content. In a
simple
| scenario we can use the same Template.
| public UserControl UserControl;
| object _data;
| public MyHeaderTemplat e(object data) { _data = data; }
| public void InstantiateIn(C ontrol container)
| {
| Panel p = new Panel();
| container.Contr ols.Add(p);
| p.BackColor = System.Drawing. Color.Gray;
| if (UserControl != null)
| { p.Controls.Add( UserControl); }
| >
| >
| }
| >
| }
| >
| ContentUserCont rol.ascx:
| <%@ Control Language="C#" AutoEventWireup ="true"
| CodeFile="Conte ntUserControl.a scx.cs" Inherits="Conte ntUserControl" %>
| <asp:Button ID="Button1" runat="server" Text="Button"
| onload="Button1 _Load"
| />
| >
| ContentUserCont rol.ascx.cs:
| using System;
| using System.Collecti ons;
| using System.Configur ation;
| using System.Data;
| using System.Linq;
| using System.Web;
| using System.Web.Secu rity;
| using System.Web.UI;
| using System.Web.UI.H tmlControls;
| using System.Web.UI.W ebControls;
| using System.Web.UI.W ebControls.WebP arts;
| using System.Xml.Linq ;
| >
| public partial class ContentUserCont rol : System.Web.UI.U serControl
| {
| string _testtext;
| public string TestText {
| get
| {
| return _testtext;
| }
| set { _testtext = value; }
| }
| >
| protected void Button1_Load(ob ject sender, EventArgs e)
| {
| this.Button1.Te xt = _testtext;
| >
| }
| }
| >
| HeaderUserContr ol.ascx:
| <%@ Control Language="C#" AutoEventWireup ="true"
| CodeFile="Heade rUserControl.as cx.cs" Inherits="Heade rUserControl" %>
| <asp:Label ID="Label1" runat="server" Text="Label"
| onload="Label1_ Load"></asp:Label>
| >
| HeaderUserContr ol.ascx.cs:
| using System;
| using System.Collecti ons;
| using System.Configur ation;
| using System.Data;
| using System.Linq;
| using System.Web;
| using System.Web.Secu rity;
| using System.Web.UI;
| using System.Web.UI.H tmlControls;
| using System.Web.UI.W ebControls;
| using System.Web.UI.W ebControls.WebP arts;
| using System.Xml.Linq ;
| >
| public partial class HeaderUserContr ol : System.Web.UI.U serControl
| {
| string _testheader;
| public string TestHeader
| {
| get
| {
| return _testheader;
| >
| }
| set
| {
| _testheader = value;
| }
| }
| >
| protected void Label1_Load(obj ect sender, EventArgs e)
| {
| this.Label1.Tex t = _testheader;
| }
| }
| >
| >
| Please test my code to see if it's what you need and feel free to ask
if
| you have further questions.
| >
| Regards,
| Allen Chen
| Microsoft Online Community Support
| >
| >
| Delighting our customers is our #1 priority. We welcome your comments
and
| suggestions about how we can improve the support we provide to you.
Please
| feel free to let my manager know what you think of the level of
service
| provided. You can send feedback directly to my manager at:
| ms****@microsof t.com.
| >
| =============== =============== =============== =====
| Get notification to my posts through email? Please refer to
| >
http://msdn.microsoft.com/en-us/subs...#notifications.
| >
| Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
| where an initial response from the community or a Microsoft Support
| Engineer within 1 business day is acceptable. Please note that each
follow
| up response may take approximately 2 business days as the support
| professional working with you may need further investigation to reach
the
| most efficient resolution. The offering is not appropriate for
situations
| that require urgent, real-time or phone-based interactions or complex
| project analysis and dump analysis issues. Issues of this nature are
best
| handled working with a dedicated Microsoft Support Engineer by
contacting
| Microsoft Customer Support Services (CSS) at
| >
http://support.microsoft.com/select/...tance&ln=en-us.
| =============== =============== =============== =====
| This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
| --------------------
| | Thread-Topic: Inclusion of user control within custom control
| | thread-index: Ackkb+hIoSw9Bbo 2QfiVKwNIfLYdyg ==
| | X-WBNR-Posting-Host: 65.55.21.8
| | From: =?Utf-8?B?UmljaEI=?= <ri**********@c ommunity.nospam >
| | Subject: Inclusion of user control within custom control
| | Date: Thu, 2 Oct 2008 02:19:01 -0700
| | Lines: 16
| | Message-ID: <31************ *************** *******@microso ft.com>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | Path: TK2MSFTNGHUB02. phx.gbl
| | Xref: TK2MSFTNGHUB02. phx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:7711 6
| | NNTP-Posting-Host: tk2msftibfm01.p hx.gbl 10.40.244.149
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | I am trying to create a project using the ASP.NET AJAX accordion
| control.
| I
| | would like to dynamically add panes to the control with a form
template
| added
| | when the pane is added. I have tried unsuccessfully in creating the
| whole
| | pane as a user control and have succeeded in adding the pane and
then
| | dynamically adding the content which is a user control to the pane,
| | dynamically within the page.
| |
| | However I would like to have a single pane control which I can add
which
| | includes the header and content. I therefore was trying to find a
way
to
| | create a custom control derived from Pane which has the User control
as
| the
| | content. I cannot however find a way to add the user control to the
| custom
| | control. Is this possible to do, or do I need to just create the
content
| from
| | the standard controls rather than as a user control?
| |
| | Thanks,
| | Richard
| |
| >
|
|
|

Oct 6 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1476
by: microdevsolutions | last post by:
Hello I am using ASP.NET - I have written a Custom Control (to output some information) that has a public property declared. I have a user control that is a wrapper around the above custom control. The code behind is nothing more than what is generated. The ascx is :- <%@ Control Language="vb" AutoEventWireup="false"
5
524
by: john | last post by:
I searched http://www.sellsbrothers.com. and could not find anything about this subject. How do I make C# User Controls Visible to Visual Basic 6.0 Applications? Thanks, John
4
2686
by: BBFrost | last post by:
We have a data entry application written within Framework 1.0 that contains 20+ custom user controls. The controls overlay each other so that only one custom control is visible at a time. What is the best way to keep the cursor from jumping to another non-visible control when the user tabs past the (currently designated) last control on the form. I've had some luck using the Leave event but the last visible control can change...
3
2561
by: Tim Thomas | last post by:
Hi, I am very new to .NET and am in the process of building my first web application. I will briefly describe what i am trying to achieve: I have a system where suppliers register their details, their locations, and then add themselves to categories. Each category requires additional info from the suppliers, this additional category info is stored in its own DB table. a suppliers may add themselves to as many categories as required....
5
3154
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access the code variable that are supposed to be linked to the contained controls. It runs fines when everything is contained in a single web form project. What do I need to do to make it work from a class library?
3
1878
by: Jonathan Wood | last post by:
I could really use some help on this. First of all, I want to create a Web control where I render the control completely from scratch based on information from a database. In the book "Beginning ASP.NET 2.0 in C# 2005", it provides an example of doing this, which is declared as: public class ConfigurableRepeater : WebControl.
6
11074
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to how those properties are set. I want to be able to do two other things: a) add User control instances to my page, filling in the place of placeholder controls, and b) programmatically setting custom properties on those dynamically spawned...
2
3002
by: User | last post by:
Hi, I have a custom user control. How do I write the script in a way which i can import custom namespace within the custom control? Please advise.. Thanks! mycontrl.ascx <script language=vb runat=server>
3
1351
by: RichB | last post by:
I would like to use the AJAX ASP.NET Accordion Control. Can I create a user control for the form and include this within a custom control which inherits from a Pane of the Accordion control? I know that I can create a user control and add it within the aspx file or dynamically to a page, but can I do the same within a custom control so that I can reuse this as a whole Pane. I wish to do this so that I can dynamically add new panes with...
0
8697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9184
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8930
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8892
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4382
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4634
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3062
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.