.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
Kaviya Balasubramanian
SP
abhays
Sasi Prabhu
Post New Web Links

Accordion Control in MasterPage does not remember its SelectedIndex

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net
 

Hey guys, I hope anybody out there could help me!

I've been Googling for so long now and I cannot find a straight answer or correct solution to my problem (especially when I'm a novice at JavaScript/C#!).

I have got an Accordion Control on my MasterPage which acts as a menu. My problem is that when I click on a button within the content pane it displays a new page within the ContentPlaceHolder, but the Accordion resets itself back to SelectedIndex = 0. How can I keep the SelectedIndex = 1 open when I'm response.redirected to another page?

I have heard about sessions but I can't make any sense of them. Any suggestions or solutions would be great!

Many thanks.




View Complete Post


More Related Resource Links

Accordion Control with Panel...Add an Update Panel?

  

I have an accordion control in my web site.  And in one of the panels, I have a drop down list box where, when the user selects an item, it updates the labels right below the ddlistbox.  I have it so that it maintains the scroll position when the ddlistbox has an autopostback, but it's very obvious that the whole page posts back.


My question is, can I/should I just enclose the ddlistbox and the labels (and a couple of text boxes) in an AJAX update panel?  I already have a ToolScriptManager (because of the accordion control), so I don't need to have another script manager, right?  I can just put the update panel (with the other controls inside of it) right in the accordion panel, right?  Then when the ddlistbox posts back it won't have the delay of the whole page posting back?  And it'll still execute the event handler for the listbox selection change?

Does this sound right?  I'm just looking to make the post back "invisible", and I would like to do a partial postback of just these few controls.

Thanks in advance! :)


Accordion Control Renders Content Incorrectly

  

Hey Guys i'm using an accordion control with one pane. In all browsers it renders and works fine - except IE8. in IE8, it looks fine at first, but after collapsing and reopening the pane the text in my pane appears garbled. When i zoom in, i can tell it's in the original font, but it's almost as if it's an image that's blow up too big...


Issue with Remember Me on User Login control

  

Hi everyone,

     I hope you can help me, I tried Google, but none of the solutions worked. Using VB.net and Membership, I have a login control in my master page with a remember me check box. When I check this box and login, some pages indicate that I am not logged in. If I go to another page, it will then indicate that I am still logged in. I have isolated one page that always indicates I am not logged in the first time I visit it, but if log in a second time and then go to it, it will finally recognize me as a user that is properly logged in. 

Some pages that this occurs on is in the top level, some pages are in a sub folder.


My MasterPage has the following Form Code:

<body bgcolor="#E0ECF9" topmargin="0" leftmargin="0">

    <form id="form1" runat="server">


My Aspx file has a troubleshooting label, several Gridviews and several DetailViews:

    <asp:Label ID="lblErRep" runat="server" Text=""></asp:Label>


My aspx.vb file has 1 line of code (Protec

Trouble with Font Definition in Accordion Control

  

 VWD 2008 Express.

I have a page on which I have an accordion control.  The accordion control seems to be overriding the font definition I have for the page body in my CSS stylesheet.  Here is what is happening.  Can anyone help?  Thanks.

1.  When I open the page and the top panel opens, it displays with the correct font family, size, etc.

2.  If I close and reopen the top panel, it displays with another font family and looks bad.

3.  All subsequent panels, when opened, display the font in a different family than specified in my CSS stylesheet.

This is what I have in the stylesheet both for the body and for the .accordioncontent:

body
{
    background-color: #E4E1C2;
    background: url(../images/background.jpg) repeat left top;
    font-family: Georgia, "Times New Roman" , Times, serif;
    color: #666666;
    font-size: 12pt;
}
.accordionContent
{
    border-top: none;
    padding-top: 10px;
    font-family: Georgia, "Times New Roman" , Times, serif;
    color: #666666;
    font-size: 12pt;
}


 


"Remember Me Next Time" under Login Control is not working

  
I am using VS 2005 and created a Login control. Login control provides "Remember Me Next Time" check box, I check this box but it does not remember next time. I have following entry in the web.config file <authentication mode="Forms"> <forms name=".MyCookies" loginUrl="login.aspx" protection="All" timeout="5000000" cookieless="UseCookies" slidingExpiration="true" path="\"></forms> </authentication> What am I missing? Thanks

Accordion control access in Javascript using Content page

  
Hi, I struggled with some javascript issues, and discovered that the problem seemes to come from a failed ajax control access.Here's my problem:I have a master page and a content page.In my content page, I have an accordion with 2 panes.1rst pane: a textbox and a validation button;                     I want the button to fire javascript function without reloading page (using "return false;");In my master page, I put my ToolkitScriptManager.In my content page, I put my script containing the functions.The problem is that it seems like I can't access the accordion control in my js functions, whereas I can access my textbox value...Here is my source:<%@ Page Language="C#" MasterPageFile="~/Default.master" Title="CLEOR RH | Home" CodeFile="Default.aspx.cs" Inherits="Default_aspx" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server"> <script type="text/javascript"> var step1 = false; function pageLoad() { var accCtrl = $find('AccordionCtrl_AccordionExtender');

access control from masterpage

  
How do I get access to the below linkButton control from my Master page or a page using that Master, this is in my Master page:<Project:RoleControl ID="RoleControl1" runat="server"> <AdminTemplate> <li id="liadmin" runat="server"><asp:LinkButton id="lnkAdmin" PostBackUrl="~/admin/admin.aspx" runat="server" CausesValidation="false">Admin</asp:LinkButton></li> </AdminTemplate> </ Project:RoleControl> Basically it's a custom control I built which will allow me to show certain things only to admin users, we are not using asp.net membership so I came up with a control that works. But when I try to access it within the Master page itself it keeps saying the control has 0 count in it, I'm doing this check in the Page_Load event:if (RoleControl1.Controls.Count > 0) { string roleControlId = RoleControl1.Controls[0].ID; ((HtmlGenericControl)RoleControl1.FindControl(roleControlId)).Attributes["class"] = "navselected"; } But the RoleControl1.Controls.Count check is always 0. I know the control is rendering as I can see it when the page loads, the link comes up. I thought maybe I'm checking it in the incorrect event, rather than Page_Load should I be checking for it in another event, could it be that at that point

The Accordion Control change font controls

  

Hi, I use an accordion control that contains some aspnet control inside. 

When I collapse the accordion control, all of aspnet controls include labels or textboxes change the font to another differnt, what can I do.


There is the code:

<cc1:Accordion ID="Accordion1"  Width = "100%" runat="server"  FadeTransitions="True" SelectedIndex="0" TransitionDuration="300"  HeaderCssClass="accordionHeader" ContentCssClass="accordionContent">

            <Panes>

                <cc1:AccordionPane id="AccordionPane1" runat="server" >

                <Header> Datos Generales de la Póliza</Header>

                <Content>

                         <asp:Label ID="Label6" runat="server" Font-Bold="True" Font-Names="Tahoma" Font-Size="8pt" CssClass="labelFormat"

                               &nb

ToggleButtonExtender within an Accordion control

  

Hi,

 I am trying to use the Togglebuttonextender within an accordion control. However, the problem I am having is that the images for the togglebuttonextender seems to be sitting outside of the accordion control, so that when you go through the different accordion panes, the images stay on top. I have included some sample code that demonstrates the problem. Any suggestions/fixes...?

Thanks.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AccordionTest.aspx.cs" Inherits="AccordionTest" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/D

How to find a control from a contentpage when looking from the masterpage?

  

I have a FreeTextBox control on a page that has a masterpage. This FreeTextBox control is in the maincontent.
I also have a button on the masterpage. If this button is clicked I want to know if I'm in the page with the FreeTextBox.
How can I do this. I have tried:
findTxtBox = this.Master.FindControl("MainContent").FindControl("base").FindControl("FreeTextBox1") as FreeTextBoxControls.FreeTextBox;
To see if findTxtBox is not null. But

Accordion control doesn't work

  

Hello. I am having quite a bit of trouble getting an accordion control to work. I downloaded the AJAX Control TOolkit (v 3.5), added the dll to my toolbox, and added an accordion control with the following code:

<asp:accordion 
id="Positions" 
runat="server" 
fadetransitions="True" 
selectedindex="0"
transitionduration="300" 
headercssclass="accordionHeader" 
contentcssclass="accordionContent"
headerselectedcssclass="accordionSelectedHeader">
        <Panes>
            <asp:AccordionPane ID="P" runat="server">
                <Header>President</Header>
                <Content>
                   The President ...
                </Content>
            </asp:AccordionPane>
            <asp:AccordionPane ID="VP" runat="server">
                <Header>Vice President</Header>
                <Content>
                   The Vice President ...                </Content>
            </asp:AccordionPane>
            <asp:AccordionPane ID="T" runat="server">
                <Header>Treasurer</Header>
                <Content>
                   The Treasurer ...                </Content>
    

Accordion Control failing XHTML standards

  

Hi there,

OK, first things are that I am using .NET 4.0 with Telerik Rad Controls version Ajax Q2 2010 Net 4 and the .NET 4 version of the AJAX Control Toolkit.

The website I am working on uses the Telerik Rad Controls quite extensivley but I really wanted to use the Accordion control from the ajax control toolkit as I believe this is better than the alternative from the Telerik product range.  After messing about trying to get the two to work together I finally achieved this and functionally we are working OK.  However..........  I get the following error when trying to validate the page for valid XHTML

  1. Error Line 173, Column 17: ID "ctl08" already defined
    	</div><div id="ctl08" style="display:block;">

    ?

    An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be

create a data driven jquery accordion control

  

hi,

i have a very simple table in my database which holds information about students.

what i would like is to create a jquery accordion which will have a heading for each student and then when the user clicks on a students name, it will expand and display the students information from this table.

is this possible? please can someone show me examples of how i can do this?

i use linq to sql and its an asp.net form (aspx page) not mvc.

i am very new to this aso any help would be much apperiated along with examples.

the only thing i have so far is the following - my accordion is in a jquery dialog box also.

$(function() {

	$('#my div').dialog({

		modal: 'true',

		title: 'students',

		open: function() {

			$("#accordion").accordion();

		}

	});

}); 


many thanks


How to Use Accordion with ASP:Menu in User Control

  

Happy Friday All,

I'm creating a user control to be placed within a masterpage on a site.  Inside the user control, I have placed a menu.  It is wired up to a sitemap datasource to get navigation with security trimming included. 

Question:

How do I use the Accordion toolkit control to collapse main portions of the menu?  For example, if I have Orders and Supplies and subpages contained therein, how do I setup Accordion to traverse the sitemap based on the user's security privileges?

Thanks,

Sid 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend