Tag | Javascript Posts

Issue: Due to an upgrade from .Net 2, 3.0 or 3.5 to .Net 4.0 or you are starting a new .Net 4.0 project, you may run into this message: A potentially dangerous Request.Path value was detected from the client Or A potentially dangerous Request.Form value was detected from the client Environment: .Net 4.0 MVC 3 (could be MVC 2 also because of the controller/action action filters that are available) Fix: Lets tackle the first issue: A potentially dangerous Request.Path value was detected from the client ...
Here is the screenshot of final output. Here is what PoC is doing 1. There is Silverlight application hosted in CRM on custom area-subarea. This in-turn needs two web resources 2. There is Custom button added in Ribbon 3. Third web resource is hosting JavaScript function 4. On click of Custom Button on CRM Ribbon function in JavaScript web resource is called which in-turn calls the method in C# code of Silverlight application. String input is passed to this method 5. C# method is converting the input ...
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. Support for unlimited number of data series and data points. Support for unlimited number of chart axes. True DateTime ...
Check out the Top Five most popular news at SilverlightShow for SilverlightShow Top 5 News for August 14 - 21, 2011. Here are the top 5 news on SilverlightShow for last week: The Top 5 WPF and Silverlight Gotchas Can Microsoft ‘fix’ JavaScript and make HTML5 applications viable? The LOB Chronicles - Exploring User Experience (UX) Slides for our upcoming 'Deep-DIVE in Silverlight FIVE' webinar Mango Baby Steps: Unit Testing your WP7 app Visit and bookmark SilverlightShow. Stay in the 'Light ...
The WebBrowser control uses behind the scenes the IE engine to render the pages. Fortunatelly/Unfortunatelly is that, we have together with the rendered page the IE-default shortcuts, the context menu shown after pressing the right mouse button etc. To disable e.g. refreshing the page by pressing F5, we can set the WebBrowserShortcutsEnabled property to false. To disable the context menu, the WebBrowser control have either a property, called IsWebBrowserContextMenuEnab... When we set it to false, ...
JQuery is probably the most popular JavaScript library ever. I was facing a bad "time" requirement change tonight and that was poping up "Terms and Conditions" pop up as a mandatory option for registration. I just picked up fife minute solution: You will need Fancy box (fancybox.net) but just whatch out to not overwriting JQuery references, they need to loaded sequentially and could easily drive you to a horrible nightmare! 1-Set References: <link rel="stylesheet" type="text/css" href="Scripts/jquery.fancyb... ...
I was recently asked to review Studio for Wijmo MVC by Component One and, overall, I am impressed. There are 2 major components of this. The first is Wijmo Complete which is a collection of over 30 UI widgets (very similar to jQuery UI). The second is Wijmo Scaffolding for MVC which builds upon the scaffolding that was released as part of the MVC 3 Tools Update (note: is does *not* build on top of powershell-based MVC Scaffolding which Microsoft released earlier this year). Some of the Wijmo widgets ...
I have a client that desired to have the MOSS 2007 capability of My Links but in no way wanted My Sites in SharePoint 2010. I took some steps that gave them the capability of My Links by creating a personalized web part that could be linked to in a modal. It worked, However, in addition, they didn’t want users without web admin rights to see the SharePoint ribbon. The result was that admins could use the web part and the personalization data would be kept by SQL in the personalization database. Members ...
Microsoft isn’t the only one who seems to be pushing native computing once again. We’re now seeing Google at the same table with the current beta release of Chrome. Yes, Chrome now supports native applications to be embedded in a web site and it’s just like embedding JavaScript. More information can be found in here: http://chrome.blogspot.com/... The native client SDK runs a sandbox environment which means Chrome handles security of the module just like ...
I’m a big fan of client-side development using HTML / CSS / JavaScript for about the past 2 or 3 years – really ever since I dug into jQuery and really began to appreciate the power that the technologies on the client-side possess. Nowadays, everything is HTML / CSS / JavaScript – it’s in all the articles, all the techies are talking about it, and it’s on everyones’ resumes. In looking at candidate resumes or listening to presenters speak about web technologies, we constantly hear “HTML / CSS / JavaScript”. ...
Occasionally I write a rant or two and this one has been boiling for ages. First off you need to read Mike Watson’s Blog Post on Silverlight Ambiguity in Office 365: http://jmikewatson.wordpres... So now let’s get started. First off this post has been boiling since I have heard the question in one of my sessions last year “What do you think will happen to Silverlight now that HTML 5 exists?”. I brushed it aside. I ignored it when ...
Javascript is a very powerful tool to enhance the user experience. However, poorly optimized javascript can have a very negative effect due to increased page load time. This becomes particularly apparent as the number of elements on a page increases thanks to controls bound to increasingly large data sets. For those that are new to jQuery, assuming we have two divs (div_drag and div_drop), we can add drag and drop functionality by registering listeners during our form load: $("#div_drag").draggable(); ...
I am a firm believer that, regardless of the framework you use, if the framework is good it provides you all of the things you need. I believe ASP.Net MVC 2 is good and therefore provides me everything I need. This means I don't need to write a significant amount of custom UI code (jQuery, MVC Ajax, etc.) to do things that should be considered "standard". One of these pretty standard things submitting a form via Ajax. MVC provides for this very well with Ajax.BeginForm. The contents of the form are ...
Now that I've got a few javascript applications under my belt, I'm strating to see a pattern emerge. A javascript app for me always starts with three files. An html, a css, and of course a js file. This is the triangle that makes the base for your application to build upon. The fourth piece that I always include is a reference to jQuery. I wouldn't even try to write a javascript app without it. It's the defacto framework that makes javascript programming tolerable and should be included in any project ...
This blog has been relocated to http://blachniet.com. See this post at it's new home: http://blachniet.com/2011/0... is post is meant to be a more straightforward overview of my previous post. The previous post got a little long and turned into a walthrough. If you need a walkthrough of this, check out that post at http://geekswithblogs.net/b... So in my new exploration ...
After writing this post, I realized that it is obnoxiously long, and maybe includes a little bit too much hand-holding. Nevertheless, I decided to post this very detailed step-by-step walkthrough of implementing a simple AJAX form in MVC3 with Razor. I'm probably going also post a shortened version of this topic for those that don't need a complete walkthrogh. So I've been attempting to dive into ASP.NET MVC 3 lately, and have hit plenty of bumps along the way. This is my first encounter with any ...
Today at work we had an interested request come in from a client. They had an iPad and couldn’t scroll on their SharePoint 2010 website. I went ahead and pulled out my iPad 2 even though I am mostly a Microsoft guy and decided to look around on their site. Their homepage loaded fine and a couple others did also. I kept browsing and discovered one page that just cut off when you tried scrolling. I decided to try all of the iOS web browsers that are free so I downloaded them all and none of them solved ...

Today's $10 Deal of the Day from APress at http://www.apress.com/9781430272199 is JavaScript for Absolute Beginners

"If you are new to both JavaScript and programming, this hands-on book is for you."

ASP.NET Detect and alert forms authentication timeout With help from & thanks to PsychoCoder at http://www.dreamincode.net/... 1. Add sessionState to web.config <system.web> <sessionStatetimeout="1"... /> <!--minutes e.g. 120 = 2 hours--> 2. Add FormsAuthentication to web.config <authenticationmode="For... <!--timeout minutes (needs to be the same as in sessionState above) e.g. 120 = 2 ...
Official Site | Samples | Download | Documentation | Forum | Twitter With jqChart jQuery Plugin is easy to create real-time web charts using only HTML and JavaScript. Visit our live Live Data Chart sample. Official Site | Samples | Download | Documentation | Forum | Twitter ...
I was working on a MVC3 project using jQuery to populate a text input in an iframe element from the parent. The catch is that the iframe source is on a different domain. When I first tried to do it, the javascript gave me the Permission Denied error for trying to access the iframe document in a different domain. If the domain of the parent and iframe child are the same this Permission Denied error will not be encountered. To get the iframe domain the same as the parent I needed to use a proxy to ...
I have a need for a highly responsive web page that must at least appear to be "pushed" information from the server as it happens, much like you'd see with an HTTP protocol based chat window. The client will utilize JavaScript, and will use JQuery and its UI plugins, and will use its AJAX support to call the requests that will only return when there is data to be "pushed". I know HTML 5 includes support for WebSockets, but I feel it is too soon to rely on them, as the spec is not yet finished and ...
As mentioned in a previous post, I have been accepted to speak at VMworld2011 the week of August 29 in Las Vegas. Since that time I have been working on my presentation with my speaking partner and VMware SE Jeff Szastak. We have submitted the first draft of our deck in for comments and gotten some good feedback. I have now begun to incorporate those changes in to the deck as the final version is due in early August. I am excited to be going to this conference for the first time and especially so ...
At http://www.mindscapehq.com/... there is a new free Visual Studio 2010 add-on. "You may have noticed that this new-fangled Web thing is getting quite a bit of traction at the moment. And these days you can’t get away with static Web pages built with table-based layouts and presentational markup. It’s all script this and stylesheet that and jQuery the other. Why, even those time-hallowed animated GIFs of little men digging ...
Yesterday I received an email from Jetbrains to notify me of the release of ReSharper 6. Highlights of ReSharper 6 include: Rich support for JavaScript, CSS, HTML, and ASP.NET MVC 3 (Razor) Bundled assembly decompiler New navigation actions and valuable additions to existing navigation features Code inspections and quick-fixes for code quality analysis in VB.NET code Multiple new code inspections and quick-fixes for C# Improved refactorings and context actions, including those helping convert LINQ ...
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 ...
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.... ...
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 ...
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 ...
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 ...
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... ...