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


Post New Web Links

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

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net
 

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;
   


View Complete Post


More Related Resource Links

Make sure that the class defined in this code file matches the 'inherits' attribute, and that it e

  

Here is the page directive for the page that throws the error:

<%
@ Page language="c#" Inherits="University.AspNet.Index" CodeFile="Index.aspx.cs" %>

The code behind file Index.aspx.cs starts like this:

using University.Framework.UI;

namespace University.AspNet

{
      
public partial class Index : University.Framework.UI.HomePage

The code behind is extending this HomePage class, which is in turn an extenstion of another class University.Framework.UI.Page, which extends the System.Web.UI.Page class.

Am I misusing the I

.NET Code Tuning: Make Your Apps Fly with the New Enterprise Performance Tool

  

Because the common language runtime (CLR) is a black box, it's pretty hard to divine what's going on when you want to track down performance problems. Microsoft will be delivering a brand new profiler, the Enterprise Performance Tool (EPT), as part of Visual Studio 2005 Team Developer Edition that's ideal for use on a production system because it offers some very lightweight means of collecting performance data. Here John Robbins takes you on a tour.

John Robbins

MSDN Magazine December 2004


Debugging: DataTips, Visualizers and Viewers Make Debugging .NET Code a Breeze

  

There is a whole host of new goodies in upcoming release of Visual Studio 2005 that will enhance your debugging experience. One such improvement will make it easy to visualize types within the debugger. This article discusses those improvements and covers debugger attributes and type visualizers. In addition, the author shows you how to extend the display of your own types with custom attributes and how to plug in an assembly to visualize.NET types built into the framework.

Morgan Skinner

MSDN Magazine May 2004


How to make "UserId" equal to the "logged-in user" in vb code behind

  


I need to insert a declaration in the codebehind function below that will make the variable "UserId" equal to the "logged-in user". In what way do I need to change the code below (elsewhere in the project, I successfully make reference to basically the same code and make the UserId equal to logged-in user by using this handler expression inside an image control: ImageUrl ='<%# Eval("UserId","Image.aspx?UserId={0}")%>'...But in the case below, the function is not fired by this expression, but rather by CustomValidator). Thanks very much.

 

Sub ValidateImage(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)

        If Request.QueryString("UserId") IsNot Nothing Then
            ' Get the connection string from Web.config.

            Using conn As New SqlConnection(ConfigurationManager.ConnectionStrings("MyDatabaseConnectionString").ToString())
                ' Create a command object.
          

Trying to make a workaround for animated GIF in WPF

  
Hello. I'm trying to make a workaround for displaying, with (semi-)correct delays, an animate gif with partial frames into an Image control from a ReadOnlyCollection<BitmapFrame> (from BitmapDecoder) What I've done so far was load the same file as a System.Drawing.Image, get the delays using GetPropertyItem(0x5100), and trying to recompose the frames. The whole thing runs on a separate Task, which then calls another Task with a TaskScheduler.FromCurrentSynchronizationContext() to update the UI. Here's the relevant code as of posting:         private void AnimateTaskMethod(ReadOnlyCollection<BitmapFrame> bi, CancellationToken ct) { int count = bi.Count; int[] delay = new int[count]; int i = 0; System.Drawing.Image img = null; try { img = System.Drawing.Image.FromFile(FileList[(int)index]); System.Drawing.Imaging.PropertyItem prop = img.GetPropertyItem(0x5100); for (int x = 0; x < count; x++) { delay[x] = 10 * BitConverter.ToInt32(prop.Value, x * 4); if (delay[x] == 0) delay[x] = 100; } } catch { for (int x = 0; x < count; x++) { delay[x] = 1000; } } finally { if (img != null) img.Dispose(); } while (true) { ct.ThrowIfCancellationRequested(); Thread.Sleep(delay[i]); Task UIAnim

How to make backup for Access DB with Code using ADO.net and C#?

  
Hello , How to make backup for Access DB with Code using ADO.net and C#? ThanksKareem Naguib

How can I make this code work?

  

I have this code it is work almost correctly but now this code populated data to ALL comboboxes at the time(in the start of UI) the User open the UI.

I need to split the code so when the User select value in combobox corporationCode1 I will advance to combobox WorkSpaceCorporation

for some like this if user select something in combobox CorporationCode1 so advence to combobox WorkSpaceCode..

There is a code/

private void Window_Loaded(object sender, RoutedEventArgs e)

        {

    

make a control required field using code in infopath

  

Hello guys,

How do i make a field required field using code. Specifically, how to make attachment control mandatory.

I know there is an option to select cannot be blank in properties but i want to do it conditionally.

Please help me.

 

 


Here is my new control code i couldnt make it so if i change the control size on form1 designer so i

  

I have two major problems.

1. After dragged the control to form1 designer when im on form1 designer i dont see anything in the control only when i run my program. I thought ill some kind of preview or what i painted in the control ill see it on the form1 designer before i run my application.

2. On form1 when i manualy stretch the size of the new control on form1 designer to be bigger or smaller the things i painted dosent fit i thought the way i created the code in the control code it will keep its size arroding to the size changed ill do in form1 designer but it dosent.

 

So here is the code of the control and form1 can someone help me with this two problems show me the correct code?

 

First the control code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DannyGeneral;

namespace My_Diet_Control
{
   
    public partial class My_Diet_Graph_Control : UserControl
    {
      
        int x_axis_lenght;
        int y_axis_lenght;
   &

Here is my new control code i couldnt make it so if i change the control size on form1 designer so i

  

I have two major problems.

1. After dragged the control to form1 designer when im on form1 designer i dont see anything in the control only when i run my program. I thought ill some kind of preview or what i painted in the control ill see it on the form1 designer before i run my application.

2. On form1 when i manualy stretch the size of the new control on form1 designer to be bigger or smaller the things i painted dosent fit i thought the way i created the code in the control code it will keep its size arroding to the size changed ill do in form1 designer but it dosent.

 

So here is the code of the control and form1 can someone help me with this two problems show me the correct code?

 

First the control code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;<


danieli

I want to change FontSize in code, how do I make my source?

  

Hello my teachers

I want to change FontSize in code(CS File)... but 'FontSize' is only exist XAML ...

how do I make it?

anybody help me...


How read flowdocument xaml to make available in vb code

  

I'm very very new to WPF and not particularly experienced in VB.Net (mostly a VBA man) so forgive me if this comes across as completely idiotic, cause it more than likely is :-( .....

The problem I have is that I want the user to have the ability to insert buttons into a richtextbox and be able to put essentially as many buttons as they like in and amongst some text.... simple enough....

Problem is I'm finding this impossible with my limitted knowledge of anything WPF related.....

I can use the following code to allow the user to double click in the rtb at a certain point and the code will go off and create a flowdocument (in vb) with an inline container with a button in it and then merge the text from the rtb with the flowdocument.... 

 

FIRST CREATE THE FLOWDOC WITH JUST A BUTTON

 Dim WithEvents aButton As TextBox = New TextBox (class level variable)

Dim aFlowDocument As FlowDocument = New FlowDocument

Dim bparagraph As Paragraph = New Paragraph

        bparagraph.Inlines.Add(New InlineUIContainer(aButton))

        aFlowDocument.Blocks.Add(bparagraph)

 

AND THEN READ THE RTB CONTENT AND MERGE IT WITH THE FLOWDOC ABOVE WHICH RESULTS IN ANOTHER FLOWDOC THAT i CAN SET A RTB TO SHOW AND SO I NOW HAVE THE TEX

Make a C# WinForm Call a JS code in a Data server??!!

  
Hi... 
I have a situation as follows:
My company has its Customers Data stored in a server, and we as employees use Internet Explorer to find the data needed through a page that contains some textboxes to supply info to the server and some other textboxes that shows Data retrieved from server. So fro example I put the customerID in a textbox, press the search button near this textbox, and I get the customerName and customerAge and so on in another textboxes in the same webpage. I konw this is done via JavaScripts.

I hope the scene is clear, Now when I need to print a report about certain customer I have to copy/paste every single textbox content to Word individually.

So I know how to export from C# to Word or at least to Excel .., But is it possible to make a C# WinForms App that can read the contents of these textboxes OR call the JS function that is executed when I press the (Search) button shown in the IE WebPage.

I dont know if my question is clear enough but I hope you can help me. Any help would be appreciated.
Thanks in advance

Telling the program what you won't be doing to make the code run faster

  

I need to know if my thinking is on the right track about something, and if so, what keywords I might Google search to find out more about this.

Are there times we write code and the real advantage is that by telling the computer what we won't be doing, it saves time because the computer doesn't have to do something (maybe saving milliseconds, or even more?)

For example, every discussion about the modifier 'abstract' explains how it will prevent me from accidently trying to instantiate an object from the class.  Well, I'm in a situation where I'm pretty sure I won't make that mistake, but then I was thinking, well, maybe there's a better reason to use 'abstract' -- maybe it tells the computer 'you don't have to do certain stuff because this an abstract class' and it creates a significant time savings.

Am I on the right track?

The closest I've come to finding this was a mention that it's good to mark classes with 'sealed' whenever you know you won't be inheriting from them; this was in article about making code work faster.

Thank you for your help with this.


code to add to make site visable in search engines

  

Hello

Still new. What can I add to my site to get picked up by serch engines without paying for services?

Right now if I do a search My site does not appear.

 

thanks

Sue 


How can I make controls inside a Template visible to Code-behind

  

I have created a custom control that implements Templates (based on Panel controls) ... I can do a FindControl to locate imbedded controls.  This allows me to get and set values in the imbedded controls, but I want to be able to reference the imbedded controls like they are properties of the associated panel.  Here is a sample of how my custom control now works:

<cc:CustomControl ID="myCustomControl" runat="server">
<PanelTemplate>
<asp:TextBox ID="myTextBox" runat="server"></asp:TextBox>
</PanelTemplate>
</cc:CustomControl>

I can do the following (where my custom control has given the panel hosting the template the name "myPanel"):

Dim txt As TextBox = myCustomControl.myPanel.FindControl("myTextBox")
txt.Text = "Some text to put in TextBox"

What I want to do is:

myCustomControl.myPanel.myTextBox.Text = "Some text to put in TextBox"


Need to make sure area code is in table.

  
I need to check if area code is there than do nothing else
pad the number with the area code.

There is a new area code being introduce the 431. How should I set this up.


dbo.tblUsers Phone nvarchar(14)
delete #tmp
INSERT INTO #tmp VALUES('(204) 325-4059');
INSERT INTO #tmp VALUES('204-940-1261');

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