Tag | Javascript Posts
At this week's Virtual Brown Bag meeting: Claudio has some one-month Evernote premium accounts to give away Claudio & George talked about FancyHands, the 4-hour work week, and paying people to do the stuff you don't want to JB shared more Ruby gems: cancan and open and talked about insert and other Ruby Enumerable functions We looked at the winner of the 1KB JavaScript Christmas contest and some fun YouTube videos For detailed notes, links, and the video recording, go to the VBB wiki page: https://sites.google.com/si... ...
This is a fairly easy way to compare values for two different controls. In this example a user needs to enter in a street address and zip code OR pick a county. After that the application will display location(s) based on the value. The application only wants a specific street/zip combination or a county, not both. This code shows how to check for that on an ASP.Net page using some JavaScript. The control code: <table> <tr> <td> <label style="color: Red;">Required Fields</label> ...
For a project I needed to use the ArcGIS API for some mapping. To use this you need to use Dojo but in this case all it really comes down to is adding some require lines and a addOnLoad on your web page. At first everything was working great, the maps rendered and the various layers would populate as needed. Once it was working I started moving the various javascript functions into their own files to keep everything nice and neat. Then the problems started, mainly the map would not show up any more. ...
The AJAX SlideShowExtender is pretty useful. It does what it says and works without much fuss. There was one trick I needed it to perform that I could not find natively within the control. That was to set the slide’s current index. With a little JavaScript however I could make the control do what I wanted. The example below assumes a few things. First you already have a SlideShowExtender setup and working (or see this post). Second this SlideShowExtender is on a page all by itself so the index to ...
Google now has a feature where the search updates as you type in the search box. You can implement the same feature in your MVC site with a little jQuery and MVC Ajax. Here's how: Create a javascript global variable to hold the previous value of your search box. Use setTimeout to check to see if the search box has changed after some interval. (Note: Don't use setInterval since we don't want to have to turn the timer off while Ajax is processing.) Submit the form if the value is changed. Set the update ...
Hey blog readers… It has been almost 2 years since I posted my most read blog on creating a Parent/Child list relationship in SharePoint 2007: Creating a SharePoint List Parent / Child Relationship - Out of the Box And then a year ago I improved on my method and redid the blog post… still for SharePoint 2007: Creating a SharePoint List Parent/Child Relationship – VIDEO REMIX Since then many of you have been asking me how to get this to work in SharePoint 2010, and frankly I have just not had time ...
En este post, trabajaremos una parte que en ocasiones se nos hace un “mundo”, la creación de menús en nuestras aplicaciones web. Nuestro objetivo será evitar la utilización de elementos que puedan ocasionar que la página se vuelva un poco lenta, para ello utilizaremos jquery que viene siendo una herramienta muy semejante a ajax para crear nuestro menú. Para crear nuestro menús de ejemplo necesitaremos de tres elementos: 1. CSS, para aplicar los estilos. 2. Jquery para realizar las animaciones. 3. ...
Recently I wrote a series of blog posts that demonstrates how to do calculation in GridView using JavaScripts. You can check the series of posts below: FAQ: GridView Calculation with JavaScript FAQ: GridView Calculation with JavaScript - Formatting and Validation FAQ: GridView Calculation with JavaScript - Displaying Quantity Total Recently a user in the forums is asking how to calculate the total quantity, sub-totals and total amout in GridView when a user enters the price and quantity in the TextBox ...
Previously we've talked about how calculate the sub-totals and grand total in GridView here, how to format the numbers into a currency format and how to validate the quantity to just accept whole numbers using JavaScript here. One of the users in the forum (http://forums.asp.net) is asking if how to modify the script to display the quantity total in the footer. In this post I'm going to show you how to it. Basically we just need to modify the javascript CalculateTotals function and add the codes ...
In my previous post here we've talked about how to calculate the sub-totals and grand total in GridView using JavaScript. In this post I'm going take more step further and will demonstrate how are we going to format the totals into a currency and how to validate the input that would only allow you to enter a whole number in the quantity TextBox. Here are the code blocks below: ASPX Source: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml... ...
In my previous post I wrote a simple demo on how to Calculate Totals in GridView and Display it in the Footer. Basically what it does is it calculates the total amount by typing into the TextBox and display the grand total in the footer of the GridView and basically it was a server side implemenation. Many users in the forums are asking how to do the same thing without postbacks and how to calculate both amount and total amount together. In this post I will demonstrate how to do this using JavaScript. ...
Part 1 - Listing Data from Database: Let us now learn ASP.NET MVC 2 from Scratch by actually developing a front end website for the Chinook database, which is an alternative to the traditional Northwind database. You can get the Chinook database from here. As always the best way to learn something is by working on it and doing something. The Chinook database has the following schema, a quick look will help us implementing the application in a efficient way. Let us first implement a grid view table ...
At the end of November 2010 we released a new version of the Windows Azure SDK which contains many new features driven by the great feedback of early adopters plus a shiny new portal. New Portal implemented in Silverlight: The new portal is implemented using Silverlight and replaces the (IMHO rather clunky) original HTML + JavaScript portal. It is 100% better although does still have a few bugs. Enjoy! P.S. You can if you wish still use the old portal: New runtime functionality: The following functionality ...
Una de las necesidades más habituales en el desarrollo es poder validar los controles Textbox para que solo acepten valore numéricos. En este post eso es lo que haremos, nos apoyaremos en el lenguaje javascript para validar nuestro textbox del lado del cliente. Nuestro primer paso será crear la función JavaScript que hará el trabajo, para ello agregamos las etiquetas de javascript <script type="text/javascript"> </script> Posteriormente dentro de esas etiquetas agregaremos el script que ...
This book is more than just a book about an ASP.NET CMS system - it has much practical advice and examples for the Dot Net web developer. I liked the use of JQuery to detect that JavaScript was not enabled. One chapter was about MemCached - this one chapter could justify the price of the book if you run a server farm and need to improve performance. Some links to get you started are: Windows Memcache at http://code.jellycan.com/me... Dot Net Access Library at http://sourceforge.net/proj... ...
I’m going to start another series of posts that I’m calling C#/.NET Toolbox that will just contain little GUCs (Generic Utility Classes) I’ve developed along the way. If these already exist as part of the framework and I’ve overlooked them, feel free to let me know! And if you know of a better way to implement them, do the same! I’m never too old to learn something new (I hope!). Update: improved the ReverseComparer and added an extension method that will reverse any comparer instance. The Problem: ...
Goal: When loading js or css files, combine all the js files into one and all css files into one file respectively when rendering to improve on performance. Also compress if need be on the fly. In this example we use many css files and even more js files to organize the ASP.Net Mvc web app into manageable pieces. The reason for the separation is mainly because it gives the team the ability to work on different part of the web app by working on the affected css or js files. It also helps to decide ...
In this Issue: goldytech, Rob Eisenberg. Chris Rouw, Denis Gladkikh(-2-), Mike Taulty, Mohamed Mosallem, Mike Ormond, and Vuyiswa Maseko(-2-). Above the Fold: Silverlight: "Silverlight basics. Validation. Part 1. DataAnnotations & ValidatesOnExceptions" Denis Gladkikh WP7: "Live Tiles on a Schedule" Mike Ormond Blend: "Blend Bits 18–Sample Data" Mike Taulty Shoutouts: Rob Eisenberg has a contest going... check it out: Caliburn.Micro Contest Braulio Diez & Sebastian Stehle have a great-looking ...
In this Issue: Brad Tutterow, Kevin Dockx, Richard Waddell, Roberto Sonnino, Dustin Horne, Tim Greenfield, Rod Paddock, Timmy Kokke, Tim Heuer, Manuel Felício, Mike Taulty, and Brian Noyes. Above the Fold: Silverlight: "Using Visual States in custom controls in Silverlight" Timmy Kokke WP7: "Leveraging the Silverlight ecosystem with Windows Phone 7" Tim Greenfield Silverlight/JS: "JavaScript Can't Do Math - SilverlightCalculator A New Silverlight OSS Project" Rod Paddock Shoutouts: Telerik announced ...
So, I mentioned a few blog posts back in jQuery in SharePoint for Hackers that I used SPServices and jQuery to clone a parent list item and all the children associated with the parent. A few people expressed interest in seeing how this was done. This is that blog post. Prerequisites Before diving in head first like I usually do, it would probably be a good idea for you to make sure you are comfortable with a few of my previous blog posts: Creating a SharePoint List Parent/Child Relationship – VIDEO ...
In SharePoint 2010, Notifications is another way to display information/warnings without distracting user. It'll be shown in top right below Topbar and Ribbon. Just like Status bar, No Server side code or manual setup required to use Notifications. The required functions are bundled in SP.UI.Notify class that defined in SP.Js/SP.Debug.Js and it's included in SharePoint master page. So no manual include of Js is required. Well, Status bar is used to display content and to hide developer has to invvoke ...
Once again lets dive into the Little Wonders of .NET, those small things in the .NET languages and BCL classes that make development easier by increasing readability, maintainability, or performance. Today I’m going to focus a bit on the System.DateTime. This nice little value type (struct) has been in the BCL since the beginning, and while being broadly used to represent an instance of a date and time, there are many great properties, methods, and operators in this class that perhaps folks are less ...
In SharePoint 2010, Status bar is used to display information/warnings without disturbing user with Javascript alerts. Please don't think it is Browser's Status bar. It's a special information bar which displays below ribbon/top bar when invoked. No Server side code or manual setup required to enable status bar. The required functions are bundled in SP.UI.Status class that defined in SP.Js/SP.Debug.Js and it's included in SharePoint master page. So no need to include Js manualy to use Status bar. ...
A page which opened within dialog framework can pass some values(actualy single value) to parent page(Page which invokes dialog). Assume I have registration page which opened within Dialog. If Registration success then I have to pass a value otherwise different value to parent page. It's possible to pass single value with commonModalDialogClose(Retu... Once the registration completed successfuly then I want to show some message in the dialog itself and autoclose after few seconds. ...
I was lucky enough to attend Visual Studio Live! in Orlando on November 14th-17th. There were so many great speakers and the networking was great. I met a lot of really cool people and we talked about everything .NET (from WP7, Silverlight, C#, ASP.NET WebForms, AJAX, MVC 3.. and so forth). I took a lot of notes during all the sessions and wanted to provide it to those that could not come out. If you follow me on Twitter then you have seen most of these. Most of the authors put slides/source code ...
SharePoint 2010 provides pretty good dialog framework. Throughout SharePoint sites, Dialog framework has been used to avoid page redirections and keep user in same page. In SharePoint 2007 with help of Lightbox/JQuery, dialog framework can be enabled and used. But it has some limitations and time consuming. So how to open a page in Dialog framework? Well, It's pretty simple. Just add Content Editor webpart in the page and add the below code. <script type="text/javascript"> //User Defined Function ...
It takes a short overview of Microsoft development tools and platforms evolvement in order to demonstrate the importance of supporting Web Forms development for ASP.NET Ajax with HTML5 enhancements. In an article that Todd Anglin publishes in Redmond Developers, under the title "Silverlight: What Web Forms Wanted to Be", Todd says that ASP.NET was supposed to be Web Forms. A framework that meant to duplicate VB6 ease of development or rather its more mature successor Window Forms. Asp.Net was expected ...
In this Issue: Brian Genisio, goldytech, Martin Krüger, Shawn Wildermuth, John Papa, Kunal Chowdhury, Michael Washington, Joost van Schaik, Karl Shifflett, Joe McBride, Bruno Terkaly, Xpert360(-2-, -3-), and Brad Tutterow. Above the Fold: Silverlight: "Customized Scrolling in Silverlight using Expression Blend" Kunal Chowdhury WP7: "Windows Phone 7 Development for Absolute Beginners (The parts you care about)" Michael Washington Training: "In the Box – MVVM Training" Karl Shifflett Shoutouts: bspann ...
First, some background information: I have some javascript that requires data from the database to set values so I dynamically generate the script on the server via an action in my controller. I only want to do this generation when the partial view using it is dispalyed. So here is the problem: You have javascript you only want to load when a certain partial view is displayed. Depending on the state of data in the database, the partial view might load on page load or it might only load after an MVC ...
If you build Silverlight Applications, chances are you have seen this screen before. I’m talking about the default “To view this content, please install…” Screen shown below. The Default Installation Screen. This is the screen that your users see when they first visit your site without Silverlight installed. It’s just plain ugly and most users do not know what it means. Take this example below by Netflix, they have alerted the user with a friendly: “You’re almost ready to watch…” Install Now. This ...
Last week we discussed returning immutable POCOs from an enclosing class so that you can prevent someone who asks for your class’s data to mutate it out from under you. Now we’re going to get a little more complex and talk about returning immutable collections from an enclosing class for the same reasons. I will discuss several different methods for returning collections in a read-only fashion with their pros and cons, including performance implications. The Problem Many times you will create a type ...
I've been seeing many developers in the forums asking: How can I display a message box from the server (code behind)? How can I customize the javascript confirm and alert popup? How can I display a message box like in windows application? As some of you may already know that displaying a pop-up message box has always been a pain for most developers in web programming. Everyone has probably used the Page.ClientScript.RegisterS... or the ScriptManager.RegisterClien... method to call ...
Es el rendimiento de aplicaciones por mucho, una de las cosas que más nos preocupa durante el desarrollo de nuestras aplicaciones, y digo por mucho, porque en ocasiones es muy sencillo desarrollar una interfaz gráfica excelente pero se olvida una cosa, el costo de interacción que esto brindará al usuario. Vamos a ver una forma en la que podemos medir el rendimiento de nuestra aplicación con el fin de poder trabajar en las áreas más criticas para poder lograr un mejorarlo. 1. Para nuestro ejemplo, ...
Latest announcements by Microsoft executives leave no doubt. Microsoft is shifting its support to HTML 5 and by doing so gives up on its RIA platform Silverlight which it repurposes for mobile. Adobe releases a Beta of a new HTML5 supporting tool kit, and by doing so also embraces the HTML5 option. It does look as if both give in to the market preferences for standard, no-plug-in and non-propriety option of HTML5 (see "Microsoft favoring HTML5 over Silverlight: reports" ). If we follow Microsoft's ...
JavaScript was created to add interactivity to Netscape 2.0 back in 1995. A consequence of this limited scope is that the language was given only a minimal standard library. Should you ever try to solve a significant problem with JavaScript you will quickly feel the need for more advanced library methods than what JavaScript provides. Underscore.js Underscore.js is a library of utility functions for JavaScript. Most of the functions add functional capabilities to JavaScript. Simply add a script reference ...
Latest update (and hopefully last update): Microsoft has published a few posts to clarify the debate. Please consider the following: PDC and Silverlight by Bob Muglia PDC Thoughts by Steve Ballmer *NEW* Silverlight Questions by Scott Guthrie Silverlight is dead. Long live Silverlight! by Tim Heuer Committed to Silverlight by John Papa ---------------------------... Disclaimer: I am a Silverlight MVP and book author, and as such I have an interest (some would say ...
One of the things I sort-of miss from C++ (it has its good and bad) is the const modifier. Yes, while it’s true that we have a const modifier in C# (as well as readonly), but it’s not quite as robust. Many times you’ll want to return an internal member of a class but not want it to be directly modifiable by the user of that class. This article discusses how to present simple types as read-only. Note: I’m deliberately avoiding creating read-only views of collections in this particular article, but ...
Updated 2011-01-28 to reference the correct question stackoverflow.com Updated 2011-10-02 With a link to a sample application on github. In the web application I work on we sometimes need to create PDF documents based on some user input. In most cases, these documents are fairly simple and quick to create, allowing us to create the documents in memory and then send them back to the requesting user with a “Content Disposition: attachment” in the HTTP response. This causes the browser file download ...
Someone drank the jQuery Kool-Aid… Here’s a super quick and simple blog post that you may or may not find useful… as always I offer a money back guarantee… Let’s say you want to print out your SharePoint page but you don’t want the Search Box or anything outside the main content area to print, or maybe you just want one specific web part on the page to print; how would you do that? I spent about 5 minutes Googling it on Bing (I heard that phrase at SPTechCon last week… really wish I could remember ...
With concerns of HTML 5 overshadowing or affecting the roadmap for Silverlight actively addressed in many blog posts, I decided to cover the value HTML 5 brings to another set of web-based Microsoft solutions: ASP.Net MVC 3 and WebMatrix. A direction to embrace HTML 5 can already be clearly seen in ASP.Net MVC 3 with Unobtrusive Javascript leveraging the “data-“HTML 5 attributes. Additionally, WebMatrix Razor site templates are already HTML5 and CSS3 compliant while continuing to be backwards compatible ...
faultcode:'sf:INSUFFICIENT_... faultstring:'ClassName: no access allowed to this class.', Salesforce Are you getting the above error in salesforce while the javascript is getting executed ? the reson is the user doesnt have sufficient access to the Apex class. Do the following and the issue will get resolved. Go to Setup->Develop->Apex Classses-> open the Class -> Click Security Button -> Add access to the profile from which you are trying to perform the action ...
If you have not looked at Murach’s books you should! They have a very convenient format, geared for training with two facing pages, the left with text and the right with an example with lists and descriptions. This book should get someone started on HTML and basic web pages, it covers html through some javascript and into simple website design and deployments. For me not much was new but I did pick up a few things including a better understanding of CSS floating div’s and how to use them. Another ...
The Little Wonders series received so much positive response I decided to make it a recurring theme in my blog as new ones popped in my head. There are two simple, yet great, LINQ extension methods you may or may not know about, but that can really simplify the task of converting collection queries into collections: ToDictionary() and ToList(). Introduction: LINQ and Deferred Execution Depending on your knowledge of LINQ, you may be oblivious as to what many of these query expressions do behind the ...
These days it seems that everyone has a crush on Ruby. I presented two sessions at this year’s Adelaide Code Camp: BDD with StoryQ and I Am IronRuby. After the standard IronRuby demonstration (creating a new project and scaffolding) I showed off some of what I like about Ruby. I started with a file containing Ruby comments describing nice features of the language. Then I worked my way through the script writing the Ruby to demonstrate each feature. The result is similar to my JavaScript Koans, but ...
Before working with MVC, I would claim to be somewhat intimidated by JavaScript development. Not that I did not know how to use it, however I found that is was much more bug prone and harder to develop against. Having the .Net compiler was a nice safety net-I did not have to worry about variable name mismatch, typos, not to mention the .Net framework itself. In a recent ASP.Net project we used the MS AJAX update panel to implement interface changes that could easily be implemented via client side ...
WebMatrix is a free “one stop shop” supporting all developers’ needs when creating web sites based on standard markup technologies (HTML, CSS, Javascript and jQuery). WebMatrix features an intuitive user interface to help minimize the learning curve and ease navigation and access to all application features. For instance, on startup WebMatrix enables the user to select of the following: 1-Existing sites created in WebMatrix 2-Obtain a site from one of the open source packages through Web Platform ...
In this Issue: Roberto Sonnino, Jonathan Marbutt, Jonathan van de Veen, René Schulte, Vikram Pendse, Andrej Tozon(-2-, -3-, -4-), Andrea Boschin(-2-), Jesse Liberty, Jeff Blankenburg, and Team XNA. Above the Fold: Silverlight: "Silverlight Layout States with Reactive Extensions" Andrej Tozon WP7: "WP7 Fast Tips: Load (decode) and Save (encode) Jpeg files" Andrea Boschin XNA on WP7: "New WP7 Games Educational Content on App Hub: Performance!" Team XNA Shoutouts: Joost van Schaik has instructions on ...
Chris Nicola left this excellent comment on Justin Etheredge’s blog: Even with a competitive way to do SSJS [(server-side JavaScript)] on the Windows platform, I just have to ask... why would anyone? Server-side JavaScript means that the server portion of a web application is written in JavaScript. Personally, I believe that server-side JavaScript will be the next big advance in web development. If I were Microsoft I would be looking to hit a touchdown out of the ball park with server-side JavaScript, ...
It bugs me when some commecial site gloms onto a perfectly good technology name and shoves irrelevant information down my browser's throat. Clearly www.Ja\/ascript.com (misspelled intentionally so that the assholes that own the domain name won't get a free reference from my blog) are only interested in making money from click throughs. Anyway, I attended the jQuery Conference this past weekend and I'm complying with Alex's directive to promoteJS.com. So, here y'go ...
Michael Minutillo posted the texas hold ‘em coding challenge to the oz alt.net mailing list. The challenge is to write a program that can take poker cards as input and return information about what hands players have and who is the winner. Solving this problem in my 9-to-5 language (c#) is not interesting to me, so I chose to do it with my beloved CoffeeScript. Compiling CoffeeScript The first challenge I faced was one that I have been working on for months – how to compile CoffeeScript on Windows. ...