Showing posts with label associated. Show all posts
Showing posts with label associated. Show all posts

Monday, March 26, 2012

AJAX animation panel

Hello forum! I have an aspx page with a panel, 1 button and 2 animation extender. The button is associated to one of the animation extender and it has in the property "OnClientClick"=return false;

This is all working well.

In the panel I have 1 label that I want is values to change always I click in the button. But, because of the property "OnClientClick"=return false; all the code that I have in the OnClick of the Button doesn't work! If I took of the property, the animation panel don't show...

Here is the code I have in my button:

Protected Sub btnInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnInfo.Click

lbl_name.Text = "Liliana"

End Sub

Please help me!!

Thanks

????????????????

Liliana

Portugal

Hi Liliana

As far as i know, there is no way to do waht you want to do in that method. The button either works on the client OR the server not both

However, you could add a page method to populate the button's click event like this

<asp:button id="btnLilianaButton" runat="server" Text="Click Me" OnClientClick='<%# LilianaPageMethod()%>' />

and on the Page code-behind have a method like this

public string LilianaPageMethod(){return"javascript:$get('" + lbl_name.ClientID +"').innerText = 'Liliana';return false;";}

This statement is evaluated when the page is rendered only so is pretty static. You could also use a WebMethod via javascript if you so wished and this could interact fully with the server

Hope this helps


Tim


Hello Tim! Thanks for your help but I solve the problem by other way.

I put the panel inside an AJAX Update Panel and the code inside the Load Event of the Update Panel. And it works fine!

Thanks,

Liliana

Saturday, March 24, 2012

AJAX and Toolkit

Last week I downloaded and installed AJAX and the associated toolkit viaASPAJAXExtSetup.msi andAjaxControlToolkit.zip respectively.

When I open thetoolkit.sln file in VS2005, I get a flock of error messages, most notable of which are messages to the effect that the app is unable to find the System.Web.Extensions.dll and System.Web.Extensions.Design.dll files.

In looking at the installed files I noticed the following differences between the AJAX Extensions files and the Toolkit Files:

o AJAX Extensions inC>Program Files>Microsoft ASP.Net>ASP.Net 2.0 AJAX Extensions>v1.0.61025 folder contains aweb.config file that includes numerous "microsoft.web" and "Microsoft.Web.Extensions" entries.

o AtlasControlToolkit files in C>Program Files>Microsoft ASP.Net, the resultant files also containweb.config files: One in each of the "SampleWebSite", "ToolkitTests", and "ToolkitWebsiteTemplate" sub-folders. Each of these threeweb.config files include numerous "system.web" and "System.Web.Extension" entries.

I assume that theSystem.Web.xxx is the appropriate syntax.

Is there possibly a newer version of theASPAJAXExtSetup.msifile that synchronizes the syntax between these two apps?

Is there something else that I may have missed?

(I had previously been using ATLAS: I uninstalled the ATLAS app, and deleted the toolkit folder before I installed teh AJAX apps)

Never mind.

I downloadedASPAJAXExtSetup.msi againand the toolbox now works OK.

All of the config files now match each other.