UK Hosting Directory

Just another WordPress weblog

Information Filled Under ‘ASP.NET’

ASP.NET 4.0 QueryExtender, AutoCompleteExtender and UpdatePanel – mashing it up all

I am playing with the ASP.NET 4.0 QueryExtender released as a part of the Visual Studio 2010 Beta 1 recently.   It provides endless opportunities for working with data without writing much code and when you combine it with a few Ajax features, gives a truly great user experience with very less effort.  To begin with you need the Visual Studio 2010 Beta 1 and .NET Framework 4.0 Beta 1.  You can install both from http://msdn.microsoft.com/hi-in/netframework/dd819232(en-us).aspx Also, I am using the Northwind sample database and this can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&displaylang=en To make things more fun, I am also using AJAX Control Toolkit.  You can download the same from http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27326 You can download just the DLL from the AJAXControlToolkit-Framework3.5SP1-DllOnly.zip link in this page since in this sample, we are just going to use the control.  However, if you already have the AjaxControlToolkit installed, you can simply reference the AjaxControlToolkit.dll file in the Website. Note that, due to a security implementation in VS 2010, the AjaxControlToolkit DLL cannot be used as is in the projects in VS 2010.  Check this post on using AjaxControlToolkit with VS 2010 Beta 1 http://blogs.msdn.com/webdevtools/archive/2009/05/26/using-microsoft-ajax-control-toolkit-with-visual-studio-10-beta-1.aspx Once you are done with the installation and other steps, create a new ASP.NET Website.  Note that, for the QueryExtender to work well, you need to make a small web.config update.  You can find the details about this, in my previous post  here   This is just a Beta behaviour

See the original post here:
ASP.NET 4.0 QueryExtender, AutoCompleteExtender and UpdatePanel – mashing it up all

Unknown server tag ‘asp:SearchExpression’ error with QueryExtender control in Visual Studio 2010 Beta 1

One of the cool things about ASP.NET 4.0 is the Query Extender and the ability to search within DataContext without using WHERE clause, writing extensive code etc.,  It works on the new set of namespace i.e. “System.Web.UI.WebControls.Expressions” namespace. I am trying to put up an extensive sample using QueryExtender in the next post, but for this post, I wanted to share an error that you might hit when trying to implement the Query Extender control with Search Expression, Range Expression etc.,  This error is specific to the Visual Studio 2010 Beta 1 build that was released to public

View original post here:
Unknown server tag ‘asp:SearchExpression’ error with QueryExtender control in Visual Studio 2010 Beta 1

ASP.NET AJAX 4.0 and the ScriptManager Control

I have been using ASP.NET AJAX 4.0 quite a bit lately, as I’m sure most of you are aware from my recent posts.  In those posts, I used standard HTML script references to show that ASP.NET AJAX is not reliant upon ASP.NET.  I realize that many of you are in fact using ASP.NET, and today we will take a look at using the ScriptManager.  First we’ll look at using the Preview 4 scripts within an ASP.NET 3.5 application (with the ScriptManager of course) as well as using client templates and ADO.NET Data Services with the ScriptManager in ASP.NET 4.0 (Beta 1).  After that, we’ll take a closer look at some of the new features of the ScriptManager in ASP.NET 4.0.  Preview 4 and the ASP.NET 3.5 ScriptManager In my posts on ASP.NET AJAX 4.0 so far, I used standard HTML script references (as stated earlier).  However, what if you wanted to incorporate the new ASP.NET AJAX 4.0 scripts with a ScriptManager.  I tried this in a recent ASP.NET 3.5 SP1 project, and ran into some issues getting it all to work out.  Thanks to this blog (and Bertrand LeRoy ), I found the solution.

Continued here:
ASP.NET AJAX 4.0 and the ScriptManager Control

Mozilla Crash Reporter – the death screen

As a part of my various experimentations, I do run Mozilla FireFox, Safari as well as Google Chrome.  Recently, Mozilla had a crash and it doesn’t allow me to proceed further upon restarting it.  The above screen shows up.  I thought, clicking on “Restart Firefox” after submitting the information would help, but everytime I try running FireFox, the same dialog comes up. There must be some indication that Mozilla wouldn’t function and I would need to reinstall or something like that. Compared to the IE8’s crash recovery which not only restores the tab/browser and says that this has been recovered, the experience Mozilla Firefox gave is annoying.

Original post:
Mozilla Crash Reporter – the death screen

ViewModel with MVC/Navigation in Silverlight

I’ve been writing about ViewModel (aka MVVM) pattern ( here , here , here and more) and implementing it in Silverlight.FX for quite some time now, and it continues to be an exciting area for further thinking, and prototyping. This time around I want to cover how ViewModel and MVC fit together in an application at the same time. I have put together a set of navigation features into Silverlight.FX: a Page base class, a PageFrame control, and a Navigate trigger action

See the rest here:
ViewModel with MVC/Navigation in Silverlight

Windows Vista SP2 and Windows Server 2008 SP2

The Windows team put up quick work and released the SP2 for Windows Vista and Windows Server 2008 despite the parallel Windows 7 work that has been keeping them busy.   So if you are running Windows Vista SP1 or Windows Server 2008, you can install SP2 released from http://www.microsoft.com/downloads/details.aspx?FamilyID=a4dd31d5-f907-4406-9012-a5c3199ea2b3&DisplayLang=en or better turn on automatic updates and it should do the update sometime during this month. Currently it is available for 5 languages and more general availability might be over the next few months.  Note that Windows Vista SP1 is a pre-requisite and it can be downloaded from http://technet.microsoft.com/en-us/windows/bb738089.aspx In the case of Windows Server, when it was released, it came by default with SP1 so this is technically the Service Pack 1 although, for versioning consistency it is SP2.

More here:
Windows Vista SP2 and Windows Server 2008 SP2

ASP.NET 4.0 AJAX – Preview 4 – Data Binding

Throughout the course of my introductory posts on ASP.NET AJAX 4.0, we looked at the new DataView control as well as the Sys.Observer class , which brings the Observer pattern to plain JavaScript objects.  The new ASP.NET AJAX release is very exciting offering powerful new features to take AJAX enabled applications to a new level.  In this post, we’ll look at another exciting feature of ASP.NET AJAX 4.0 known as “live bindings.”  You may remember that we looked briefly at live bindings in the client templates post, but for those examples I used one-way / one-time bindings.  Today, we’ll take a closer look at live bindings and see how two-way live bindings removes the one-way / one-time binding restriction allowing us to update bound elements on our page automatically when the underlying data changes.  Again, in this post, I’ll be using Preview 4 of the ASP.NET AJAX Library, which can be downloaded from CodePlex .  The Preview 4 version can be used in your applications today (e.g. ASP 3.5, HTML).  Keep in mind that these components are still in “preview” mode (meaning no Microsoft support), though they are usable at your own risk.  For more information, you can check out the license on CodePlex

Read the original here:
ASP.NET 4.0 AJAX – Preview 4 – Data Binding

ASP.NET 4.0 AJAX – Preview 4 – JavaScript Observer Pattern

In my last post on ASP.NET AJAX 4.0, we took a look at the new DataView ASP.NET AJAX control .  We saw that by using a DataView, we could easily bind data with JavaScript or declaratively with a few attributes.  In this post, we’ll look at another feature of the ASP.NET 4.0 AJAX Library, the Observer design pattern for plain JavaScript objects.  The pattern is implemented in the client side Sys.Observer class.  This feature is used internally within the new version of ASP.NET AJAX for live-binding and the DataView control .   Here we will be using Preview 4 of the ASP.NET AJAX Library, which can be downloaded from CodePlex .  Remember that these components are still in “preview” mode (meaning no Microsoft support), though they are usable at your own risk.  For more information, you can check out the license on CodePlex.  I highly recommend downloading the samples available for Preview 4, which are also available at CodePlex .  The samples give you a good look at what is coming.  In this post, we’ll take a closer look at the Sys.Observer class, witness the problems it solves, and take a look at a few examples.    A Quick Look at JavaScript Objects To this day, I still know developers who either don’t understand, don’t want to understand, or flat out loathe JavaScript.  I suppose this really has to do with it being totally misunderstood , but in a Web 2.0 world, a web developer should embrace the language.  Especially with wonderful frameworks like jQuery and the Microsoft AJAX Library  This section is a quick overview of JavaScript objects in case you aren’t familiar with them.  Objects in JavaScript can be described as hashtables, they are collections of names and values,  for example: // An empty object var person = {}; // Another way of defining an object var person2 = new Object(); // Adding a name/value pair (a local variable) person[ "firstName" ] = ‘Damien’ ; // You can also use the dot notation instead of subscript notation person.lastName = ‘White’ ; // And you can define objects using the object literal notation var person = { firstName: ‘Damien’ , lastName: ‘White’ }; This is by no means definitive. If you have JavaScript-phobia, you should start here . The Object Modification Problem Let’s say you have a simple object with a couple of properties.  Note that JavaScript doesn’t have properties as we know them in .NET, they are just local variables like those defined on the person object in the previous code snippet, however there are conventions for emulating them with functions.  Back to our simple object, let’s say that you need to be notified if the object changes.  Take the following snippet, note I’m using the jQuery in order to simplify the code (e.g.

Here is the original post:
ASP.NET 4.0 AJAX – Preview 4 – JavaScript Observer Pattern

Finding installed version, edition and service pack version of SQL Server

Today I wanted to find the version of SQL Server 2008 installed in my machine.  I did a quick search and the first support article from Microsoft had the answer to it http://support.microsoft.com/kb/321185 I just modified it a little bit with column headings so that if you are using it in an SP, returning it etc., it would help.  So the modified query is as below SELECT SERVERPROPERTY(‘productversion’) as ‘Product Version’, SERVERPROPERTY (‘productlevel’) as ‘Service Pack Version’, SERVERPROPERTY (‘edition’) as Edition If there are better/alternate ways, please post in the comments. Cheers !!!  

Read this article:
Finding installed version, edition and service pack version of SQL Server

How To: Adding MVC items to an ASP.NET Web Application

I’ve been experimenting with using ASP.NET MVC inside a standard ASP.NET Web Application (Web Forms).  I really like what’s been released with MVC 1.0 and can see places where existing apps would benefit from the features.  Plus, having just finished Professional ASP.NET MVC 1.0 from Wrox (see my book review ), I couldn’t wait to start using it.  The last chapter of the book , Chapter 12, entitled “ Best of Both Worlds: Web Forms and MVC Together, ” discusses configuring an ASP.NET Web Application to support the new ASP.NET MVC features.  Note that adding Web Forms to an ASP.NET MVC project template is much easier (meaning no configuration/reference changes), since ASP.NET MVC is built on top of the ASP.NET Framework.  Anyway, after referencing the required libraries, creating the necessary directories, and updating the web.config, you’ll find that templates for the MVC items (e.g. Controllers, Views), are missing as options.  Well after digging around on the web, I found a solution to the problem .  It involves editing the project file and adding a guid to the ProjectTypeGuids node.  Caution: Before you do this, make sure that you have ASP.NET MVC 1.0 installed on your machine, also BACKUP your project file before modifying it.  If there is a mistake in the file, Visual Studio won’t load the project properly.

See the original post:
How To: Adding MVC items to an ASP.NET Web Application

Some important links

Update for .NET 3.5 SP1 (Important if working with Dynamic Data) http://support.microsoft.com/kb/959209 ASP.NET Compilation Enhancement Fix http://code.msdn.microsoft.com/KB967535/Release/ProjectReleases.aspx?ReleaseId=2328   (for Windows Vista and Windows Server 2008) https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=18157 (for Windows XP and Windows Server 2003) Microsoft .NET RIA Services May 2009 Preview http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&displaylang=en ASP.NET 4.0 in VS 2010 Doc    http://www.asp.net/learn/whitepapers/aspnet40 Some of them are a little old but thought worth putting them up. Cheers !!!

Read the original here:
Some important links

PPTs opening very slowly? – Check your printer drivers – Microsoft Office 2007 PowerPoint

Recently I seemed to have issues with opening PPT files.  I am running Office 2007 for a long time now and one of the things that I use most with respect to my work is PowerPoint files.  Over the last 2 weeks I saw a certain weird behaviour with PPTs specifically related to printer options. Every time, I try to open the PPT or unlock the system with the PPTs open, they try to print to my default printer.  The specific error message would state that the default printer could not be accessed.  I dismissed them couple of times and thereafter, the PPTs start working normally.

View post:
PPTs opening very slowly? – Check your printer drivers – Microsoft Office 2007 PowerPoint

Visual Studio 2010 and .NET 4.0 Beta 1 Download today

  After the tremendous amount of interest the VPCs of the Visual Studio 2010 and .NET 4.0 generated, the Beta 1 bits would be available for download for MSDN Subscribers later today.  The general public would also be able to download the bits starting this Wednesday. Visual Studio 2010 combines the power of .NET 4.0 and the tremendous enhancements done to areas such as Web Development, WPF as well as native development and provides the best so far platform for developers. While some of the features were available as v1 in .NET 3.5 SP1 as well as individual downloads over the last few months, with Visual Studio 2010, all of these are bundled into one install and has much richer integration support for many of what developers wanted.

Follow this link:
Visual Studio 2010 and .NET 4.0 Beta 1 Download today

ASP.NET Sessions at Tech.Ed India 2009

I am back from delivering Tech.Ed India 2009 , particularly the web platform track where I delivered three sessions across 2 days.  In addition, we also had Stephen Walther from the ASP.NET Team deliver sessions on ASP.NET 4.0, ASP.NET MVC and ASP.NET AJAX. Over the next few posts, I would like to get all the content that we discussed during Tech.Ed India and possible videos so that even if you missed the action over there, you could benefit right here.  To begin with, the sessions focussing on ASP.NET were ASP.NET 4.0 by Stephen Walther ASP.NET MVC by Stephen Walther ASP.NET Dynamic Data by Harish Ranganathan (that’s me) IIS 7.5, Server Core with ASP.NET – Windows Server 2008 R2 by Praveen Srivatsa ASP.NET AJAX by Stephen Walther VS 2010 Web Deployment features by Harish Ranganathan ASP.NET – A day in the life of an ASP.NET Request by Harish Ranganathan While bulk of the above require VS 2010 bits, to begin with, lets pick up the sessions which don’t require ex.-  The session on ASP.NET Dynamic Data.  In this post, I would specify the things to get started and cover up the actual content in the next post

Read the original here:
ASP.NET Sessions at Tech.Ed India 2009

Book Review – Wrox Professional ASP.NET MVC 1.0

Working primarily on web applications, I’ve focused most of my time on ASP.NET Web Forms since the very early betas.  Web Forms were truly a great revolution in the web world.  Once I saw the functionality when it first came out (when I was using ::shudder::  “classic” ASP), I couldn’t wait to start using it.  I began right away with ASP+, as it was called back in 2000 , abandoning Visual Interdev and ASP, yippee.  The release of Version 1.0 came out January 16, 2002, changing the way we work with the web. Flash-forward 7 years (9 from the early betas), and the programming world has changed.  With things like TDD (Test Driven Development), AJAX, JSON, jQuery, etc, and the complexity of web applications growing, sometimes Web Forms would get in the way.  To be fair, the Web Form framework is very robust and tries to be helpful, but sometimes we developers like to shoot ourselves in the foot.  One example that I’m sure many of you have experienced is trying to interface with a server-rendered element on the page.  Performing something like a document.getElementById(‘UserName’) in JavaScript doesn’t exactly work as expected when the ID of your textbox is now something along the lines of “ctl00_mainContent_LoginCtrl_UserName,” does it?  On this particular topic, ASP.NET 4.0 has a solution for this problem , but that isn’t the focus of this post.  The Client Id problem, is just one example of the framework “getting in your way.”  This is one of the many reasons behind the advent of ASP.NET MVC .  Having just finished Professional ASP.NET MVC 1.0 from Wrox, I’m a convert

Read the original post:
Book Review – Wrox Professional ASP.NET MVC 1.0

ASP.NET 4.0 AJAX – Preview 4 – Client Templates

A little over a month ago, Microsoft released the fourth preview of ASP.NET 4.0 AJAX.  This is the new release of the Microsoft AJAX Framework that will be released with ASP.NET 4.0.  We’re getting closer to the RTM release of .NET 4.0 (hopefully later this year), so I figured this would be a good time to start posting about ASP.NET 4.0 AJAX.  There are some very exciting things coming along with ASP.NET 4.0, and the ASP.NET AJAX component is no exception.  The best news about ASP.NET AJAX is that you can start using it today without having to wait for the full blown ASP.NET AJAX framework.  Keep in mind that these components are still in “preview” mode (meaning no Microsoft support), though they are usable at your own risk.  For more information, you can check out the license on CodePlex. In this post, I’ll be talking about the client templates that can be found in the latest release.  Client templates are very powerful.  They are a key component for rich client-side applications.  Up until now, I have been using jTemplates , a client template solution plugin for jQuery.  If you aren’t familiar with jTemplates, check out Dave Ward’s article “ Use jQuery and ASP.NET AJAX to build a client side Repeater .”  jTemplates is really a nice plugin, but it’s a bit disconnected from the flow of the page.  Enter ASP.NET 4.0 AJAX and the DataView control. Introducing the Sys.UI.DataView Control The ASP.NET AJAX DataView (not to be confused with the ADO.NET DataView), is a new control that functions similar to a server-side repeater as you will see.  The first thing to note with the DataView is that this control operates without ASP.NET, meaning you can use this in any framework or even a straight HTML page.  This shouldn’t be too much of a surprise, since you can download the ASP.NET AJAX Library 3.5 as standalone scripts today.  Having said that, let’s start with an simple example that will just run in a standard HTML page.  For this first example, I will walk through declaratively setting up template binding.  Let’s get started… Want to follow along with the examples?

Link:
ASP.NET 4.0 AJAX – Preview 4 – Client Templates

Specialized Layout Panels for Silverlight

The layout system in Silverlight is, in my opinion, one of the key differentiators in presentation engine capabilities from HTML/CSS (on a related note, see my post long ago about my browser/scripting wish list and the references to need for core layout primitives). The Silverlight platform provides a set of out-of-the-box layouts like Grid, so you don’t have to simulate them with low-level absolute positioning, and float/clear css attributes.

Read more:
Specialized Layout Panels for Silverlight

Are You Protected?: Design and Deploy Secure Web Apps with ASP.NET 2.0 and IIS 6.0

Ensuring the security of a Web application is critical and requires careful planning throughout the design, development, deployment, and operation phases. It is not something that can be slapped onto an existing application. In this article, Mike Volodarsky outlines best practices that allow you to take advantage of the security features of ASP.NET 2.0 and IIS 6.0 to build and deploy more secure Web applications

View post:
Are You Protected?: Design and Deploy Secure Web Apps with ASP.NET 2.0 and IIS 6.0

Who Goes There?: Upgrade Your Site’s Authentication with the New ASP.NET 2.0 Membership API

Here Dino Esposito and Andrea Saltarello cover the plumbing of the Membership API and its inherently extensible nature, based on pluggable providers. To demonstrate the features, they take an existing ASP.NET 1.x authentication mechanism and port it to ASP.NET 2.0, exposing the legacy authentication mechanism through the new Membership API. Dino Esposito and Andrea Saltarello MSDN Magazine November 2005

More:
Who Goes There?: Upgrade Your Site’s Authentication with the New ASP.NET 2.0 Membership API

Best Practices: Fast, Scalable, and Secure Session State Management for Your Web Applications

ASP.NET provides a number of ways to maintain user state, the most powerful of which is session state. This article takes an in-depth look at designing and deploying high-performance, scalable, secure session solutions, and presents best practices for both existing and new ASP.NET session state features straight from the ASP.NET feature team. Mike Volodarsky MSDN Magazine September 2005

Read more here:
Best Practices: Fast, Scalable, and Secure Session State Management for Your Web Applications