Welcome to Tech-Review.Org Sign in | Join | Help

.net_2.0

My coding blog entries. Typically will either be more complex coding examples or overcoming product issues / troubleshooting resolutions.
Ajax Version 1 released and my issues...

It's been awhile since the last post on the blogs here. I had to walk away from the beta stuff as I was personally just getting irritated that with each 'bug' issue I posted it never got addressed or my questions on the forums never got answered.  However, Microsoft released the official Version 1.0 of Ajax meaning basically now you can pay to have support if you call the tech hotline.  It also officially means that if you had an issue before and it wasn't addressed - odds aren't it was not addressed.  But it is all GO-LIVE now. All sarcasm aside...

 

Overall the upgrade process from RC version to RTM was relatively painless.  Unless, of course you use validators.  MattG has a entry on his blog on how to implement the work around until Asp.Net 2.0 Windows Update fix comes down the pike on Windows Update some time in Febuary. 

 

That link is this: http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx

 

What wasn't fixed:

 

AjaxToolKit: MSFT AjaxToolKit: Bizarre DynamicServicePath - well Path Issue AND SOLUTION even though it was stated it would be..

 

What was fixed.  Modal's now no longer loose the dropdownlists when a ModalPopup is invoked and cancelled in IE or FF.

 

What wasn't fixed:

 

Broken image links will cause the update panel and toolkit controls to go beserk.  However, beyond a 404 not found - as shown in fiddler - you will have no idea it was an issue unless you start actually testing your application and soon realize that you start getting weird behavior. 

 

The ScriptManager error module does not capture all Ajax error events but somehow it manages to hide from the  .Net 2.0 exception tracking - the actual hard exceptions.  For instance - for some reason a Modal with multiple controls was invoking a dynamic control that was apparently not being invoked properly and therefore could not bind a datasource...Instead of a actual exception being thrown where it would of been logged.. instead the SC< would respond with a "Could not find control " in a control that was loaded after the control that generated the first error.  Try tracking that down.  But then this has been a problem since it went from the Atlas codebase to the Ajax RC codebase.

 

Once the SCM gets into a certain state - it is almost impossible to track down coding issues. For example the image not found I stated above - typically not having a image not found should not cause the DOM get into a distorted state.  However, the SCM / AJAX looks at it as a missing resource and therefore bombs out on any other axd requests.  I had mentioned this in the forums before but that post just ignored.

 

In some the project I am working on - I had a Modal within its own update panel and a seperate panel that housed a gridview (you can see my blogs on this as this has been the only Ajax related thing I have worked on)...The Modal had about 15 controls that I used the CSS display:none or style.clear (from [controlname].Style.Add or Clear..in code behind.  I dscovered that the AXDs were being truncated with a large amound of script data.  More specifically, since the modal's update panel was seperate from the gridview's update panel but the update panel would invoke the modal (getting confused here?) that even if the updates occured in the modal update panel the gridview's modal would also invoke and somehow wrap them both up.  So, I did two things:

 

1. I removed any and all updatepanel.update() from code-behind. 

2. I nested the modal update panel into the gridview panel and subsequently made each control being loaded in the modal have its own update panel(alot of nesting going on here now).  This got rid of a bunch of JS errors that I had no idea what they were because the SCM would not generate a error - no CLR exceptions were being thrown but using Firebug in FF - could easily be seen.  All of those errors were in the ScriptResource.AXD.

 

So, now I am having to do a bunch of logging each step of the code that is in the control.  Where normally I would just do a try / catch on the calling method - now I have to do it on pretty much each and every method especially anywhere there is a case a error could be thrown (but should generate a stop - application exception).  This is time consuming and considering that I have the asynch error code in all of the modules (part of a delegate that all controls inherit from).. none of this should be an issue but is..

 

Other quirks:

 

Modal Popup from the toolkit scrolls the background when using a scrolling wheel on the mouse.  So not only do you scroll the modal but when modal size is exceded it scrolls the background page.  What is even weirder that the background page scrolls indefinitely...  Kinda nuisance and considering if this is the trade-off from having databound controls dissapear on a Modal Popup invocation - I'll take the nuisance...

 

I can't get a actual javascript routine to work via any of the documention provided.  I spent a good two days trying to trace down the 'known work around' (its so well known there are no links to code anywhere but everyone says its out there just search for it - me thinketh - myth..).. Finally found some code that might work , placed it in a script file - added the Sys..(notifiy when loaded) at the end...added the code..  added the:

 

protected override void OnPreRender(EventArgs e)

{

try

{

ScriptReference reference = new ScriptReference();

reference.Path = (ResolveUrl("~/scripts/uploader.js"));

SM.Scripts.Add(reference);

// ScriptManager.RegisterClientScriptInclude(

// this,

// typeof(Page),

// "AIM",

// ResolveUrl("~/scripts/uploader.js"));

bllLogging.RecordMessage(LoggingID + "OnPreRender: Ref Path="+reference.Path+" ImageUrl is"+imgLogoPreview.ImageUrl.ToString(), "Cid=" + currentID + " mode " + modeID + " showmodeflag " + spoofInitForModal, Severity.Informational, LoggingID, "Skin file is: " + SkinFileName + " NameSpace: " + SectionContent);

 

}

Tried a multitude of things but not quite sure why its not working or why other code didn't work - I simply never get the script loaded.  I am concerned because as the main portion of the blog entry details - if its an error elsewhere...and the SCM is hiding it (as I get no errors running this code)..well java me confused..

 

So, all in all - pretty much more of the same. 

 

Here is what I would like to see:

 

1.  Stop doing all the video tutorials without a corresponding written article.  Personally I find watching programming videos the worst spent time. Myself - I just want an article and code snippetts to cut and paste and play with... last time I checked there was no clip and paste from video feature...

 

2. Actual examples of solving real world issues with the core AJAX product (and not the AjaxToolKit... For example - how do we convert gridview java for highlighting on mouseover ...How do we work around the fileupload issue with the hidden iframe using AJAX and JAVA...(I am thinking of using WCF for this myself and or WebMethods to work around the asynch uploading issue)

 3. How to determine when we need to change from a Page.ClientScript to ScriptManager.ClientScript especially when trying to render control attributes..The Page routines work but do they break the SCM/  (That was another thing I did was nuked all references to Page.[register anything]...

4. Somewhere - all of the known answers to typical answers should be formulated into a series of FAQ stickies..on the Forums.  The search feature on ASP.Net is deplorable.  Notice no search box on the forum now.  When you click the searh button - it shows all forums selected, and not the calling section anymore, and retains no viewstate less the words to search and resets everything.  It also doesn't sort according from most recent date which makes it incredibly difficult to sift through everything...

 

Anyways... This is what we have to work with...  And these are merely my experiences and opinions...

Posted: Thursday, January 25, 2007 1:22 AM by Jody

Comments

No Comments

New Comments to this post are disabled