Tag | Javascript Posts

Today we are glad to announce HERMES, an Open Source Infrastructure for publish subscribe messaging model based on MongoDB and RESTful Services. This is 8th release of an open source project from TellagoDevLabs on Codeplex. Hermes is months of hard work by us, including Silvio Massari, Jose Romaniello and Gustavo Machado. Hermes is not BizTalk Server. BizTalk Server has pub-sub mechanism in its infrastructure but in very traditional way and it hasn’t provided a foundation that can be seamlessly used ...
Continuing my short but sweet posts regarding issues I've encountered and corrected during development...... If you are working with the Telerik MVC suite of controls within your ASP.NET MVC application you may encounter a JavaScript error similar to "Object doesn't support this property or method". The problem? Telerik controls make use of jQuery and by default will add a script registrar to your view which then automatically includes the core jQuery JavaScript files. Like many developers you may ...
C# is a wonderful language for modern programming. While everything in C# has a reason and a place, occasionally, there are things that can be confusing for a developer who isn’t aware of what is happening behind the scenes. This is my third post in the Little Pitfalls series where I explore these small pitfalls; the previous Little Pitfall post can be found here. This week we’re going to look at operator overloading. Yes, I bolded that because it is very important to note we overload operators, ...
Hace unos días recibi un email de Microsoft con noticias sobre Visual Studio, y algo que me encanto fue ver que por fin tenemos soporte para HTML y CSS 3 en el editor de VS. Así que, me di la tarea de leer el contenido de los blogs recomendados en el artículo y tome la decision de traducir el contenido del blog de Scott Hanselman’sa español (por supuesto con algunos cambios), para que toda la comunidad que no tiene aún un buen conocimiento de inglés pueda aprovechar el contenido. Inicamos… La gente ...

I have today a little problem to parse in js a DateTime object, which I serialized to json in the acion method on the server by

return Json(messages);

In javascript, the date looks that: /Date(1309936900864)/

 

To parse the date in js I have used:

var parsedDate = new Date(parseInt(messages[i].CreatedDate.replace("/Date(", "").replace(")/",""), 10));

 

String Resources For string resources we will use local/global resources connecting to DB using DbResourceProvider from “Creating a Data Driven ASP.NET Localization Resource Provider and Editor” http://www.west-wind.com/pr... It also has DbResourceControl, that shows controls with Localizable attribute and connect them to editor. From http://guysmithferrier.com/... and http://www.guysmithferrier.... ...
Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders posts can be found here. Today we’re going to look at an interesting Little Wonder that can be used to mitigate what could be considered a Little Pitfall. The Little Wonder we’ll be examining is the System.Nullable static class. No, not the System.Nullable<T> class, but a static ...
Goal: Defining Knockout-style input controls can be tedious and also may be something that you may find obtrusive, mixing your HTML with data bind syntax as well as binding your aspx, ascx files to Knockout. The goal is to make specifying Knockout specific HTML tags easy, seamless really, as well as being able to remove references to Knockout easily. Environment considerations: ASP.Net MVC2 or later Knockoutjs.js How to: public static class HtmlExtensions { public static string DataBoundCheckBox(this ...
Goal: Once you viewmodel has been built and populated with data, at some point it goal of it all is to persist the data to the database (or some other media). Regardless of where you want to save it, your client-side viewmodel needs to be converted to a JSON string and sent back to the server. Environment considerations: jQuery 1.4.3+ Knockoutjs version 1.1.2 How to: So let’s set the stage, you are using Knockoutjs and you have a viewmodel with some Knockout dependencies. You want to make sure it ...
After reading DLinq (Linq to SQL) Performance and in particular Part 4 I had a few questions. If CompiledQuery.Compile gives so much benefits, why not to do it for all Linq To Sql queries? Is any essential disadvantages of compiling all select queries? What are conditions, when compiling makes whose performance, for how much percentage? World be good to have default on application config level or on DBML level to specify are all select queries to be compiled? And the same questions about Entity Framework ...
I’ve read Combining Client Scripts into a Composite Script and wanted to use it. Then I’ve read Julian Jelfs concerns ScriptManager.CompositeScript issues However the article Combining javascript files with Ajax toolkit library describes workarounds, that make the solution workable. You also can use Script reference profiler: http://aspnet.codeplex.com/... Related posts: Using ScriptManager with other frameworks MSDN documentation: CompositeScriptReference The older implementations, ...
Much has been talked about the F12 developer toolbar in IE and the support it provides for web developers. Starting IE8, the Developer Toolbar is a menu item that helps you view the page source, scripts, profiling and many other details of the rendered page. It even allows script debugging from within and that makes it a truly powerful web developer tool bar. With IE9, the developer toolbar got even better with the Networking Tab that allows you to inspect the traffic/time taken and drill down into ...
Goal: Rotating text using css only. How: Surprisingly IE supports this feature rather well. You could use property filters in IE, but since this is only supported on IE browsers, I would not recommend it. CSS3, still in proposal state, has a "writing-mode" property for doing this. It has been part of IE's browser engine since IE5.5. Now that it is part of the CSS3 draft specification, would be the best way to implement this going forward. Webkit based browsers; Firefox 3.5+, Opera 11 and IE9 implement ...
This week is a busy week for me. First of all I’m giving another presentation on a LINQ/Lambda primer for the rest of the developers in my company. Of Lambdas and LINQ View more presentations from BlackRabbitCoder Then this Saturday the 25th of June I’ll be reprising my Little Wonders presentation for the Kansas City Developers Camp. If you are in the area I highly recommend attending and seeing the other great presentations as well. Their link is here. Little Wonders View more presentations from ...
Microsoft has revealed some things about Windows 8, and revealed a part of the developer story for new Windows 8 “tailored,” “immersive” applications. In retrospect, very little was shared. The bit that was revealed to us is that those applications can be developed using a combination of HTML 5 and JavaScript. Not much else was said, except that additional details would be revealed at Microsoft’s //Build/ conference in Anaheim, California in September. This has left a lot of people in suspense, and ...
Most of us have seen the Windows 8 news regarding support for native HTML5/JavaScript applications. The press has pushed this as a potential threat to the .NET developer community because JavaScript and HTML5 were called "our new developer platform". The press release refers to "Web-connected and Web-powered apps built using HTML5 and JavaScript that have access to the full power of the PC.".Microsoft has also been hush on details related to these comments. Before we buy the hype and start worrying ...
The .NET Base Class Library (BCL) has a wide array of collection classes at your disposal which make it easy to manage collections of objects. While it's great to have so many classes available, it can be daunting to choose the right collection to use for any given situation. As hard as it may be, choosing the right collection can be absolutely key to the performance and maintainability of your application! This post will look at breaking down any confusion between each collection and the situations ...
Since the demo of Windows 8 given by Microsoft Vice President Julie Larson-Green at the recent D9 conference windows developers have been described in many articles as feeling "Horrified" "Worried" "Deeply Concerned". Why? From the demo it seems that the new Window’s 8 ‘immersive’ applications will be based on HTML5 and JavaScript – which means for experienced win devs who have invested years in learning windows development platforms, they will now have to ‘re-train’ if they want to create these ...
Released today. Updated HTML5 support and CSS 3 and more new APIs to JavaScript intellisense. Installed without a hitch http://visualstudiogallery.... ...
In this Issue: Kunal Chowdhury, Stephen Price, Mark Heath, Oren Gal, Jesse Liberty, and Laurent Duveau. Above the Fold: Silverlight: "Implicit Data Template in Silverlight 5" Laurent Duveau WP7: "Fast Application Switching Made Easy" Jesse Liberty XAML: "StringFormat for TimeSpan" Stephen Price Shoutouts: Rudi Grobler has a post up of all the WP7 competitions he has found... Windows Phone 7 Competitions Bill Reiss has a similar post up, with contests and even a way to get your $99 reimbursed! Windows ...
MVC 3 is becoming hugely popular thanks to Razor and the Helpers that make building web applications much easier. One of the common requirements in web development, both with web forms as well as MVC based development, is the cascading dropdownlist. Now, for Web Forms, we can use a variety of options viz. server side programming, jQuery or using the AJAX Control Toolkit’s cascading dropdownlist control for accomplishing this. I saw a few samples on the internet that used the erstwhile Microsoft AJAX ...
LocalStorage() is one of the new features of HTML5 that found widespread use among PC and phone developers. It can save up to 5MB of data locally, on a user device in a key-value database inside a web browser. Data can be retrieved only from a device where was permanently saved until it gets deleted by user or programmatically. To be able to take advantage of this and other HTML5 features, user needs to have a compatible browser. Currently, at the time I am writing this post, there is no browser ...
Preamble Microsoft’s first introduction of upcoming Windows 8 spurred lots of discussions among developers. The most noticeable part of the demonstrations at D9 conference and Computex show, as well as on YouTube, is, of course, the new touch-centric UI. So why is it controversial among developers? Let’s take a look at Microsoft’s press release: Today, we also talked a bit about how developers will build apps for the new system. Windows 8 apps use the power of HTML5, tapping into the native capabilities ...
Official Site | Samples | Download | Documentation | Forum | Twitter Introduction jqChart takes advantages of HTML5 Canvas to deliver high performance client-side charts and graphs across browsers (IE 6+, Firefox, Chrome, Opera, Safari) and devices, including iOS and Android mobile devices. Some of the key features are: High performance rendering. Animaitons. Scrolling/Zoooming. Real-time chart manipulation. Support for unlimited number of data series and data points. Support for unlimited number ...
SCENARIO I have page that was hosted inside the iframe and I want to redirect the parent window when a user click a button inside the child page. For that I added the following code in the Button’s click event as I have to execute some server side code before redirecting. Page.ClientScript.RegisterS... RedirectKey, string.Format("window.top.l... = ‘http://google.com’;", url), true); PROBLEM Above mentioned code worked great but when the user used the browser’s back ...
Browser 'Refresh' is always a cause of concern for the developers. It becomes even more worse when the page interacts with the database. As each refresh, if not handled, would lead to the database action repeated. This could lead to inconsistency in database or even break the application. One way could be to detect 'refresh' using javascript and disable F5 or right click..but there are so many other ways end-user can initiate 'Refresh' action for e.g. by using CTRL+R on the keyboard... The best way ...
For 1 week, O' Reilly are giving 50% off on JavaScript ebooks and videos. "JavaScript is now a language every developer should know." – Mike Loukides, Vice President of Content Strategy for O'Reilly Media JavaScript is everywhere: servers, rich web client libraries, HTML5, databases, even JavaScript-based languages. If you've avoided JavaScript, this is the year to learn it. And if you don't, you risk being left behind. Whatever your level, we have you covered: Introductory / Intermediate / Advanced ...
This is a quick introduction to moving from our own internal assembly repository to using NuGet. It’s terse for a reason, just a note to self and those I work with: What we had One source of builds external to our code repository Didn’t check in external builds Used DVCS to share single feed Rake task to update and copy latest builds local checkout (this location is excluded from VCS) Automatic updates if changed in central repository and version not incremented Caused problems when changes were ...
Re-posting my presentation on Automating Code Standards that I'm presenting to the Cedar Rapids (Iowa) .NET Users Group - CRINETA - tonight. For more details see their web site at: crineta.org The presentation can be found on Slideshare at http://www.slideshare.net/B... Automating C# Coding Standards using StyleCop and FxCop View more presentations from BlackRabbitCoder Tweet Technorati Tags: C#, .NET, StyleCop, FxCop ...
I'm not using very ofter a web resources, so every time I need to use it, I'm wasting my time to google how to do it. To save my time next time, a little example. Set the Build Action on the js file to Embedded Resource and add few lines in: AssemblyInfo: [assembly: System.Web.UI.WebResource("... "text/javascript")] and in the custom web control: protected override void OnPreRender(EventArgs e) { ClientScriptManager cs = this.Page.ClientScript; cs.RegisterClientScriptReso... ...
I've been working with the jqgrid and have been really impressed with the ease of use. One issue I was having was with the action buttons on the row. If a new row is selected, the action buttons wouldn't toggle back. I had to toggle them myself in the onSelectRow function. Here is a sample jqgrid based on the jqgrid samples http://www.trirand.com/blog... <html xmlns="http://www.w3.org/19... <head> <title></title> <link href="/Content/Site.css" rel="stylesheet" ...
When I've tried to deserialize dictionary whis strongly typed(and not string) keys, I've got an exception similar to the following Type 'System.Collections.Generic... System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d5... mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934... is not supported for serialization/deserialization of a dictionary, keys must be strings or objects. // Type Dictionary`2 ...
Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders post can be found here. On this post I will finish examining the System.Linq methods in the static class Enumerable by examining two extension methods Count() and DefaultIfEmpty(), and one static method Empty(). The Empty() static method How many times have you had to return an empty collection ...
Yesterday, at the Wall Street Journal’s “All Things D” conference, Microsoft’s President of Windows and Windows Live, Steven Sinofsky, showed the world a preview of Windows 8 (officially, that’s the code name). And in a YouTube video, Jensen Harris, Director of Program Management for Windows User Experience, provides his own detailed Windows 8 demo that you can check out right now. What both men showed us was an early preview of a next next version of Windows that looks a lot like Windows Phone 7, ...
Today, Microsoft announced some of the details about Windows 8 and how it is going to change web development forever. The announcement included a number of cool points about the upcoming OS but as someone in love with HTML5, these two points stood out to me: Web-connected and Web-powered apps built using HTML5 and JavaScript that have access to the full power of the PC. Fully touch-optimized browsing, with all the power of hardware-accelerated Internet Explorer 10. Okay, wow. That made my developer ...
I had recently a very interesting problem. I have a single button on my page, which opens a jquery ui dialog with other page containing single textbox control. After pressing the Ok button, using web service the textbox value is sending to the server and a label control on the main page is updating and the update panel containing this label is refreshing. Vary simple solution. Maybe too simple, because I have lost a few hours to investigate, why after pressing the Ok button, full postback occurs ...
Dears, I’ve been facing a bug in the paging of the data form webpart which occurs when the asynchronous update is enabled. The issue is that when you click the previous button, then it’ll redirect you to the previous page as it invokes a call to history.back() javascript function. I’ve done some modifications in the XSLT in order to make this work: • Open the code view and search for a <td> that has a class named “ms-paging” and then paste those lines before the starting of the td tag: <xsl:variable ...
In my previous post I mentioned a possible bug with MongoDb's MapReduce. Well, I played with it a bit further. I went ahead and added a string field to each document to hold the numeric Twitter post id as a string value. Then changed my map function to use this string value instead of the numeric id. This time the duplicate post query worked perfectly. It's results showed that there were no duplicate posts at all. So, what is the problem? Is it a bug in MongoDb's MapReduce implementation? I doubt ...
EPS or Encapsulated PostScript is a standard graphics file format for exchanging images, drawings or even layouts of complete pages. An EPS file internally contains a description of such an object or layout using the PostScript page description language. The purpose of an EPS file is to be included in other pages. Sometimes EPS files are called EPSF files. EPSF simply stands for Encapsulated PostScript Format. EPS files have the extension .eps or .epsf. This page discusses: the basics of the EPS ...
Dot gain is a phenomenon that causes printed material to look darker than intended. This happens because the diameter of halftone dots increases during the prepress and printing process. The optical and physical properties of the media and machines used both in preparing the job for print and the printing process itself cause this behavior. Below is an example of what happens when a nice flat tint (left) gets printed on newspaper stock: ignore the fact that the paper is grayish – look at how the ...
Bleed refers to objects that extend beyond the edge of the printed page. This page tells you why bleed is needed, how much is needed and how to fix issues with bleed. For an example of the use of bleed, look at the image below. The picture of the monkey and the gray rectangle go beyond the edge of the page. They ‘bleed off’ the edge of the paper. Full bleed means that an image extends beyond the edge of the page on all four sides. Why do you need to add bleed? 1. Once a job has been printed, the ...
I'm running into some bizarre behavior with JavaScript in Mobile IE 6. I have an ASP.NET MVC 3 Web App, designed primarily for Mobile IE6 (WinMo 6.5 devices) I have 2 Session variables. The first one simply contains a "0" or "1" and I can access it by doing something like this in JavaScript: var lbType = '<%= HttpContext.Current.Session... %>'; I can use it, display it in an alert, whatever... that works, no problem. The other session variable is also a string, but is a bit longer (roughly ...
Several people have already written about how to add Intellisense to Visual Studio for SharePoint 2010’s Client Object Model (ECMAScript or JavaScript). Here’s one that I followed: http://praveenbattula.blogs... Following those instructions, mine still didn’t work. I finally got it to work after removing the <script> tags in my file ...
I wanted to run a simple sanity check to make sure I didn't have any duplicate twitter posts in my database. I didn't think I had any, but you never can be too sure, so I whipped up a simple MapReduce query to check. Right now I'm storing twitter posts in MongoDb using the document schema shown below: { category post { post_id created_date from_user from_user_id geo iso_lang post_text } } Each document has two fields, a category field that holds what search was used to find the post, and a post field ...
The Short Story: There is an undocumented (as of this writing) limitation to SharePoint 2010’s managed metadata columns: they only allow ~250 entries into one column, for one item. If you exceed this limit, you’ll most likely get this error: <nativehr>0x81020030&... URL 'SitePages/Test Page.aspx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web. We haven’t identified ...
Below is how we can build a complex JSON in javascript and pass it to ASHX file. $.toJSON(jsonData) looks like as below [{"Name":"Pavan Kumar Pabothu","Age":27,"ID":3616... Raju Padhmaraju","Age":27,"ID":3... Raju Padhmaraju","Age":26,"ID":3... Below is how you can read the object in ASHX page ...
Luego de varios días de intenso trabajo, hoy he tomado un pequeño espacio de tiempo para dedicar un post al trabajo con datos en forma de tablas en asp.net Todos los que hemos trabajado desde hace bastante con asp.net, hemos aprendido a querer al GridView, un excelente control que nos permite mostrar los datos directamente desde una base de datos y trabajar con ellos, llamase trabajar a las operaciones de: editar, buscar, agregar y eliminar. Por supuesto que existen muchas otras opciones que no son ...
Woke up this morning and decided to finally stop by the Alumni Lounge. I had been meaning to check it out, but I had been so busy with such great presentations and hanging out in the Blogger’s Lounge that I never got around to it. I truly wish I had stopped in sooner! There’s nice bottles of soda with glasses for ice so you can have it nice and cold as well as a hot beverage bar. And this morning there were delicious cinnamon rolls (the nemesis of my beltline, alas!) and other treats and candies. ...
This is a quick presentation I threw together for a group of developers who requested a quick primer on using lambda expressions and the more common LINQ extension methods. It seemed like a good general knowledge presentation so I decided to upload it to slideshare and reference it here as well. This is not meant to be a comprehensive discussion of everything that lambda expressions and LINQ have to offer, but is just sort of a very basic introduction to help those less familiar with reading and ...
Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders post can be found here. Today I’m going to look at 5 different ways of combining two sequences together using LINQ extension methods. For the purposes of this discussion, I will split these 5 methods into homogeneous and heterogeneous methods (for lack of better terms). “Homogeneous” combinations ...