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


Top 5 Contributors of the Month
david stephan
Asad Ali
Post New Web Links

collapsiblepanelextender Collapsed="true"

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
 
I have a drop down list, that when a value is selected a collapsible panel extender opens. If the drop down value is not selected, the collapsible panel extender closes.My drop down list and collapsible panel extender are inside an InsertItemTemplate of a FormView. I use javascript to open and close the collapsible panel extender.However, when I set the Collapsed="true" to the collapsible panel extender (as I want the collapsible panel extender closed when the InsertItemTemplate of the FormView opens), the Collapsed="true" appears to override the ability of the collapsible panel extender to open or close. Hence, the collapsible panel extender does not open. I have tried setting the Collapsed="true" server side and client side, but I cannot get the javascript to work when I try to use the Collapsed="true". I have also attempted using the BehaviourID of the collapsible panel extender, but to no avail.Can any one help me to get this working?Here is my code (cut down): My Panel & Collapsible Panel Extender Controls:<asp:Panel ID="PanelAchievementOwnHeadingInsertItem" CssClass="noFlickering" runat="server"> ........... </asp:Panel> <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtenderAchievementOwnHeadingInsert" Collapsed="true" CollapsedSize="0"


View Complete Post


More Related Resource Links

Keep "collapsed" state of CollapsiblePanelExtender between postbacks

  

Hello

I have created a UserControl with a CollapsiblePanelExtender inside. In my Web page, I have a PlaceHolder in which many UserControls are added dynamically at every PostBack.

Everytime my page reloads, the CollapsiblePanelExtenders are expanded, even if they were collapsed before the PostBack. Is there a way to keep track of the "collapsed" state of the CollapsiblePanelExtender ? It seems hard since there is no server event triggered when the panel is collapsed / expanded.

Someone seemed to have the same problem here : http://forums.asp.net/p/1094970/1650425.aspx. I tried his solution (accessing the ClientState of the CollapsiblePanelExtenders using Request.Form) but my values are always null or true, even if the CollapsiblePanel is collapsed before PostBack.

Here is some piece of code :

AUMBlock block = (AUMBlock)Page.LoadControl("AUMBlock.ascx");
//CollapsiblePanelExtender cpe = (CollapsiblePanelExtender)block.FindControl("cpe");
//string clientState = cpe.ClientState;

FormView KeepInEditMode=true isn't retaining values

  


I have an "Edit Page" in my application. It uses a FormView bound to an EntityDataSource.

I have a handler setup for the FormView OnItemUpdated event. If an exception occurs (such as foreign key constraints or non date vales entered in a date colum, etc.), then I set the "KeepInEditMode=true". This is SUPPOSED to retain the user entered values on all of the text boxes instead of rebinding the FormView to the data again and clearing those text boxes. (Right?)

Well, it isn't working...

I have stepped through the code via the debugger and the "KeepInEditMode" does get set to true, but as soon as the page reloads, the values revert back to the original database values (the data is being rebound).

I should also mention that I am setting "ExceptionHandled" to true. I am doing this because I am handling the Exception by displaying an error in a specific area of the page and if I dont mark it as handled, IE generates an Exception popup.

Any ideas?
 


How to make expanding/collapsing CollapsiblePanelExtender from code behind smooth and animated

  

I've got a CollapsiblePanelExtender in place on a panel in test and it works like a champ. (I get excited about the simplest things).  When I click the panel header it expands and collapses with smooth animation, as expected and desired.

But when I change its state via code behind, it seems I am merely changing its state and somehow bypassing the javascript that controls the smooth animation.

My markup is out of the box. I have added code behind and some javascript, but I am missing the connection.  Here is the javascript:

function pageLoad(sender, args)
{
    smoothAnimation();
}

function smoothAnimation()
{
    var collPanel = $find("CollapsiblePanelExtender1");
    collPanel._animation._fps = 45;
    collPanel._animation._duration = 0.50;
}

 

And here is the code behind:

protected void btnExpand_Click(object sender, EventArgs e)
{
    this.CollapsiblePanelExtender1.Collapsed = false;
    this.CollapsiblePanelExtender1.ClientState = "false";
}
 

protected void btnCollapse_Click(object sender, EventArgs e)
{
    this.CollapsiblePanelExtender1.Collapsed = true;
   

Error "user does not have permission to perform this operation" with User Instance = True.

  

I setup SQL Server 2005 / SQL Express. All works fine in SQL Server 2005.

I am connecting to a SQL Database from VS 2005,  Tools/Connect to Database. I set the Data Source to "Microsoft SQL Server Database File (SqlClient)" (meaning SQL Server Express) and User Instance = True, and Integrated Security = True.

The above is working successfully on all machines except my Laptop. On my Laptop, I am getting this error "user does not have permission to perform this operation". On my Laptop, if I change User Instance = False, it works fine. Also, If I connect to SQL Server 2005 it works fine only if User Instance = False.

I tried all kind of security changes, nothing worked. For example, I setup Everyone as Full Control for the Folder and the MDF File of SQL Server. I gave my user ID as sysadmin role in SQL Server Express. Also, I enabled creating User Instance form SQL Server Express, Nothing is working.

Appreciate your help.

Tarek.


How To Access Datakeys In Javascript...and How To make gridview Column Visible true in javascript

  

How To Access Gridview's Datakeys In Javascript...and How To make gridview Column Visible true in javascript



Reply me..


Menu doesn't popup when WIndow style set to AllowsTransparency="True" WindowStyle="None"

  
Hi,I'm facing an issue, when using Window style set to AllowsTransparency="True" WindowStyle="None", my menus in menubar doesn't popup, rather they gets hidden (not visible) and if you just click by guess then menu item will be executed, its just that menu item is not shown visisble.However, if I revert back the Window style to normal without Transparency then menus visible(popup) perfectly.I'm not sure what could be an issue?San

How to Consume (Cookieless =true) Session Enabled Web services

  
  Hi, I need to use cookieless=true in web.config and enablesession=true in web methods.   I've two web methods like, [WebMethod(EnableSession=true)] public void SetName(string Name) { Session["Name"] =Name; } [WebMethod(EnableSession=true)} public string GetName() { return (string)Session["Name"] }   In my aspx.cs, using proxy I want to call SetName in button 1 click, and retrieve the name (which i put it into web service session on button 1 click ) in button 2 click like,   protected void Button1_Click(sender o, eventargs e) { webserviceproxy proxy =new webserviceproxy(); proxy.SetName("Prabhu"); } protected void Button2_Click(sender o, eventargs e) { webserviceproxy proxy =new webserviceproxy(); Response.Write( proxy.GetName()); } Here, How can I use cookie container and how can i achieve what Im expecting to do?   Please help me on this. thanks Prabhu P Work Smart, Not Hard

How can I show INSTEAD OF in XML output?

  
I am trying to create an XML document as the result of queries against our database tables. In some cases I need fields (usually INT) to display as <FieldName xsi:nil ="true" /> and that seems to work just fine if I used "ELEMENTS XSINIL"   However, I need to be able to chose (basically on a field by field basis in my SELECT statements) to return a blank field when the database holds a NULL value such as: <FieldName></FieldName>  (Or <FieldName/> either way would be fine).   How can I do that? Thank you for your help!   SELECT RecordCode, FieldToBeBlank, [Year] , [Month] FROM dbo.SomeTable FOR XML PATH('CustomRootName'), ELEMENTS XSINIL

Error "user does not have permission to perform this operation" with User Instance = True.

  
I setup SQL Server 2005 / SQL Express. All works fine in SQL Server 2005. I am connecting to a SQL Database from VS 2005,  Tools/Connect to Database. I set the Data Source to "Microsoft SQL Server Database File (SqlClient)" (meaning SQL Server Express) and User Instance = True, and Integrated Security = True. I am using Windows Authentication mode in SQL Server Express. The above is working successfully on all machines except my Laptop. On my Laptop, I am getting this error "user does not have permission to perform this operation". On my Laptop, if I change User Instance = False, it works fine. Also, If I connect to SQL Server 2005 it works fine only if User Instance = False. I tried all kind of security changes, nothing worked. For example, I setup Everyone as Full Control for the Folder and the MDF File of SQL Server. I gave my user ID as sysadmin role in SQL Server Express. Also, I enabled creating User Instance form SQL Server Express, Nothing is working. I am already added to the Administrator Group locally on my Laptop. Still same problem. Checked this article: http://msdn.microsoft.com/en-us/library/ms254504.aspx, same problem. I enabled User Instances and also tried to Disable User Instances. When I disable user instances, and then try to connect from VS, I get a different error, which is asking to enable user instances.

Values in user control fields empty when AutoEventWireup=true ?

  
As a BizTalk developer I'm trying to build a ASP.NET website so some obvious things might be new to me (so please be gentle). I have a web form and I have a user control on it. This user control contains a panel with some user properties that are to be stored in a database. So far nothing fancy. The user control itself contains a panel and is working fine (all code to retrieve and store the values is working). I used the default settings of creating a user control and one of them was AutoEventWireup=true. This works fine because I also have some dropdown boxes (and other fields) that need to be filled with values from the database and that happens in the Page_load event. The panel specifies the 'DefaultButton' which calls a method when clicked to save the values after the user has changed them. On this click the code of the method is called, I confirmed that, but I found out that the values of my controls on the user control (for example the Textbox control) are empty. As a non-ASP.NET developer I couldn't figure out why. So I changed some settings like AutoEventWireup to false. Off course this resulted in my dropdown boxes no longer to be initially filled, but my surprise was big to find out my controls actually contained the values the user typed in. Logically I need both the values and th

Stacked collapsible panels lose spacing after being collapsed

  
Hi all- I can't figure out why these collapsible panels are losing their white space inbetween each header after the panel is collapsed.    CSS: .collapsePanelHeader { border: 1px solid #333333; color: #333333; background-color: #e5e5e5; font-weight: bold; padding: 5px; margin-top: 5px; cursor: pointer; } .collapsePanel { height: 0px; background-color: #ffffff; overflow: hidden; border: 1px solid #333333; border-top: none; padding: 5px; padding-top: 10px; }  Panels: <div> <asp:Panel ID="HeaderPanel2" runat="server" CssClass="collapsePanelHeader">   Category 1 <span class="alignRight"> <asp:Label ID="collapseStateTextLabel2" runat="server" CssClass="labelInsidePanelHeader"></asp:Label> <asp:Image ID="HeaderImage2" runat="server" /> </span> </asp:Panel> <asp:Panel ID="ContentPanel2" runat="server" CssClass="collapsePanel"> <asp:TextBox ID="TextBox2" runat="server" BorderStyle="None&

collapsiblepanelextender

  
Hiii Coders, I have four collapsiblepanelextendrs on my page. Now i want that whenever, i click on one extender to expand others panels in expanded state should be collapsed at same time. How can i achieve this in C#   PLZ REP AS SOON AS POSS THANX AND REGARDS

radiobutton list item make visible true or false in javascript

  
in my project i have used one radiobuttonlist according different user login , i want to make one of radiobuttonlist item visible true or false..   please help me to solve this issue.   thanks in advance.  

Behaviour of WPF ComboBox with IsTextSearchEnabled=true and isEditable=true is not quite understanda

  
Hi, imagine you have a ComboBox with the following entries in the DropDown list: 1, 5, 10, 15 Now follow up this scenario: - open DropDown list - type 13 in the edit field -> 10 is selected in DropDown list - press "Enter" As result DropDown list is closed and 10 is placed in the edit field. How to override this behaviour so that 13 would be not overwritten after pressing "Enter"? Regards Efim

IsVisibleChanged not firing when element is in collapsed parent element

  
Using the code below, it is possible to change the child grid's visibility in code-behind. However, as long as the parent grid is collapsed, the IsVisibleChanged event will not fire for the child grid even though its visibility actually changes. Is this by design, or am I missing something? I want to be able to change the parent grid's visibility when the child grid's visibility changes, and under these circumstances I have to work around the issue with the non-firing event. <Grid x:Name="LayoutRoot">   <Grid x:Name="grdOuterGrid" Visibility="Collapsed">     <Grid x:Name="grdInnerGrid" IsVisibleChanged="grdInnerGrid_IsVisibleChanged" />   </Grid> </Grid>

Collapsed Grouping in Data View

  
I have created a data view that groups data to roll-up common items. The problem is that even though I have the data view group properties set to collapse by default, when the user opens the page, the contents are not collapsed by default.

collapsiblepanelextender, master page and javascript

  
does anyone have any working code that uses javascript to open and close a cpe when the CPE is in a masterpage?  It seems like the javascript never is able to find the CPE when it is on a master page.  I have an DropDownList on the page and when certain items are selected, i want to collapse or expand when others are selected.  It seems to work fine on a regular page, but not when it is a page nested in a master page.  It is adding a suffix to the CPE and javascript is unable to find it.  any help would be much appreciated!<script type="text/javascript" language="javascript">        function ExpandCollapse() {            var e = document.getElementById("<%=DropDownList.ClientID%>")            var strUser = e.options[e.selectedIndex].value;            var collPanel = document.getElementById("<%=CPE.ClientID%>")            if (collPanel = null)                alert('No panel found');            if (strUser = "Collapse")    
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