Showing posts with label TechMumble. Show all posts
Showing posts with label TechMumble. Show all posts

Monday, March 30, 2020

Blog migrated to new home


After multiple attempts, I have finally gotten around to migrating my blog from Blogspot.com. It only took 15 years!

Going to leave the older blog up - till Google decides otherwise.

New blog is hosted at https://blog.aunlead.com

Saturday, April 24, 2010

The NoSQL movement & MongoDB

Michael Kennedy from DevelopMentor has written an excellent introductory article on the NoSQL movement and MongoDB (It's a document oriented database)

You can read it here -
http://www.michaelckennedy.net/blog/2010/04/22/TheNoSQLMovementLINQandMongoDBOhMy.aspx


@Bhushan - Does this give you chills? :-P

Friday, February 12, 2010

Visual Studio Team System 2008 Test Edition - Web Test error

I have been playing around with Visual Studio Team System 2008 - Test Edition for past couple of weeks. It’s a good tool for regression testing, automated testing (we can record macro's) and load testing using IIS (more on this later).

The issue I faced was when I ran web test (macro recording), visual studio would throw this error –


Request failed: Could not run Web test 'Login' on agent 'AGSPC00124': Method not found: 'Void Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext..ctor(System.Collections.Generic.Dictionary`2, Int32, System.String, System.String, Int32, Int32, Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel)'.

at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseContext..ctor(WebTestCaseVariation variation, Int32 webTestIteration, Hashtable runContextParameters)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestCaseVariation..ctor(WebTestElement webTestElement, Hashtable runContextParameters)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestElement.CreateVariation(IRunContext runContext)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestRunner.StartupVariation()
at Microsoft.VisualStudio.TestTools.WebStress.WebTestRunner.PlaybackThread()



I could successfully record web tests but could never execute them!

Solution -
The issue was because the web test agent couldn’t reference the Microsoft.VisualStudio.TestTools.WebTesting.WebTestContext correctly. It was resolved when I installed (actually reinstalled) the Visual Studio 2008 SP1 Link. Hope this helps someone.

Tuesday, February 09, 2010

Operation aborted error message in IE while using jQuery's BlockUI plugin

Recently we had this nagging issue with MS Internet Explorer 7 - On opening a page we would get an "Operation Aborted" alert message followed by a page not found error.

We had implemented TONS of jQuery function & plugins on the page and after painfully commenting and isolating each one, we found the culprit - a BlockUI function call! (or at least that's what we thought).

When the page was loading, we were calling a Ajax method which was supposed to populate the page with some data. During the call we used BlockUI's block page function to display a loading message to the user.



It was this call which caused IE to spurt operation aborted error.

On further investigation we found that it was an issue with IE. In fact IE versions -
  • Microsoft Internet Explorer 5.5
  • Microsoft Internet Explorer 6.0
  • Windows Internet Explorer 7


In fact, one solution suggested by MS KB was - Upgrade to MS Internet Explorer 8!!

Fortunately, another KB had more information about this error -

To quote Microsoft -
This problem occurs because a child container HTML element contains script that tries to modify the parent container element of the child container. The script tries to modify the parent container element by using either the innerHTML method or the appendChild method.

Source -
http://support.microsoft.com/default.aspx/kb/927917

This error was caused because we tried to modify a DOM element before the DOM was completely loaded. We could have avoided this by adding our code snippet inside $(document).ready() but that was not possible. So we took another approach.

Instead of blocking the entire page, we wrapped our page content section inside a DIV. And after </div> we added our BlockUI function call. So modifying our earlier script -



This fixed operation aborted error!

Wednesday, February 03, 2010

Using jQuery's grep to parse JSON data

jQuery's grep() is a powerful and underutilised filter method. It's a simple method which helps in searching/filtering data in arrays. Grep() is quite helpful when we have to parse JSON data. It's return type is an array.

http://api.jquery.com/jQuery.grep/
Description: Finds the elements of an array which satisfy a filter function. The original array is not affected.

Sample usage -

TO extract all employee ids.



ANother example on how to use grep() on JSON.

Consider sample JSON -


Suppose we need to extract only active employees from above JSON, we can filter the same using grep() and look for Active = True

Complete sample -

Monday, February 01, 2010

Adding rows dynamically to a table using jQuery - Part 3

In this post, I shall summarize the following -
• Adding a row function using an index
• AddClicked() method
• RemoveRow() method

This post is a continuation of Part I and Part II

We will create a row object (refer Part II) with the required elements and append it to the tabData table's tbody section (refer to Part I)



THe AddClicked() method -
This method would add a new row to the table.


The RemoveRow() method -
THis method can be used to delete user created rows.


I hope this series helped you in getting started with adding dynamically generated rows to tables. In the next post, I shall demo how we can add additional functionality like autocomplete to these dynamically created controls.

Sunday, January 24, 2010

Adding rows dynamically to a table using jQuery - Part 2

In this post we shall cover how to add a new row to a table. This post would be a continuation of Part I.

To dynamically add a row to a table, I would be using the append functionality of jQuery. We can use either the

CLONE method (http://api.jquery.com/clone/)
Create a copy of the set of matched elements.



or APPEND method (http://api.jquery.com/append/)
Insert content, specified by the parameter, to the end of each element in the set of matched elements.



I prefer the append method because we got more control on the generation of the element ids/names. In the clone method, the element ids are also copied & by default the events associated are not copied (Using withDataAndEvents parameter we can change this default behaviour).

The HTML which will be appended to the table body -



All the new rows added to the table would contain unique ids/names. The dynamically added controls have an index appended to them.

In the next post I shall explain the fucntionality of AddClicked() and RemoveRow() funtions. Also I shall explain how the jsonsyntax tag would help us in retrieving multiple control/element data for pre-processing; before its sent to the server.

Saturday, January 23, 2010

Adding rows dynamically to a table using jQuery - Part 1

This is gonna be a multi part series on how to use jQuery to -
• Adding rows dynamically to a table
• Assigning events to those new rows
• Processing/read the data

In this part, I would cover the html grid which would be used in this series.




This grid contain 4 headers (see thead tag). The new rows would be added in the tbody section of the grid. I have removed the tfoot section from the grid to make the example simpler, but if you do wish to add the tfoot tag, you need to add it BEFORE the tbody section.

Wednesday, January 20, 2010

Ajax response size limitation

In a recent project i worked on, we had an interesting experience with a limitation on the data returned by a ajax response, while using jQuery. We found that around 350 rows of data was returned by our web method, out of the 500+ rows. We initially thought the limitation was with jQuery but later found out it was with ASP.Net

Thankfully the solution to this issue was quite simple - in the web.config, the max JSON length had to be specified