Tag | Javascript Posts

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 ...
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 ...
1. Set EnableScriptGlobalization=true on the script manager <asp:ScriptManager runat="server" EnableScriptGlobalization="... /> 2. Use the Sys.CultureInfo.CurrentCulture command either inside the alert or through Firebug console to check the CultureInfo at the client side 3. use Number.parseLocale instead of pareFloat so that it get correct value according to the current culture. 4. to update the value back with current culture use localeFormat <script type="text/javascript"> function ...
Introduction I don’t do web programming… I have been programming client applications for years and consider myself a WPF/Silverlight developer. The web thing always seemed a bit scary in its stateless environment with limited functionality and cross browser headaches. That was until recently when apparently HTML5 was going to kill Silverlight and I eventually decided that I would need to get educated and up to date. Since that decision I have re-accustomed myself with HTML, CSS & JavaScript. ...
When you have Microsoft Office Communicator or Lync installed, and you visit a SharePoint site, you will get these presence indicators next to peoples’ names These indicators (or jelly beans as they are affectionately called) show whether the person is available, in a meeting, out of the office, on a call, etc. When you hover over them, they provide details about the person In SharePoint 2007 (or any other web page), whenever I needed to display a presence icon in custom code, I just use the following ...
I have lost recently some time to send a json parameter to my web service using jquery. Suppose that we have the data in an javascript array: var attributes=[]; $('#PreviewGroup1_DecisionA... input:checkbox').each(funct... attributes.push({attribute: elem.value, checked: elem.checked}); }); To send that array to web service we simply need to do $.ajax({ url: '../Services/PreviewFormWeb... dataType: "json", data: "attrs="+ JSON.stringify(attributes), ...
Project Silk provides guidance for building cross-browser web applications with a focus on client-side interactivity. These applications take advantage of the latest web standards like HTML5, CSS3 and ECMAScript 5 along with modern web technologies such as jQuery, Internet Explorer 9, and ASP.NET MVC3. To illustrate this guidance, the project includes a reference implementation called Mileage Stats that enables its users to track various metrics about their vehicles and fill-ups. Much of the effort ...

Add add_endRequest handler to the Page request manager as followed

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(<javascript name function>);
Well, this one was fun. So my mvc app was having trouble with javascript files. Seems like if I had more than one file linked in, that only the 1st was picked up. The tags looked like so: <script src="<%=Url.Content("~/S... type="text/javascript"/> After much scratching my hair out and trying different things, I figured it out. The problem is the />. You have to end the script tag like so with </script> and not the shortcut syntax: <script src="<%=Url.Content("~/S... ...
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* 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-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; ...
A new release of Microsoft All-In-One Code Framework is available on April 16th. This blog introduces 14 ASP.NET and Azure code samples in the release. The rest new samples will be introduced next week. Download address: http://1code.codeplex.com/r... Alternatively, you can download the code samples using Sample Browser v3. The new Sample Browser gives you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically ...
How doing some asp.net deevelopment and i decided to use one of the asp.net controls. But need to use Jquery to do some extra stuff I had a link in the page i wanted to let popup like a modal dialog like so: <td><a id="mdialog" href="details.aspx?scode=&l... Eval("Code")%>">[..]&... Then refrenced Jquery like so: <script type="text/javascript"> $(document).ready(function () { $("#mdialog]").fancybox({ 'width': '75%', 'height': '100%', 'autoScale': false, 'transitionIn': ...
Ajax enabled data centric applications are getting popular day by day in web development space. While these type of web applications provide rich user experience, building a robust and powerful application quickly is a great challenge for developers. Fortunately Microsoft has started providing great frameworks, plug-ins and APIs to facilitate this process. Last week Microsoft announced a new version of java-script API “datajs”, which is intended to help web developers to build data centric AJAX applications ...
At the recent Mix 2011 conference the datajs team talked about this new cross-browser JavaScript library that makes writing data centric web apps easier. Its fairly simple to use and can be very powerful. Here is a quick application I threw together using the library. The code uses datajs, jQuery, jQuery UI and jQuery templates. Microsoft has an OData Service at http://live.visitmix.com/od... which exposes all Mix sessions. I used this source to get a list of all sessions using the datajs ...
HTML5 introduces markup-level functionality for rich graphics, animation and web multimedia. It also supports a richer web application functionality and extends the client capabilities with local storage. Many pundits see it as the next generation web - web 3.0 if you like - and an open standard replacement for propriety plug-ins, Microsoft Silverlight and Adobe Flash. But, for all its new features, HTML5 is still only the end product. This article looks at HTML5 from the web programmer's point of ...
I haven't posted a recap lately, because the Virtual Brown Bag recordings weren't being uploaded for a while. That was fixed two weeks ago, so I had a lot of meetings to catch up on. Here's an all-you-can-eat brown bag buffet… March 3 Guest presenter Jim Christopher - creator of StudioShell, a deeply integrated PowerShell host available inside of Visual Studio 2010 and 2008. StudioShell exposes many of Visual Studio’s extensibility points in a simple and consistent way, and it makes the Visual Studio ...
Last week, I was interviewed by Zandra Nilocas from Microsoft Philippines. It was my first time experience to talk about something in front of the camera so it's not surprising that I looked like an idiot in that interview (you know swiveling my chair back and forth without noticing it). Anyway in the interview we talked about ASP.NET WebForms, MVC and Web Matrix in general and just to elaborate a bit of what we talked about and to clarify things out, I have decided to write this post... WebForms ...
Recently, while browsing Visual Studio extensions I came across the SharpKit tool. It sparked my curiosity as I'm always looking for ways to improve my jQuery and Javascript in general. Working off the example in my previous post about Updating the Content of a WebGrid async we can generate the same Javascript via the SharpKit project. First, head to theSharpKit site to download and setup your first project (check out the Screencasts). Or search "jQuery" in Visual Studio 2010 extension manager. So ...
Anteriormente escribe un pequeño código para validar que en un textbox solamente se ingresaran números. Hoy mostraremos como validar nuevamente el textbox pero esta vez, para que acepte solo caracteres. Como es de recordar, tendremos que utilizar javascript para obtener esta funcionalidad. Nuestro script sería de la siguiente forma <SCRIPT language=Javascript> <!-- function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode ...
Cuanto trabajamos con formularios, siempre es necesario limpiar todos los controles luego de que el usuario a realizado determinada acción, por ejemplo, luego de que ha guardado un dato. Esto nos ayudará a evitar errores en el ingreso de la nueva información. Este es un pequeño código en javascript que se encarga de realizar esa tarea, al menos, en los controles más comunes. Por supuesto, que es totalmente extendible. <script language="javascript" type='text/javascript'> function ClearAllControls() ...
We all love benchmarks! With the recent release of new versions of some of major browsers, and as a small diversion over the weekend, I ran five well-known browsers against five well-known JavaScript micro-benchmarking suites using my laptop. The results are reproduced below. I have ranked the results for each benchmark suite from best to worst. Celtic Kane – old version (current version was unavailable) (Smaller is better) Opera 11 77 ms Safari 5 93 ms Chrome 10 119 ms IE 9 152 ms FF 4 154 ms Kraken ...
Previously we've talked about how to fetch the data from the database and populate the form with EF. In this example I'm going to demonstrate how to do Edit,Update and Delete operations in the form with Entity Framework. And oh since this is a continuation of my previous example I would suggest you to refer that first before you go any further. STEP 1: Setting up the UI Since this is a continuation of my previous example then I'm jus going to use the same layout and extend it a bit by adding some ...

Microsoft:  http://aspnet.codeplex.com/releases/view/40584

Google:  http://code.google.com/p/minify/ ;  http://code.google.com/closure/

 

 

Some online ones that takes a block of javascript:

http://jscompress.com/

http://www.minifyjavascript.com/

A simple script you can add to your master page or content editor etc. to hide the “Sign in As a Different User” option that is available in the Personal Actions Menu. <script src="/jQuery/jquery-1.4.1.js" type="text/javascript">&... <script type="text/JavaScript"> jQuery(document).ready(func... { var objects = document.getElementsByTagNa... for (var i = 0; i < objects.length; i++) { itm = objects[i]; if (('#' + itm.id).indexOf("LoginAsDif... ...
At TechEd India 2011 I presented on HTML5 Development with Visual Studio 2010 SP1. I wanted to cover the aspects that were discussed in my session. HTML5 1. HTML5 is the emerging but promising trend in web development 2. Some of the standards have got green signal i.e. they are candidate recommendations. 3. Some others are still work in progress. 4. IE9 implements standardized HTML5 specifications. Visual Studio 2010 and HTML5 Visual Studio 2010 Service Pack 1 comes from basic HTML5 support. Having ...
The title of this blog post is a lie. I don't actually love MFC C++, in fact I think it's safe to say I hate it. Hate may actually not be a strong enough word... but it's the best I can do at the moment. Recently, I had the pleasure of having to come up with a printing solution for Windows Mobile 6.5 devices. For those of you not in the know (which until recently included yours truly) there's no printing capability in Mobile IE 6. As in... NONE. There's no print option hiding on a menu somewhere, ...
Yeah I know I don’t blog much anymore, because life has taken me places that don’t involve the interwebs unfortunately. I am in the midst of planning two events, starting a non for profit, creating more sessions for various conferences, submitting to various conferences, working a 40 hour a week job, attempting to hang out with boyfriend/friends/family. So you can see that list does not include this blog sadly that’s how it goes sometimes. The bottom piece very important over any of the top pieces. ...
Recently I wrote about JavaScript class patterns, and in particular, my favourite class pattern that uses closure to provide encapsulation. A class to represent a person, with a name and an age, looks like this: var Person = (function() { // private variables go here var name,age; function constructor(n, a) { name = n; age = a; } constructor.prototype = { toString: function() { return name + " is " + age + " years old."; } }; return constructor; })(); var john = new Person("John Galt", 50); console.log(john.toString()); ...
The day has finally come: Microsoft has released a web browser that is awesome. On Monday night, Microsoft officially introduced the world to the latest edition to its product family: Internet Explorer 9. That makes March 14, 2011 (also known as PI day) the official birthday of Microsoft’s rebirth in the world of web browsing. Just like any big event, you take some time to celebrate. Here are a few things that you can do to celebrate the return of Internet Explorer. 1. Download It If you’re not a ...
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false EN-GB X-NONE X-NONE MicrosoftInternetExplorer4 /* 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-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... ...
A new release of Microsoft All-In-One Code Framework is available on March 8th. Download address: http://1code.codeplex.com/r... You can download individual code samples or browse code samples grouped by technology in the updated code sample index. If it’s the first time that you hear about Microsoft All-In-One Code Framework, please read this Microsoft News Center article http://www.microsoft.com/pr... or watch the ...
Ever wanted to have a simple jQuery menu bound with ASP.NET web site map file? Ever wanted to have cool css design stuffs implemented on your ASP.NET data bound controls? Ever wanted to let Visual Studio generate logical layers for you, which can be easily tested, customized and bound with ASP.NET data controls? If your answers with respect to above questions are ‘yes’, then you will probably happy to try out latest release (v5.0) of Employee Starter Kit, which is intended to address different types ...
Who has not seen the Code Project's Tech Virtual Summit on Mobile Development, you can now see all the sessions on demand. The sessions are: The Mobile Development Landscape Android Push Notifications Beginning Android Flash Development Android for .NET/C# Developers Using MonoDroid iPhone 101: Introduction to iPhone and iOS Development Building Rich Mobile Apps with HTML5, CSS3 and JavaScript Building MVVM apps for Windows Phone 7 Using Panorama and Pivot Controls for WP7 apps Building Data Visualization ...
I was debugging a script injection issue the other day using some sample code with an alert in it. The alert was popping out meaning the code got executed leaving open the possibility for a hacker to put there some nasty malicious code. I knew my alert was being executed but didn’t know how. So I tried something that worked perfectly for this problem, replaced the native alert function with my own one. All I had to do in Chrome was open the javascript console and type: alert = function(msg){ console.log(msg); ...
I was facing a challenge yesterday that I was creating a Visual webpart and I wanted to validate the a submit button is only visible if the user checked a "I agree to terms" checkbox. Something was weired that I tested my code on a normal asp.net website and it worked perfectly while it had a different behaviour inside the webpart which is whenever I check the checkbox, the button is enabled but it will not fire the asp.net validators in client side. It posts back the page and then the validators ...