Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Wednesday, March 28, 2012

AJAX UpdatePanel works on dev machine but still flickers on web server.

Hi Guys,

I have a master page, that has a ScriptManager and some "RoundCorner" controls. I also have a child page with a textbox and a FormView.

So I created an UpdatePanel, put my FormView inside the ContentTemplate, created the trigger and assigned to the TextBox's TextChanged event. (to an Async trigger).

When I run the app on the dev machine, it works wonders, no flickering and only the formview gets "refreshed". But as soon as I upload the code to the WebServer, the entire page gets refreshed everytime I change the value on the TextBox.

Am I forgetting to have something setup on the server side? I didn't find a "Deployment guide" for AJAX (If theres one, please point me to the right direction), so I figured that installing the MS Ajax 1.0 on the server would do it.

Thanks!

Marcelo

More info:

Just tried a small example, and again it does not work on the server side (both dates get updated):

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server">From here, it is inside the panel <br /> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> </asp:ScriptManager> <asp:UpdatePanel runat="server" ID="UpdatePanel1"> <ContentTemplate> <asp:Label ID="TestLabel" runat="server" Text=""></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel><hr/>From here down its not inside the Panel<br /> <asp:Label id="Test2Label" runat="server" text="" /> <asp:Button ID="Button1" runat="server" Text="ClickHere" /> </form></body></html>

***********CS content

using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partialclass TestPage : System.Web.UI.Page{protected void Page_Load(object sender, EventArgs e) {TestLabel.Text = DateTime.Now.ToString();Test2Label.Text = DateTime.Now.ToString(); }}

Anyone has ideas?

Thanks!

Marcelo


Nobody at all?


Hello,

Take a look at my post and the solution we found:http://forums.asp.net/thread/1649057.aspx

Possibly your case is similar.


Hi there,

At first it seemed that I had my problem solved, since the properties show exactly the same as yours.. So I tried to change the property to true, but no luck, it still does a full refresh on the

server side..

I checked your sample site, and I it does a full refresh aswell.. what part of if should do a partial refresh?

Could you send me the code you have on your page Init?

this is what I've added on mine:

private void Page_Init(System.Object sender, System.EventArgs e) { ScriptManager1.SupportsPartialRendering =true; }

I'm getting frustrated with this...


Hi,

The partial refresh on our page (http://beta.easyquerydemo.com) works only for "Result" panel (at the bottom of the page). If you define some query using "Conditions" panel (for example: "Customer Company Name starts with A") and then click on "Update Result" button the result set should appear almost immediately and without updating the whole page.

As for code: we use exactly the same line of code as you published in your previous post.

Did you check the value of this property after assignment. Maybe it still is set to 'false' because of some limitations in browser which you use to access this page.


In this example of yours, both Labels get updated because you update the datetime in your Page_Load function.

Your Page_Load function should be like this:

Protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TestLabel.Text = DateTime.Now.ToString();
Test2Label.Text = DateTime.Now.ToString();
}
}

And your button to update the Label inside the updatepanel should call a function to update the datetime of that label.

Protected void UpdateLabel(object sender, eventargs e)
{
TestLabel.Text = DateTime.Now.ToString();
}


Hi,

What i'm doing is the following, on page_init i force the property to be true, and on page load i load all those variables into labels, just like you do on your sample site. It does in fact change that property to True. but the full refrensh still occurs.

Now I see the part that uses the update panel (The result on your site). And it actually works.

Do you have any other hint?

Correct me if I'm wrong but, theSupportsPartialRendering property is set based on:EcmaScriptVersion,SupportsCallback andW3CDomVersion; which are properties of HttpBrowserCapabilities that is assigned from a Request.Browser object.

That means that it is checking the Client's Browser capabilities, and nothing to do with the server itself right? If thats true, as long I use the same browser (IE7 for instance) it should not matter where that page is sitting at, it should bring the same value for SupportsPartialRendering...

Is my line of thought correct or I am missing something ?

Thanks a lot for the help you are giving me!


Hi there,

1. About "other hint". No I do not have it unfortunately. The only one thing I can suggest is to try add another UpdatePanel on your page and some simple controls into it (e.g. one button and one label) just for testing and see how it works. Another good idea will be to create another simple testing page using AJAX template in Visual Studio (if you use it) and see how it works on your server.

2. About the properties whichSupportsPartialRendering is based on: yes you are right, at least we understand this part of documentation exactly the same way.

Possibly we should send this request to Microsoft? There must be more conditions for partial rendering support except those ones described in documentation. I think there must be some requirements for server side.



Hey,

I will create a brand new example using the AJAX project template and report back my findings.

I agree, but I never done this before. Usually I can find a work-around for these type of issues, which doesn't seem to be the case right now. How should I proceed on submiting this to MS?

Regards


Hi again there,

More findings:

1. I created a brand new application and used the same sample as before, but this time I added the labels and forced SupportPartialRendering to true.

Amazingly the application worked just fine on the server side.

2. I've added a master page to this application and wired up the old "default.aspx" to the master page, moving the ScriptManager to the master page (and also the SupportPartialRendering portion)

Application stopped working.

3. I moved the ScriptManager (and SupportPartialRendering) back to the Default.aspx and removed from the master page.

Application still didn't work.

At this point I think is safe to conclude that: UpdatePanels will not work with master pages!!!?

PS: All the 3 situations work fine on the development machine.

Anyone has Master Pages + Update panels working properly on a production server?


We finally have solved the same problem. I think your case is similar.

Seehttp://forums.asp.net/thread/1653605.aspx for more info.


Hi korzh,

This is great, now it works like a charm! Thanks a lot for keeping me posted! Now, where in the documentation does it show anything about that property.. :P only a insider would know about it ..

Thanks a lot! Case closed!

Marcelo


Hi korzh,

This is great, now it works like a charm! Thanks a lot for keeping me posted! Now, where in the documentation does it show anything about that property.. :P only an insider would know about it ..

Thanks a lot! Case closed!

Marcelo

Ajax Update Panel

Hi guys,

I am using a login page with ValidatorCalloutExtender controls to validate username and password textboxes. On the submit button, I am using UpdateProgress to display an animation while the request is being entertained. Now, when the button's pressed, the animation comes up properly and everything is ok. However, I want the button to be disabled while the "progress" animation is being played and as soon as the results come back (like account not found), I want the button to be enabled again for the user.

How can I switch between the 2 states of the button as above? I would appreciate all help.

Thanks!

Found the solution :)

<scriptlanguage=javascript>

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function BeginRequestHandler(sender, args)

{

var btn = document.getElementById("<%= BtnSubmit.ClientID %>");btn.disabled =true;

}

function EndRequestHandler(sender, args)

{

var btn = document.getElementById("<%= BtnSubmit.ClientID %>");btn.disabled =false;

}

</script>

Monday, March 26, 2012

Ajax ToolKit Version 1.0.10920.0

hey Guys,

I am facing a strange problem. Until now I was using toolkit ver 1.0.10301.0 for my app, few days back I downloaded latest version of toolkit that is ver 1.0.10920.0 and I am facing few problems.

1) I am not getting focus in Modal PopUp fields in Mozilla Firefox, in IE everything is fine.In earlier version also it works fine.

2) If I am calling message box(error message:which again is a modal PopUp) from my modal PopUp, its not getting displayed, although error message PopUp gets displayed properly if called from page. Sadly this also use to work fine in earlier version which I was using.

P.S I am not getting any Javascript error also.

please suggest, are these bugs in latest version or I am doing some mistake.

Regards,

Pankaj

I'm really not sure of the problem, but I gonna take a guess at something. When you did the upgrade and copied the new AjaxControlToolkit.dll over the previous copy and then went to your Toolbox and selected the new updated AjaxControlToolkit.dll, did you uncheck the previous reference to the 1.0.1.0310.0 controls? I'm not sure if that has anything to do with it, but there could possibly be some kind of version reference issue, if you didn't do this.

AJAX Toolkit Calendar - Bug for April month

Hi guys,

I just discovered a little bug in the new Calendar from the AJAX Toolkit.

http://ajax.asp.net/ajaxtoolkit/Calendar/Calendar.aspx

Choose "April" as month, and point your cursor over a day. The day in the popup doesn't match the day of the column.

For instance, if I point my cursor over the 1rst of April 2007, the popup says "Sunday, 01 April 2007" (this is correct) but the day is under the "Mo" column (this is wrong). The same thing happens for April 2008, so maybe it's a bug linked to this month.

Note: I didn't try the calendar in the toolkit, just the web site. Maybe the website uses an old version.

Bye,

Matthieu

I just tried this in IE, FF, Opera, and Safari and it's correct for me in all browsers. What browser are you using?

Hi,

I can confirm that the issue is happening in IE and FF in my case.


Then I suspect it's related to the different culture settings or timezones. Garbin, would it be possible for you to investigate a bit since you know your way around this stuff really well? Thanks!

Hi,

I tried with IE 7 and FF 2.

Yes, good idea. Maybe it's linked to culture settings. If you're interested, mine is fr-CH (and my timezone is GMT + 1).


Hi,

I have same problem ot month april.

I'm using FF2.0


Hi KirilRusev,

which culture are you using?


Hi,

guys, could you try to set the EnableScriptGlobalization attribute on the ScriptManager to "true" and see if it does the trick? In my case it did :)


Hi Garbin,

Yes, it does work if I set this attribute to "true"!

Thanks:-)

Matthieu


EnableScriptGlobalization

=true doesn't do what it is supposed to do. I've enabled it and changed my IE language to French Canadian. It will change the day names but not the month name and the "Today" footer.

Is there a download of .vb sourcecode for the Control ToolKit yet?


Hi,

I see. However, it seems that awork item already exists for this issue, so it will surely be fixed as soon as possible.


I'm using IE with en-US localization; I've discovered another bug: all April months contain only 25th day; the rest of months are OK.

Any idea?


Sorry... 24thSmile

Saturday, March 24, 2012

ajax tabs like yahoo

hi guys..how do i create ajax tabs like which are used in yahoo main page.. please help me as im a begginer still ?

i have installed ajax control tool kit and all:)

there is no built in control for you ready to use..you need to write your own

try look it

http://www.codeproject.com/aspnet/TabControl.asp

if you want to avoid page refresh then you can try use updatepanel

cheers