Tag | ASP.NET Posts

Doing more unit testing and I ran across this nice article on mocking up TempData. That’s great because tempdata is used a lot in controllers and you need a way to mock it for unit testing. Again, this code is in C#, so I will show you the vb version. http://weblogs.asp.net/left... Hres the StubTempDataHttpSessionState class: Imports System.Web.Mvc Imports System.Web ''' <summary> ''' HttpSessionState for TempData ...
“Design Patterns 100? is a prerequisite for .NET Developers. (Part 5 – Excerpts from July 2010 – PhillyNJ.NET Presentation) Continuing our discussion from Part-4 we ask. What are the “Gang of Four” (GoF) Behavioral Patterns and where can we find them in the .NET Framework? Chain of Responsibility Pattern – A way of passing a request between a chain of objects Command Pattern – Encapsulate a command request as an object Interpreter Pattern – A way to include language elements in a program Iterator ...
“Design Patterns 100? is a prerequisite for .NET Developers. (Part 4 – Excerpts from July 2010 – PhillyNJ.NET Presentation) Continuing our discussion from Part-3 we ask. What are the “Gang of Four” (GoF) Structural Patterns and where can we find them in the .NET Framework? Let’s look at a list of the Strutural Patterns as defined by the GoF. Adapter Pattern – is used to match interfaces of different classes Bridge Pattern – is used to separate an object’s interface from its implementation Composite ...
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 ...
Much has been talked about the new release of ASP.NET MVC, i.e. MVC 3 and the new Razor syntax and the ability to simplify the development. Razor uses the @ prefix for switching between code and HTML and that kind of simplifies it when compared to using <%: symbol as with the case in MVC and ASPX engines. Here is a nice article from David Ebbo on how all of these fit together Not just that, Razor comes with a lot of goodies. The Helper classes simplify in doing some of the common tasks, doing ...
In this Issue: Rudi Grobler(-2-), Michael Washington, Ashish Patil, Oren Gal(-2-), Andrea Boschin, WindowsPhoneGeek, Jesse Liberty, John Papa, Mike Taulty, and Paul Sheriff. Above the Fold: Silverlight: "Getting Driving Directions in a Silverlight Application" Oren Gal WP7: "Creating a Windows Phone 7 Trial Application: Advanced Buy Now Implementation" WindowsPhoneGeek LightSwitch: "Using The Document Toolkit for LightSwitch" Michael Washington Shoutouts: SilverlightShow posted their top 5 articles ...
You probably have already visited Channel 9, and if you have not I would recommend to definitely check it out. There are literally thousands of videos about development using Microsoft technologies (and more). You can watch the videos on the site using Silverlight player or you can use links on each video page for downloading. This usually works fine if you are interested in just one or a small number of videos, but it might become somewhat tedious if you want to download a bunch of them. I recently ...
If you are trying to get up to speed on Visual Studio 2010 and .NET Framework 4.0 you can get a training kit from Microsoft website for free. It is 411 MB exe file and after install you can navigate thru presentations, labs and demos. http://www.microsoft.com/do... N. Overview The Visual Studio 2010 and .NET Framework 4 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help ...
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 ...
In this Issue: Kunal Chowdhury, Joost van Schaik, Xpert360, Tony Champion, Paul Sheriff, Vangos Pterneas, Jesse Liberty, Jeremy Likness, Mike Taulty, and Pete Brown. Above the Fold: Silverlight: "Binding on Style Setter in Silverlight 5" Kunal Chowdhury WP7: "Debugging Windows Phone 7 device network access with just a laptop" Joost van Schaik Training: "MVPs Chat It Up on Twitter - Tony Champion's Pivot of the results" Tony Champion From SilverlightCream.com: Binding on Style Setter in Silverlight ...
At http://oreilly.com/store/dd... O Reilly are offering a number of titles in celebration of TechEd Of the lists, ones that I have read and can recommend are: CLR via C#, Third Edition - http://oreilly.com/catalog/... - An excellent book that all C# developers should read once they have a year to two years experiance of Dot Net. Programming Windows Identity Foundation - http://oreilly.com/catalog/... - a specialist ASP.NET book useful if you are looking for a replacement ...
In this Issue: David Catuhe, Andrea Boschin, Kunal Chowdhury(-2-), Colin Eberhardt, Mike Ormond, Doug Rathbone, John Garland, Jesse Liberty, Mike Taulty, and Pete Brown. Above the Fold: Silverlight: "ItemsControl from scratch to your own controls" Andrea Boschin WP7: "Metro In Motion #5 – SandwichFlow" Colin Eberhardt Shoutouts: Alan Cruz sent me a link to his Social Network site he's developed in Silverlight... this is another 'sign yourself up' thing... I did it, nothing bad happened :) ... Alan ...
How to manage the controller's session state? Simply we can decorate the controller class with "SessionState" attribute. [SessionState()] attribute accepts SessionStateBehaviour enumeration. SessionStateBehaviour enumeration has the following constants. SessionStateBehavior.Default - ASP.NET default logic is used to determine the session state behavior for the request. SessionStateBehavior.Required - Full read-write session state behavior is enabled for the request. SessionStateBehavior.ReadOnly ...
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 ...
One of my colleagues pinged me to check, how to use the MailDefinition class for creating formatted mails from a .NET Console Application. She was referring to this article http://www.search-this.com/... which seems to be building a nice template email that can be sent. But this article was related to ASP.NET and hence didn’t have issues in referencing the MailDefinition Class which is part of System.Web.UI.WebControls namespace. The application ...
Lately, I have been taking some time to learn some new technologies. For me, the best way to learn a new technology is to jump head first into a project: Daily deal websites such as GroupOn, LivingSocial, DealFind, etc. have really taken off over the last 6 months. With so many sites out there, my inbox was being flooded with emails from all these daily deal websites. This seemed like it might be a fun project, so I set out to build a daily deal aggregator. First, I built a Windows Phone 7 app. I ...
This past week the company I work for re-launched our external facing internet site, all powered by SharePoint 2010. I already blogged about it, but have you ever wondered, what does it take to build a great looking site? There are 3 basic levels of Branding in SharePoint 2010: Low Effort Remember the themes in SharePoint 2007? well its incredibly easy to build them in SharePoint 2010.The best examples out there are the ones that use Power Point 2010 to produce color schemes and styles and apply ...
I just noticed that I get to the top contributor list again for the last 30 days at the Microsoft official Asp.net Community Forums (http://forums.asp.net/). Feels great! =} Technorati Tags: Community ...
In this Issue: Kunal Chowdhury, Peter Kuhn, David Anson, Rob Tiffany, Paul Sheriff, Jesse Liberty, Jeremy Likness, Mike Taulty(-2-), and Andrea Boschin. Above the Fold: Silverlight: "Performance Optimization of Silverlight Applications using Visual Studio 2010 SP1" Jeremy Likness WP7: "The Reactive Snake for Windows Phone 7" Andrea Boschin From SilverlightCream.com: Step-by-Step Using ImplicitDataType in Silverlight 5 Beta Kunal Chowdhury has a good tutorial up on Silverlight 5 Beta's ImplicitDataType ...
NuGet (pronounced NewGet), is an open source .Net Package Management Tool compatible with Visual Studio 2010 both Express and Commercial Editions. This simple-yet-powerful tool offers a simple way for incorporating and managing .Net packages in Visual Studio 2010 projects. In leveraging NuGet, we get an intuitive user interface allowing the selection of available packages and an easy way to subsequently manage version upgrades or uninstalls for packages already installed via NuGet. I recently spoke ...
Luego de varios días de trabajo pesado, nuevamente tengo tiempo para publicar en mi blog. Para este post trataré de dar respuesta a una pregunta que se genera constantemente en los foros de MSDN, como encryptar los valores enviados a través del queryString en una URL. Primero que nada he de decir que métodos de encriptación hay muchos, desde los personales hasta el MD5 y todos los conocidos. En nuestro ejemplo, trabajaremos con un código de encriptación utilizando el DESCryptoServiceProvider de asp.net ...
Since we don’t have a direct way to indicate that some user will be locked, the only way I got to do that, was forcing a wrong login multiple times, until reach the maximum attempts defined on “maxInvalidPasswordAttemps” attribute. When we use ASP.NET Membership, on web.config file you have something like this: <add name="AspNetSqlMembershipPr... type="System.Web.Security.S... connectionStringName="MyApp... enablePasswordRetrieval="fa... enablePasswordReset="true" ...
If you were using the customized MessageBox, ConfirmBox and FrameBox controls and wanted to modify the look and feel of the these controls then you should be happy because the new version of the ProudMonkey controls provide some properties that you can set to customize the modal controls including the header, buttons, body background color, header fonts etc. You can download the new version here: ProudMonkey Controls Version 2 The MessageBox provides the following properties: HeaderImageUrl - This ...
In this Issue: David Catuhe, Paul Sheriff, Bill Steele, Den Delimarsky, Bill Burrows, Doug Rathbone, Matthias Shapiro, Jason Alderman, Jessica Fosler, John Garland, WindowsPhoneGeek, Jesse Liberty, and Jeff Prosise. Above the Fold: Silverlight: "Silverlight 5’s New and Improved Threading Architecture" Jeff Prosise WP7: "Silverlight Game Development webcasts" Bill Steele Shoutouts: Jesse Liberty has a short post up describing some of the features we can expect with the Tooling in Mango From SilverlightCream.com: ...
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 ...
Join us for a special WebMatrix and ASP.NET MVC Web Camp you don’t want to miss. No matter your expertise in web development, these Web Camps are the perfect opportunity to get hands-on experience and 'unleash your coding genius'. Our interactive sessions will: Introduce ASP.NET Web Pages and WebMatrix; discuss possible uses of these Facilitate an in-depth discussion on when to migrate ASP.NET WebPages applications to ASP.NET MVC Explore new features of ASP.NET MVC 3 Take a dive deep into jQuery ...
Sometimes, the way that LINQ to Twitter materializes queries into entities isn’t immediately clear. It’s easy to get confused until you see the patterns or make a correlation between the Twitter API results and their representations as LINQ to Twitter entities. In this post, I’ll explain some of the logic behind the design of LINQ to Twitter entities and demonstrate an example of one of the more oddly designed entity types, Search. Note: They'll be talking about MVC3 during multiple sessions at Tech-Ed. ...
In this post I want to highlight how easy it is starting a MVC Project using NuGet and deploy it to AppHarbor. It is not much but it is fun. First you need to install Visual Studio 2010. Then, go to Tools –> Extension Manager. From the Online Galery install NuGet ( if you don’t already have it ). Make sure you also have ASP.NET MVC3 installed. Create a new MVC 3 Project. Add a Class Library project to the solution. Since you’ve added NuGet you have access to the Package Manager Console. I’m sure ...
I haven’t been able to get my work email syncing with my Samsung Focus since I started the new gig due to some certificate issues. When I try to connect, I’m just told there’s a problem with the certificate. The real underlying issue is that the certificate for my work email isn’t installed on my WP7 device. Unfortunately, this ends up being a manual task that you have to perform, but its not a difficult one once you know what to do. Jerome Laban’s blog post talks about the root cause of the issue: ...
This is just a note to myself on what needs to be changed while working on projects that are on a UNC share. Problem 1: The first problem is the Trust level for Intranet Zone. Fix: Go to Control Panel\Administrative Tools\ and launch Microsoft .NET Framework 2.0 Configuration Tool. Click on Runtime Security Policy, then in the right pane, click Adjust Zone Security. Click Local Intranet and change the trust level for this zone to Full Trust. Then you might get this error: Problem2: The network BIOS ...
Typically we will attach the mouseover and mouseout client-side events on the gridview rows to highlight rows on mouseover, but there are cases that we don't want to make the row highlighted when we are on edit mode. To do this we can check the GridView EditIndex to determine if the row is on edit mode and then do the validation there. Here's a sample code block below of what I am talking about: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) ...
Many time developer required specific port for development when he/she using Visual Studio for asp.net application development. They specify port by taking Properties of the Web Site and select Web option. Under Server option select Use Visual Studio Development Server and then set port in Specific Port option. Ok when Windows Azure developer need to set a specific port to the WebRole application they need to take different approach. From Solution Explorer Window select open WebRole Section in my ...
Passionate aboutProductivity Visual Studio add-in for C#, VB.NET, XML, XAML, ASP.NET and more Resharper is an excellent productity tool for both C# and VB.NET! When I first saw it demonstrated, I wanted to buy my own licence for it ...
In this Issue: Michael Washington, Morten Nielsen, John Garland, Bil Simser, Adam Nathan, András Velvárt, WindowsPhoneGeek(-2-), Jesse Liberty(-2-), Martin Krüger, Damon Payne, and Xianzhong Zhu. Above the Fold: Silverlight: "Using ICustomTypeProvider in Silverlight 5" Damon Payne WP7: "Hardware Back Button + Marketplace Certification" Adam Nathan Lightswitch: "Deploy Your LightSwitch Application As A DotNetNuke Module" Michael Washington From SilverlightCream.com: Deploy Your LightSwitch Application ...
While I was away on a two week holiday in Morocco I notice that the Visual Studio team have dropped a very welcome SP1 refresh that means you can now play with the Async CTP with Visual Studio 2010 SP1. It also means you can program against ASP.NET MVC 3.0 and use the Aysnc CTP at the same time. Visual Studio Blog - SP1 refresh announcement - http://msdn.microsoft.com/e... Lucian Wischik's Blog - design changes - http://blogs.msdn.com/b/luc... ...
In this Issue: Dave Davis, Oren Gal, Colin Eberhardt, Dan Wahlin, Jeff Prosise(-2-), @yuriylsh, Bill Reiss, Richard Waddell, Andrea Boschin(-2-), András Velvárt. Above the Fold: Silverlight: "Working with User Names and Roles in Silverlight Applications" Dan Wahlin WP7: "Silverlight for Windows Phone Programming Tip #7" Jeff Prosise MIX11: "MIX11 Mass Download Tool" @yuriylsh From SilverlightCream.com: Controlling Silverlight Child Windows Using MVVM Dave Davis has a post up that revisits a subject ...
"A potentially dangerous Request.Form value was detected from the client" To avoid XSS attacks, ASP.NET's default behaviour is to throw a lovely yellow screen of death with that message. It's nice to be protected, but sometimes you want to accept potentially dangerous input, or maybe you just don't want to have that error splashed across the screen. The latter was the case for me recently, but I wasn't completely happy with the standard solution. The first part of the solution is telling ASP.NET ...
URL Routing is a very nice new feature in ASP.NET 4.0. And in Visual Studio everything works just great. But as soon as you start testing on IIS you get a "Error 404.0 - Not Found". To solve this you need to make sure that: you have set the Application Pool to "asp.net 4.0 application pool". Routing will not work with "asp.net 4.0 classic application pool". you add the following code to your web.config: <system.webServer> <modules runAllManagedModulesForAllR... <remove ...
Last week at MIX11, Preview 4 of WCF Web API was released. If you missed it, you can watch the video here. One way to get Preview 4 and start playing with it is to download it here. However, an even easier way to to just grab the bits from NuGet: When you download the latest Web API bits, there are a couple of sample applications that show off the latest features of the Web API (these are in the CodePlex download, not the NuGet packages). The first one is a Contact Manager “Simple” project which ...
UPDATED 6 JAN 14 In last days I Installed MVC 3 update in my PC. Today I got chance to take a look on MVC 3. I create a sample project and see a kind of problem “Nuget is not installed or out of date”. For those people who have trouble like this. Go to tools > Extensions > uninstall the Nuget and installed the Nuget again. Now it will work fine. This problem happen in VWD 2010 Express sp1. For people’s information MVC3 come pre-installed in 2012 and then removed in 2013. Don’t worry MVC 3 project ...
When user trying to install MVC 3 using Microsoft Web Platform Installer they got the message that MVC 3 and some other component also installed successfully but whenever in the condition you trying to open WPI again that they show you a option for adding all those component who you installed last time that means that they not installed successfully or error not occurred in WPI but actually occurred. So How i can install MVC 3 when i got error 1603 or whenever my system unable to run the setup or ...
UPDATED 13 January 2013 This post is written at a time of Visual studio 2010. In Visual studio When you compile your project You compile every project under the same solution. For make fast resolution you can compile only the project that you are working on now. Exclude the project from debug which you currently not working on. Here is some great discussion on SO http://stackoverflow.com/qu... ...
One of the greatest benefits I’ve found in simple web output in ASP.NET is the GridView. I regularly use it to display data from objects or databases where the output can simply be shown in a grid form (similar to instances where I would deliver a read-only spreadsheet). I attach the GridView to the <asp:PlaceHolder /> inside of a <form /> on the aspx page: A simple, bulk method of getting the data into the GridView is with the GridView.DataSource property. A GridView.DataSource must ...
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 ...
I have stepped it up a notch and am speaking at numerous user groups and technical conferences in the South East in the coming months. These include .NET & SharePoint user groups as well as SQL Saturday and SharePoint Saturday all day conferences. I will also be submitting to a couple of more regional events that I’m considering including Houston TechFest. If you are in the area, I’d love to have you come by to check out these events. Also, if you are interested in having me present at your event, ...
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 had a major problem this week with an MVC app. All of a sudden, all the styles and images stopped working. Man, I spent hours on this trying all sorts of stuff. I setup a new project and stuff worked. So what the heck is up. Then I started playing around one item at a time to figure out what was going on. Eventually I thought, hm, I was working on debugging routes. So lets try the global.asax file items. Well, a line of code was lurking there that I picked up from the route debugger sample (http://haacked.com/archive... ...
Here’s a quick start introduction to the ADO.NET Entity Framework Code First Development Pattern. For a more complete (but still intro) walkthrough, check out ScottGu’s blog. At the time of this writing, you’ll need the EF 4.1 Release Candidate. After EF 4.1 is released you’ll no doubt be able to find it on the ADO.NET team blog. 1. Create a new empty ASP.NET MVC2 Web Application, add a reference to System.Data.Entity. If using the EF4.1 RC - add a reference to the EntityFramework dll that comes ...