Showing posts with label beta. Show all posts
Showing posts with label beta. Show all posts

Wednesday, March 28, 2012

UpdateProgress.FindControl() does not work in beta 2

We have upgraded to beta 2 and the following code (which worked under beta 1) does not work.

The FindControl() method is returning null and the UpdateProgress.Controls.Count property is showing as 0.

Is this a problem in beta 2? Can anyone help with a solution?

<asp:UpdateProgressID="atlasProgress"runat="server">

<ProgressTemplate><asp:LabelID="messageLabel"runat="server"Text="Original Message"></asp:Label></ProgressTemplate></asp:UpdateProgress>

Label updateLabel = (Label)this.atlasProgress.FindControl("messageLabel");if (!(updateLabel ==null))

{

updateLabel.Text = "New Message";

}

I tested your codes and found the same problems as yours.asp:UpdateProgress.FindControl can not work in Ajax Beta 2.Maybe this is caused by Ajax Beta 2 framework.

Here are some explanations from ASP.NET Team for your reference.

Summary:

Due to a known issue with ASP.NET AJAX Beta 1, you may find that Extender controls no longer work with templated controls such as GridView or FormView. This issue will be addressed in the next release of ASP.NET AJAX.

Background:

The ScriptManager component on your ASPX page is responsible for rendering out the client script (JavaScript) that creates the client side components. The ScriptManager walks the list of components that need these hookups during it's PreRender phase of the page lifecycle. Unfortunately, templated controls often create their inner control heirarchies during PreRender as well. Therefore, since the ScriptManager appears earlier in the page than the templated control, the extenders have not been created yet, and the hookups don't happen.

Workaround:

Fortuantely, for the common case, there is a simple workaround. You simply need to force control generation earlier in the page lifecycle. The simplest way to do this is to call DataBind method or Controls property from the Page_Load.

protected void Page_Load(object sender, EventArgs e)

{

GridView1.DataBind(); // for databound controls

object o = Login1.Controls; // for templated controls

}

Caveat:

This doesn't work for templated controls that make changes to their tree, such as a GridView with an EditItemTemplate in it. If you have that scenario, unfortunately, you'll need to wait for the next release of ASP.NET AJAX Beta 1 to enable it.

Wish the above can help you.


Hi I'm having the same problem with the AjaxControlToolkit

Dim temp_lkExportedCSV As HyperLink = CType(UpdateProgress1.FindControl("lkExportedCSV"), HyperLink)
Dim temp_lblPercent As Label = CType(UpdateProgress1.FindControl("lblPercent"), Label)
Dim temp_lblStatus As Label = CType(UpdateProgress1.FindControl("lblStatus"), Label)

temp_lkExportedCSV.Enabled = False | And here I get an exception, because no control was found.


And I called the Controls method in the page load just like it was explained bu tit still didn't work.

Dim o As Object = Me.UpdateProgress1.Controls

Am I doing something wrong?


Maybe it's the nature of the UpdateProgress that's looks invisible until the associated UpdatePanel is updating.


This is a known issue with the UpdateProgress control. It gets added very late in the page's lifecycle. Move your code to the Page_PreRenderComplete event or Page_Unload event. Page_Load is too early.

Updating a status label

I have a recently insalled the AJAX Beta 1 and I was wondering if it will enabled me to change a label multiple times in a sub... see the code below.

Protected Sub cmdSubmitUpload_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles cmdSubmitUpload.CliclblUploadStatus.Text ="Saving file on server..."'do the save herelblUploadStatus.Text ="Verifying file..."'call a routine that verifieslblUploadStatus.Text ="File verified."End Sub
I want to change the label and have the user see it change every time.  Is there a way to do this using AJAX?

Hello, the code that you write for an event handler will run on the server when the request is received, and the result of this is one and only one response that will update the page. If you want to provide this kind of feedback, you would need to write more client side code that executes each part of your process separately and can update the label before each step. You can seach msdn for a Whidbey feature called CallBacks that will allow you to do this, or you can make use of Atlas ability to call webservices from script.

Hope this helps,
Federico

Saturday, March 24, 2012

Upgrade error: Could not load file or assembly Microsoft.Web.Extensions, Version=1.0.61025

I have upgraded from Beta 2 to RC1 and followed all of the upgrade instructions, but I'm still getting this error:

Error 26 Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I'm aware that Microsoft.Web.Extensions is now System.Web.Extensions, but I can't find where the old reference is!!!

I have searched all the files in my project for "Microsoft.Web.Extensions" as well as the machine.config. I'm currently searching every file on my hard drive for this reference and still can't find it.

Any ideas?

Thanks,

Still looking for some help...
Do you have the ControlToolkit on your site? We had that error before we updated to the newest toolkit.

I've found you have to move the DLL files form the .NET version folder on the hard drive to the bin folder in the site otherwise they need to be in the GAC.

I'm finding other problems with it. Like [no relevant source code lines] gotta be permissions or something.

Still looking...


I have the same problem and finally found out that the reference to Microsoft.Web.Extensions is in my web.config.

Have to go through and changes all "Microsoft.Web" to "System.Web" (mainly under the<pages><controls> tag).

Upgrade from Beta

Hi ive got a server that is running ASP.NET 2.0 AJAX Extensions Beta 2,

ivebuilt a new app using the official release 1.0, when I place the new framework on the server will it cause any issues on my existing app as they will be runing side by side?

I believe that during the installation of the latest version, you will be prompted to remove the old version first. So you will need to upgrade your existing app first.

I'm not sure if copying the dlls directly from where you installed them on your machine and pasting them into the server's GAC would work or not, but it's worth a shot. Technically they're different versions and should be capable of being installed side-by-side, but the installer doesn't allow it.


There are migration guides availablehere. Side by side install is not supported. You need to upgrade to ASP.NET AJAX 1.0.

Upgrade to Beta 1 = New Rating control error

I installed the latest framework and toolkit.

My project was working fine with a wizard control that contained rating controls. I've taken the rating controls out of the wizard template and put them in their own update panel and still receive the error. It's a very strange behavior. If I make a new page and do everything, the rating control works fine. I'm using the latest control and did all the changes required to use the new Beta. After the install, I keep receiving this error when loading the page:

System.InvalidOperationException was unhandled by user code
Message="The TargetControlID of '_RatingExtender' is not valid. The value cannot be null or empty."
Source="Microsoft.Web.Extensions"
StackTrace:
at Microsoft.Web.UI.ExtenderControl.RegisterWithScriptManager()
at Microsoft.Web.UI.ExtenderControl.OnInit(EventArgs e)
at AjaxControlToolkit.ExtenderControlBase.OnInit(EventArgs e) in C:\Program Files\Microsoft ASP.NET\AjaxControlToolkit\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:line 338
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlCollection.Add(Control child)
at Microsoft.Web.UI.UpdatePanel.SingleChildControlCollection.AddSingleChild(Control child)
at Microsoft.Web.UI.UpdatePanel.AddContentTemplateContainer()
at Microsoft.Web.UI.UpdatePanel.CreateContents(Boolean recreate)
at Microsoft.Web.UI.UpdatePanel.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks

Anyone ? Can you please take a look? I believe others are experiencing something similar with the mentioned TargetControlID.

Thanks


When the project breaks, it breaks at the bold:

/// <summary>
/// On Init we load target properties values and process databinding handlers.
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
if (EnableClientState)
{
CreateClientStateField();
}
// EnsureProfileScriptService(ScriptManager.GetCurrent(Page), true);
Page.PreLoad += new EventHandler(Page_PreLoad);
base.OnInit(e);
}


Please reply with acomplete, self-contained sample page that demonstrates the problem. Thank you!

In my case the problem occures when I specify the rating control in the skin file.

Skinfile:

<

ajaxToolkit:Ratingrunat="server"StarCssClass="ratingStar"WaitingStarCssClass="savedRatingStar"FilledStarCssClass="filledRatingStar"EmptyStarCssClass="emptyRatingStar"/>
Good to know! Do you have a complete, self-contained sample we can play with?

Just add the following 2 lines in the Default.skin file of the Ajax Control Toolkit SampleWebSite:

<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>
<ajaxToolkit:Ratingrunat="server"StarCssClass="ratingStar"WaitingStarCssClass="savedRatingStar"FilledStarCssClass="filledRatingStar"EmptyStarCssClass="emptyRatingStar"/>

Then try to open the Rating sample of the SampleWebSite.


The SampleWebSite doesn't have a Default.skin file - might there be something else going on here that's causing issues?

Upgraded to RC but the Bug lurks

Hi,

I have upgraded to AJAX RC version from AJAX Beta 2...... I have a Page that has a MasterPage and I'm building an HtmlTable at runtime and Add to an already existing Panel in this Page. This Panel is in an UpdatePanel.. It doesn't simply does a full postback and not an asyncronous one...

This seeems to be something related to a MasterPage since when done without a MasterPage it just works fine

please shed a bit of light on this... this is a bug that lurked from Beta 1.. anyone knows why...?

Thanks !

so no one knows or happened to come across it?

please!


Can you provide the source code. If there is no javascript error on page, I believe it might be something to do with the web.config. Make sure that legacy rendering is OFF in web.config.

vineetc


source code?

Panel1 is inside an UpdatePanel with a MasterPage.

Panel1.Controls.Clear();
Panel1.Controls.Add(new Template_cls().BuildTemplate(3, 3, 2));

BuildTemplate method returns an HtmlTable and adds it to Panel1.

...... the same code applied to a page without a MasterPage works fine.

In the web.config I have no legacy rendering .. doesn't exist. The Web.Config is updated with the latest release of the RC version.

Thanks!


I don't know why no-one wants to answer... possible that no-one uses MasterPages with UpdatePanels and creating controls at runtime?!....there's a bug

hmm... actually that works fine yes...maybe I didn't describe myself correctly

What you said is part of it and works fine. I'm adding a GridView control at runtime. The GridView has the "Select" commands. When I click the "Select" command it does a full postback to the server even though its under the UpdatePanel!


Thanks and sorry for not describing myself correctly.


I tried something like this and everything worked fine.

<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="panel1" runat="server">
<asp:Button ID="Button2" runat="server"Text="Button" OnClick="Button2_Click"></asp:Button>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:ContentPlaceHolder>
</div>
</form>

On Button2_Click, I add a control inside the panel.

protected void Button2_Click(object sender, EventArgs e)
{
Label lb = new Label();
lb.Text = "label";
this.panel1.Controls.Add(lb);
}

You need to verify that legacy rendering is OFF in your web.config. You might have to move up the hierarchy of your website and see if there are any web.configs where it might be on.

vineetc


So basically it makes a full postback when a GridView with "select" commands is added to an HtmlTable which in turn is added to a Panel that is under an UpdatePanel AND also when the Page has a MasterPage. It makes a full postback when you click on the GridView "select" command button. Both HtmlTable and GridView are added at runtime.

This is a very specific error, I'm sure its a bug so please check it out!!. It works well without MasterPages. I don't know whats with the GridView "Select" commands when under a UpdatePanel pertaining to a page has a MasterPage.

Thanks!!

Upgraded to AJAX Beta 2 - Now getting IE error Operation Aborted

...and page fails to load. If you refresh all is ok.

All I have used is Autoextender and updatepanel on the page with a master page.

Any ideas what this bug is and how to fix it?

MasterPage/ContentPage Scenarios
You may have a ScriptManager on your master page, but you may want to add additional script or service references in your content page. However, you can only have one ScriptManager on your page. Therefore we have the accompanying ScriptManagerProxy control.
<asp:Content ...>
<atlas:ScriptManagerProxy runat="server" id="scriptManagerProxy">
...
</atlas:ScriptManagerProxy>
</asp:Content

hello.

difficult to say what's happening without getting more info about the error...


I also upgraded to Beta 2 and now getting this error : but it is intermitant and really dont know what bit of code is doing it.

www.destinationrussia.com

Any ideas?


Hi,

I installed Ajax Beta 2 and future CTP Novemner in my PC.I could accesswww.destinationrussia.com through IE 7.0,FireFox and Opera and found the web page was loaded correctly for the first time.There are no any browser errors happened.Can you post some error message here?


Jasson_King:

Hi,

I installed Ajax Beta 2 and future CTP Novemner in my PC.I could accesswww.destinationrussia.com through IE 7.0,FireFox and Opera and found the web page was loaded correctly for the first time.There are no any browser errors happened.Can you post some error message here?

its a very intermittant error... i am driving myself crazy dealing with it to, as i cannot replicate it on demand

Luis Abreu:

hello.

difficult to say what's happening without getting more info about the error...

Want more info?
http://forums.asp.net/thread/1471506.aspx
http://weblogs.asp.net/infinitiesloop/archive/2006/11/02/Dealing-with-IE-_2600_quot_3B00_Operation-Aborted_2600_quot_3B002E00_-Or_2C00_-how-to-Crash-IE.aspx
http://www.ryangrant.net/archives/internet-explorer-cannot-open-the-internet-site-operation-aborted-google-map-api/

This error is indeed a tough one to track down

Upgrading from Beta 2 to 1.0 in production server

Hi there! I'm going to upgrade MS Ajax as subject. I read somewhere else I should restart IIS to make it use the new version. How can I do it without restarting the server? Any other things I should have in mind while performing the upgrade?

Thanks,

-Benton

Hi benton,

Restart IIS --> Open --> run --> iisrestart

Regards,