Showing posts with label displayed. Show all posts
Showing posts with label displayed. Show all posts

Monday, March 26, 2012

ajax animation extender

hi..

im new to asp ajax..i created image dynamically...and if i click the image panel should be displayed by using animation extender..

i have to write the animation extender in java script...by getting the image ID from code behind...is it possible...


Hi Rajukv,

I think you should better set the AnimationExtender's TargetControlID on the server side. For example:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">protected void Page_Load(object sender, EventArgs e) { Image myImage = new Image(); myImage.ID = "myimage"; myImage.ImageUrl = "~/pic/upg_HomeBasic.jpg"; this.Panel1.Controls.Add(myImage); this.AnimationExtender1.TargetControlID = "myimage"; }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Panel ID="Panel1" runat="server" Height="300px" Width="600px"> <ajaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server"> <Animations> <OnHoverOver> <Parallel Duration=".1" fps="50"> <Resize Width="250" Height="250" /> </Parallel> </OnHoverOver> <OnHoverOut> <Parallel Duration=".1" fps="50"> <Resize Width="50" Height="50" /> </Parallel> </OnHoverOut> </Animations> </ajaxToolkit:AnimationExtender> </asp:Panel> </form></body></html>

I hope this help.

Best regards,

Jonathan


Thank u Jonathan .

i got it by using ModelpopUp with animation...by taking Modelpopup TargetControlID=hiddenbutton


Saturday, March 24, 2012

AJAX and ViewState

I'm totally new to ASP.NET AJAX..writing my first AJAX enabled web app. In the app. The app is essentially a form that is displayed to the user in steps, like a wizard. Each step displays a continue button on the page, that when clicked, updates the page by setting the visible propery to true/false for the controls required/not required in the next step. All the controls reside in an update panel.

In the page load if !ISPostBack, I populate an asp.net table dynamically with items from a database, and allow users to enter a quantity they need in a textbox for each item. That works fine. Then when the user clicks the continue button, I set the visible propery on the table to false, and set other elemnts to true. that works. I also have a back button. If the user clicks the back button, I then set the table's visible propery to true again. The problem is that the table is now empty, since the page load event fires again. I only want to pull the items from the table on the intial page load. And then if the back button is clicked, the user should see the same table with their values filled in. This is easy in a non-AJAX site, since the table is stored in the viewstate.

What do I need to do in order to keep the table on the page, and keep the quantity textboxes populated with the user entered numbers when the back button is clicked? Surely I don't need to manually store the table in the viewstate do I? It seems to me that the pageload event should not fire at all since the page is AJAX enabled, and the only event that should fire is the button click event. There must be some fundamental aspect to ASP.NET AJAX that I am not getting...hopefully this all makes sense..if not tell me and I will try to clarify..

Nevermind...the problem is not AJAX related at all. It is that the rows and columns of an asp:Table are not stored in the ViewState...switching to a repeater...

AJAX and image Background

Hi,

I am using panel with in AJAX update panel, the panel background is using an image. So first time I run the form the panel will be displayed with the background image that I have set up, but when I click a button and partial update happen the panel background image will disappear. Can any one help me to keep the background of the panel even if partial update happens.

Place your Panel inside the UpdatePanel and that will solve your problem most likely. If that is not a solution because the panel contains other controls outside the updatepanel it contains then just wrap the the panel with a update panel and retain the current one you have. Nothing prvents you from having multiple update panels. No idea why you're experiencing the problem unless somehow the divs / spans created by the panels get mishandled or something but try the two possible workarounds listed above and see if that fixes it...

Thanks for the replay,

I have the background set up on the master page which contains the panel and inside the panel is the content place holder, The panel is setup with background image, when partial update trigger, the background image for the page that is displayed within the content place holder will disappear but for the remaining panel still contain the background image,


Hi!! put your panel inside the update panel and also the other controls. It will trigger the page. u wil get the image displayed.Wink
Thanks, I have missed some controles to be inside the update panel.