I am working with asp.net c#. While working with .aspx page the Ajax control(accordion) worked perfectly. But when i tried using it on Web user control .ascx the control didn't work. I hoping there is a work around this to make it work.
This is my source code for the control that is not working.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="StartCourse1.ascx.cs" Inherits="LearningSource_Controls_StartCourse1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40"
TransitionDuration="250" AutoSize="None" RequireOpenedPane="false" SuppressHeaderPostbacks="true">
Watch the
demonstration of the network simulation program named style="font-weight: bold;">Cisco Packet Tracer v3.2 (do not use
the newer versions of the software in this module as they are much too
complex for our needs at this stage in the module).
Thanks for your help in advance. Regards
Giwa AbdulhakeemPosted Apr 26, 2011, 11:11 AM
Suthish NairPosted Apr 26, 2011, 10:42 AM
Drag n drop a Panel control on page and add your user control into it.
Refer, the sample attached.
Giwa AbdulhakeemPosted Apr 26, 2011, 9:15 AM
string crt = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Context.User.Identity.IsAuthenticated)
{
cort.Controls.Add(Page.LoadControl("~/LearningSource/Controls/NonAutheticated.ascx"));
}
else
{
if (Request.Params["crt"] != null)
{
crt = Request.Params["crt"].ToString();
}
switch (crt)
{
case "intro":
cort.Controls.Add(Page.LoadControl("~/LearningSource/Controls/StartCourse1.ascx")); break;
case "details":
cort.Controls.Add(Page.LoadControl("~/LearningSource/Controls/PersonalDetails.ascx")); break;
case "changepassword":
cort.Controls.Add(Page.LoadControl("~/LearningSource/Controls/PasswordControlControl.ascx")); break;
break;
}
}
}
That how i load my control. On the StartCourse1.ascx have got the ajax control accordion which is not working. Thats the problem have got.
Suthish NairPosted Apr 26, 2011, 8:58 AM
check the samples attached..