Tag | Javascript Posts

If you’re a web developer using Microsoft technologies then, unless you’ve been hiding under a rock somewhere, you’ve probably heard of ASP.NET MVC. If you’re not sure what it is, how it works, or why you would want to consider using it, you’ll find three videos on the ASP.NET MVC page that will answer most, if not all, of your questions. Video #1, titled “Why Use ASP.NET MVC?”, is a 3 minute video which provides a high-level overview of ASP.NET MVC for decision-makers. I especially like the motor ...
This whole IE6 mess starts out with PNGs. I'm not much of an image editor, (okay, fine. I can't crop a picture in photoshop to save my life.) but I do know that PNGs are pretty sweet. Basically they allow varying degrees of transperancy, and really, who can say no to that? IE6 can! One of our clients decided that they wanted a gradient in the header of their site. No problemo, we'll just whip up a gradient image and stick it in the background. That was easy enough, but oh wait there's a bit of an ...
What is something that is longer than a magazine article and shorter than a book chapter? Give up? It's a Wrox-Blox that Wiley has available online with some going for less than $10.00. Written by the best programmers in the their fields, Wrox Blox are short informational pieces and code that will help get you up-to-speed and keep you up-to-date. Build the knowledge you need quickly on a wide variety of topics. In the DotNetNuke world, there are several of these available for you to review and stay ...
Twitter can be a very useful source for data aggregation on any particular topic. Am building an application that will search twitter using their API and then display the results using jQuery. There are 2 ways of accomplishing something like this. We can either do the processing at the server and then populate the page or talk to Twitters REST based api directly from the client. Methods to retrieve data from the Twitter API require a GET request. Methods that submit, change, or destroy data require ...
Most people can agree that testing your software is a good thing. Most developers will agree that unit testing is a great thing to have. But how about testing your web site? Fair enough you can run unit tests on your code behind, but unit testing a GUI can be problematic. If you struggled with this problem, don't worry - you're not the first! I've recently become aware of Selenium. Selenium is a very powerfull tool for testing web applications. It gives you a lot of nice features to help you test ...
Recently I had to code some functionality that required event delegation in JavaScript. After searching I came across this great post by Karl Swedberg about how events can be delegated using jQuery. This can be a very useful approach if you want to add new elements to the DOM and have them react to events without re-binding events handlers or if your page simply has too many elements that need to be wired to an event. The basic concept it simple: Instead of attaching an event to an individual element ...
So a little fun bit of backstory. I'm updating a web form at work and basically what it does is allows a user to order some brochures by selecting the quantity of each brochure they'd like to order. Clicking submit takes you through the process of going to an order confirmation screen, inputting your address and finally getting an order complete screen. Sounds easy enough, right? Well, read on my friends. I got a change request (oh, I do love the change requests..) to add an out of stock message ...
Based on a few examples i found when googling the web, i made a class that can help you query excel sheets in a very simple way with plain vanilla .NET code. Our example file contains one sheet with the name "Sheet1", listing a few employees. Id FirstName LastName Age 1 John Doe 35 2 Bob Smith 42 3 Charlie Smith 40 4 Steve Rights 29 5 Bill Abrams 24 Now lets say that you would like to read all employees from this sheet into an anonymous type list and order the result by age. The following console-application ...
I was recently introduced to the PAL (Performance Analysis of Logs) tool. This is a great tool that allows you to produce HTML reports based on the analysis of performance monitor counter logs. It applies complex thresholds based on those defined by Microsoft. The HTML reports produced include charts and very useful descriptions and links for important counters, they also contain various degrees of alerts for when thresholds are exceeded. These reports can be very useful aids when performance tuning ...
Yes, I know, the multiple file uploading in ASP.NET issue has been exhaustively covered already elsewhere. There are examples of multiple file uploading using ASP.NET user controls, there are examples using jQuery, there are examples using flash to provide progress feedback, and even examples in Silverlight. However, what I wanted was a simple solution which allows the user to select a variable number of files, didn’t rely on postbacks in order to increase or decrease the number of files selected, ...
Are you using the Microsoft AJAX framework with your ASP.NET application and are worried about the cost to maintain and serve up the javascript library components along side your application code? Well Microsoft just introduced the Microsoft AJAX Content Delivery Network. They host, mantain and serve the AJAX javascript library on their servers and you can point to their library files at ajax.microsoft.com from within your application <script> tags. Right now it appears to be limited to AJAX ...
Muljadi Budiman was the top-rated speaker at the recent St. Louis Day of .NET event, and it’s easy to see why. His presentations are energetic, humorous, and packed with useful information. At tonight’s St. Louis .NET User Group meeting, he zipped through an overview of Visual Studio 2010 and 4.0 features of C#, VB, WPF, the CLR and the DLR in a little over 90 minutes. Highlights included: VS2010: multi-monitor support Call Hierarchy visualizer “Navigate To” improvements “Consume-First Development” ...
I needed to get a pop-up window to come up in ASP.Net. Now while JavaScript happily does this (with the alert(); function ASP.Net does not. So I needed to work out how to do it. Another wrinkle in this comes from Ajax. None of the JavaScript code seemed to work when placed in an AJAX page. As I have now been tasked with changing this code and moving from the Anthem Ajax library to a pure MS solution it was time for this died in the wool VB/C# developer to get his head around getting these scripts ...
Problem Statement: To Evaluate a complex expression in dotnet and show the result to end users. The expression could be something like this X2 +Y3+Log10 (z) . Solution: There are different ways to solve the problem stated above. Am planning to show how to use Scripting Engines like Jscript/VBScript inside C#. We can make use of Windows Script Control to achieve this. Windows Script control can be downloaded from MSDN site. It is shipped as an Activex control which lets you make use of JavaScript ...
There are lots of places we can use XML 1. Where we need a place to hold some data, can read / write / manipulate without having any database. Even we can use textfile, but XML is more flexible – say which field, what is the data type, etc., if we use text file, we need to predefine what is the sequence of each column and what dataype etc., 2. Where we need to transfer some data from one pace to another like one layer to another, one tier to another etc., – we can serialize the xml and deserialize ...
The new Italian Windows Embedded support forum is now active: http://social.microsoft.com... Here Italian speaking users of the different Windows Embedded platforms can discuss, post their questions and, hopefully, receive good answers in their own mother tongue (and also my own mother tongue, as you can understand from the poor english of this blog!) ...
Like many ASP.NET developers, I’ve gotten by for years knowing just enough JavaScript to get by. I’ve spent many frustrating hours cursing the language, when the problem was not really JavaScript (although it has more than its share of weirdness), but my assumption that I knew how it worked, just because it looks like C#. Now, thanks in large part to jQuery, I actually enjoy client-side programming. jQuery makes things so much easier (replacing dozens of lines of code that I painstakingly figured ...
Scenario: For some reason you want to stop the user from closing the browser window or from redirecting away from the current page, based on some condition. The solution: window.onbeforeunload = function(event) { return true; } This will prompt you for input (like the JavaScript confirm pop-up menu). There is no way to override the text though. Some concerns: This works great but it may not be what you want all the time, as no matter if you click a hyperlink, hit submit, etc will prompt the user, ...
I was having an discussion with my wife on things to come in computer software and silverlight. below is a brief snippet: My wife holds an computer engineering degree and is passionate about new innovations. She is a prolific programmer though she ONLY codes when she feels like(or finds a problem worth her attention) and thus is NOT a regular coder like mortals like me who are ... well, just coders, who codes for money:D Wife: What is this buzz around Silverlight? Subodh: Because we need smarter ...
Go to the forum control panel, Templates. If want to modify the ForumView, click on it and insert your Adsense code after the very first [BREADCRUMB], ie: <%@ Register TagPrefix="am" TagName="ForumJump" Src="~/DesktopModules/NTFor... <%@ Register TagPrefix="am" TagName="Stats" Src="~/DesktopModules/NTFor... <%@ Register TagPrefix="am" TagName="WhosOnline" Src="~/DesktopModules/NTFor... [BREADCRUMB] ...
Well, for a long time I have been a big fan of open source software, and although I'm not specifically a .NET developer, it's my main focus, as everything I do work related is .NET. I've known about The Mono Project for a while, and I typically run Ubuntu as my OS of choice, with XP running in a VM for when I really need it. Well, I haven't booted up Ubuntu for a while, having been really busy doing work stuff, so today, I decided that it was time to take Ubuntu's Latest version, Jaunty Jackalope ...
All right, so it may have been a day or two since my last post. I was hoping I'd have the option to post-date to make it look like I was a much more diligent blogger than I really am, but oh well. Apart from just wanting to look like I blog more regularly than once a quarter, there's actually a lot of material to cover. I'm not sure exactly how I want to accomplish this, so there might be a spate of blogs close together just to cover all the things I've worked on so far and the challenges involved. ...
For many customers the ROI on software licences is one of the key factors when purchasing software, so when deploying an e-Commerce solution the level of return for frameworks, and CMS platforms such as Commerce Server and MOSS are quite justifiable, however it is the extra features – such as the Store Locator that is difficult spending licensing money on. The current store locator within CS 2009 is based on a commercial Microsoft Virtual Earth web-service, which is provided for non-developer used ...
This is a topic that has been beaten to death. I know it, you know it, but I'm still going to give my version of it, just because I can. One thing I'm going to try to do different from every other "implementation" of this topic, as actually make it practical. It's great that for good design you should follow <insert design pattern of choice here>. And for the crowd that's going to comeback with "The design pattern isn't as important, so long as your code follows the SOLID Principals", well, ...
So, today I was working with the ASP.NET Report Viewer Control. If you don't know what that is, it's an ASP.NET control that comes with .NET, and what it does is allows you to display a SSRS Report on your website. True to ASP.NET, it seems very simple at first, drag, drop, set parameters... and then of course, there's the fallbacks on the things it cannot do. A major thing to me, when I'm developing a website, especially recently, is performance. I hate going to a website, and waiting more than ...
I had looked up the LoadControl(“”) method earlier today, and came upon a short website entry that quickly discussed how to load a web user control (.ascx) dynamically onto a page. The link is: http://www.codeproject.com/... It mentioned inside that a CMS (content management system) could be built using this method + a database table to track these controls. It got me intrigued, so I decided to pursue it. It’s pretty simple, and actually adds a lot of cool functionality ...
Pretty straightforward this one - you can see an example here <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml... xmlns="http://www.w3.org/19... <title>Simple spinner</title> <script type="text/javascript"> function RotateSpinner(spinnerId, up) { document.getElementById(spi... = up ? parseInt(document.getElemen... + 1 : parseInt(document.getElemen... ...
Normal 0 false false false MicrosoftInternetExplorer4 st1\:*{behavior:url(#ieooui) } /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.000... mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} ...
Issue: I have a grid which I have what I can only describe as containing “Core” data and “Minor” data. What I'd like to be able to do is to show the Core data in the main grid view but to allow the user to add/edit/view the Core and Minor data when they open the relevant dialog. In essence this would be like having hidden columns that were viewable/editable when the dialogs were opened with form editing/viewing. The Minor data is only of interest to some users, so I don't want to show it in the main ...
In a previous post, I showed how to submit an AJAX form in MVC with the jQuery Thickbox and the built-in MVC AJAX helpers. If you read that post first, it will show the complete context for how to simply submit an AJAX form that is being rendered inside a jQuery Thickbox with built-in MVC AJAX helpers. But what if you want to stick to a pure jQuery solution? That is also simple enough to do. Instead of using the Ajax.BeginForm() method, you can use the jQuery Form Plugin. The code is almost identical ...
This is a part of EXT JS Tutorial In this part of the Ext JS tutorial I would like to show the Ext.MessageBox class. In the first part, where I showed how to add Ext library into MVC project, I have put there a Ext.Msg.alert to test the installation. Actually the Ext.Msg it is an alias for Ext.MessageBox class. Both can be used interchangeably. Ext.Msg.prompt Ok, so let’s create a first dialog to see how it’s look like. Let it be a Ext.Msg.prompt. This method displays a message box prompting to user ...
Scenario: You have a drop down box or list box in your jQuery jqGrid plugin and you edit the row via the form edit modal dialog but the form fails to show your selected option(s) in the drop down or list box. The reason: The jqGrid SELECT element binds the selected option(s) innerHTML (not the value) with the name value in the colModel. Example: In the JavaScript file I have a function that I call to setup the grid: function jqGridAccountContact(item, listURL, editURL, $rows, hideGrid) { //get all ...
VS 2008 requires you have VS 2008 Test Edition to see the results of a Generic Test, this wasn't sufficient with out current project as a lot of developers don't use test edition. I put together this custom xslt transform to convert the .trx test result file to an html report anyone can view, complete with collapsable sections...Here is a link to the latest version of the XSLT: http://yourcomputer.com/TRX... is the TrxConverter.cs file I use to Generate the html.http://yourcomputer.co... ...
For those of you who missed the chat today, here is the raw transcript. By raw, I mean that I copied and pasted the discussion without any edits. This is divided into two parts, the top part is the answers from the Microsoft Experts and the bottom part is the discuss (questions) from the audience. Answers from Microsoft: RajeevDu[MS] (Expert): Hi, This is Rajeev Dubey, Bluetooth Program Manager. Sue Loh [MS] (Moderator)[12:02]: Hi, I’m Sue Loh, a developer in the Windows Devices Core team at Microsoft. ...
Ext JS is a very powerful javascript UI library which allows you to create a rich internet applications. Ext JS is very easy in use, in learn and has very intuitive API. Supports all major web browsers (IE, Opera, Firefox, Safari). Starting with this post I would like to initiate a series of articles explaining the nuances of how to use a basics Ext aspects in web developments with ASP.NET MVC and how to create a great-looking user interfaces in web apps. Links to all related articles to this tutorial ...
This is a part of EXT JS Tutorial To successfully carry out everything that has been described in this article you need: Normal 0 21 false false false PL JA X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:Standardowy; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.000... line-height:115%; ...
Hey All, I know of the conditional CSS code you are supposed to use when modifying css on a per-browser basis. Recently I ran into an Issue with IE8 only, a search box was not aligning vertically with the search button next to it. This was working in FF2, FF3, IE6, and IE7. IE8 was the odd man out. In this case, conditional css was out of context. Then I found this article: http://www.ironpaper.com/cu... AMAZING Works ...
Originally Posted Here: http://www.thegrubbsian.com... I’m almost positive someone has come up with this pattern before, but it was a big help on a recent project so I thought I’d share it. The basic goal of the pattern is to make the setup and teardown work of test classes reusable. We found this to cause particular pain for integration tests written against a database where multiple dependent records needed to be created before the actual test could be performed. ...
In my previous blog post, I have discussed about how to get asynchronous JQuery treevew to work with ASP.NET Webservices, and we identified that, to make a successful ASP.NET webservice call using JQuery the request must be POST request, the content type of the request must be “application/json; charset=utf-8”, and the data parameter of the the $.ajax() method must be passed as a string. We also looked at the tweaks that we need to do to the jquery.treeview.async.js file to get that working. However ...
Was doing some research this morning, as usual, and came across a post from Giulio Bai on jQuery performance tips. A lot of his tips are things I’ve heard elsewhere (no offense!), but one that I haven’t seen anywhere and for some reason surprised me is that using a the JavaScript provided for() loop is considerably faster than using jQuery’s each() function. In fact, it can be several orders of magnitude faster depending on what you’re doing. Interesting. Link to his post Technorati Tags: jQuery,performance ...
A few days ago I got an error report to fix. Some web application that I now maintain was inserting duplicate records. After a quick look it became obvious that the users where double clicking the submit button and that made the page post twice and so a duplicate record would appear. A quick fix dor this problem using javascript: <script language="javascript" type="text/javascript"> var haveSubmitted=false; function FirstSubmitOnly() { if (haveSubmitted) return false; haveSubmitted = true; ...
This example shows the basic way on how to access control from external javascript file (.js). Normally, we use the following line below when accessing control within our JavaScript method in the page. document.getElementById('&l... TextBox1.ClientID %>'); AFAIK, Using Inline expression like <% %> will not work within external js files. As a workaround we can pass the id of the control (eg. TextBox) to the funciton as a parameter instead like: External JS file: function GetControlValue(obj) ...
In this Submittal-only Issue: Davide Zordan, Michael Washington, Charlie Robbins, Alex Golesh(2), Pencho Popadiyn, and Danijel Stulic From SilverlightCream.com: Silverlight 3 / Expression 3 behaviors for enabling Multi-touch gestures Davide Zordan provides two Behaviors for gestures with a Multi-Touch device. Don't miss Tim Heuer's article he references, and if you're a WPFer, he also has a companion post A WPF custom control for enabling Windows 7 Multi-touch gestures Silverlight 3 Drag and Drop ...
I had one of those problems that I had trouble resolving with a search engine this past weekend. Once it was pointed out to me what I did wrong, it was really quite simple. Basically, I needed the enter key to fire a function from a certain input textbox. I wrote up a jquery script, and it worked for IE, Chrome, and Safari, but it did not work for Firefox. Here was the script. $("#Location").keydown(func... { switch (event.keyCode) { case 13: findFresh(); break; } }); Do you see the problem? ...
There is a compilation of quite a few "How Do I?" videos related to windows mobile here. Take a look in your free time, some videos might be of interest to you. Videos I liked: How Do I: Use Bing inside a Windows Mobile Application? How Do I: Create Localized Applications on Windows Mobile Devices? How Do I: Use the GPS Intermediate Driver to Retrieve Location Information? How Do I: Associate an Application with the Hardware Buttons on a Windows Mobile Device? How Do I: Schedule an Application to ...
I didn’t leave work until 8PM this evening. I was wrestling with a JavaScript/JQuery problem and it became a personal battle to bend this application to my will. (Maybe in some future post I’ll talk about how horrible that is.) So I didn’t get it before I left, but I came home and started hitting it here on a test project. There seems like there are probably some scripting conflicts in our project (we have the JQuery stuff and prototype in there), so it didn’t take be but about a half-hour at home ...
1. Create a CSS Class that allows you to highlight invalid inputs and display messages in a pretty way input.error { background: #fed; border: 1px solid red; } 2. Create validators.js. Here are the contents from that file: ValidatorCommonOnSubmit = function() { ClearValidatorCallouts(); var result = SetValidatorCallouts(); return result; } ValidatorValidate = function(val, validationGroup, event) { val.isvalid = true; if ((typeof(val.enabled) == 'undefined' || val.enabled != false) && IsValidationGroupMatch(val, ...
Usually the style you organize code is just that A MATTER OF STYLE, in javascript however it’s not. If by any chance you end up writing the following code: var display = function() { this.x = 10; return { alert: function(message) { window.alert(message); } } } you might be in for a surprise but it won’t return anything because by default the javascript interpreter inserts ; after every line that doesn’t already contain it or }. Instead you should write: var display = function() { this.x = 10; return ...
When we develop our silverlight widget the sample page that we use normally is a nice servier side control called asp:Silverlight, that’s quite nice if you use ASP .net 3.5 SP1, but… what if your widget has to run on ASP .net 2.0, or PHP, or a plain HTML page… Well… the first thing to note down is just that asp:Silverlight control is a nice server side control that is translated into HTML, no more no less. You can as well define directly an OBJECT tag and instantiate the control. What are the main ...
When building RIAs there is sometimes both the need for complex rich interfaces and simpler standard html interfaces. This is more common when introducing the rich experience into an existing web application where it makes sense to maintain some of the existing functionality and introduce the power of Silverlight in targeted functions. In such a circumstance when we have business functionality in Silverlight and in ASP.NET/HTML pages - wouldn't it be great if we had the ability to interop between ...