|
|
|
Related Articles
|
|
|
|
| |
AFP - A computer software to translate the Dutch-linked Afrikaans, one of South Africa's 11 official languages, has been developed by a South African firm, a statement said on Thursday. |
| |
|
| |
| |
AFP - A computer software to translate the Dutch-linked Afrikaans, one of South Africa's 11 official languages, has been developed by a South African firm, a statement said on Thursday. |
| |
|
| |
| |
This morning we released the Preview 3 build of the ASP.NET MVC framework. I blogged details last month about an interim source release we did that included many of the changes with this Preview 3 release. Today's build includes some additional features not in last month's drop, some nice enhancements/refinements, as well as Visual Studio tool integration and documentation. You can download an integrated ASP.NET MVC Preview 3 setup package here. You can also optionally download the ASP.NET MVC Preview 3 framework source code and framework unit tests here. Controller Action Method Changes ASP.NET MVC Preview 3 includes the MVC Controller changes we first discussed and previewed with the April MVC source release, along with some additional tweaks and adjustments. You can continue to write controller action methods that return void and encapsulate all of their logic within the action method. For example: which would render the below HTML when run: Preview 3 also now supports using an approach where you return an "ActionResult" object that indicates the result of the action method, and enables deferred execution of it. This allows much easier unit testing of actions (without requiring the need to mock anything). It also enables much cleaner composition and overall execution control flow. For example, we could use LINQ to SQL within our Browse action method to retrieve a sequence of Product objects from our database and indicate that we want to render a View of them. The code below will cause three pieces of "ViewData" to be passed to the view - "Title" and "CategoryName" string values, and a strongly typed sequence of products (passed as the ViewData.Model object): One advantage of using the above ActionResult approach is that it makes unit testing Controller actions really easy (no mocking required). Below is a unit test that verifies the behavior of our Browse action method above: We can then author a "Browse" ViewPage within the \Views\Products sub-directory to render a response using the ViewData populated by our Browse action: When we hit the /Products/Browse/Beverages URL we'll then get an HTML response like below (with the three usages of ViewData circled in red): Note that in addition to support a "ViewResult" response (for indicating that a View should be rendered), ASP.NET MVC Preview 3 also adds support for returning "JsonResult" (for AJAX JSON serialization scenarios), "ContentResult" (for streaming content without a View), as well as HttpRedirect and RedirectToAction/Route results. The overall ActionResult approach is extensible (allowing you to create your own result types), and overtime you'll see us add several more built-in result types. Improved HTML Helper Methods The HTML helper methods have been updated with ASP.NET MVC Preview 3. In addition to a bunch of bug fixes, they also include a number of nice usability improvements. Automatic Value Lookup With previous preview releases you needed to always explicitly pass in the value to render when calling the Html helpers. For example: to include a value within a <input type="text" value="some value"/> element you would write: The above code continues to work - although now you can also just write: The HTML helpers will now by default check both the ViewData dictionary and any Model object passed to the view for a ProductName key or property value to use. SelectList and MultiSelectList ViewModels New SelectList and MultiSelectList View-Model classes are now included that provide a cleaner way to populate HTML dropdowns and multi-select listboxes (and manage things like current selection, etc). One approach that can make form scenarios cleaner is to instantiate and setup these View-Model objects in a controller action, and then pass them in the ViewData dictionary to the View to format/render. For example, below I'm creating a SelectList view-model class over the set of unique category objects in our database. I'm indicating that I want to use the "CategoryID" property as the value of each item in the list, and the "CategoryName" as the display text. I'm also setting the list selection to the current CategoryId of the Product we are editing: Within our view we then just have to write the below code to indicate that we want to create a drop-downlist against the SelectList we put into ViewData: This will then render the appropriate drop down with items and selection for us at runtime: Built-in error validation support isn't included with our HTML helpers yet (you currently need to write code for this) - but will show up in the future, which will make form editing scenarios even easier. You'll also start to see ASP.NET AJAX helper methods show up in future preview releases as well, which will make it easier to integrate AJAX into MVC applications with a minimum of code. URL Routing Improvements ASP.NET MVC Preview 3 includes a number of improvements to the URL routing system. URL routing is one of the most "fundamental" components of a web MVC framework to get right, hence the reason we've spent a lot of focus the first few previews getting this area nailed. Our new URL routing engine will ship in .NET 3.5 SP1 this summer, and will support both Web Forms and MVC requests. ASP.NET MVC will be able to use the built-in .NET 3.5 SP1 routing engine when running on .NET 3.5 SP1. ASP.NET MVC will also include its own copy of the assembly so that it can also work on non-SP1 systems. Some of the URL Routing Improvements in the Preview 3 release include: MapRoute() and IgnoreRoute() helper methods ASP.NET MVC Preview 3 includes new "MapRoute" and "IgnoreRoute" helper methods that you can use to more easily register routing rules. MapRoute() provides an easy way to add a new MVC Route rule to the Routes collection. IgnoreRoute() provides an easy way to tell the URL routing system to stop processing certain URL patterns (for example: handler .axd resources in ASP.NET that are used to serve up JavaScript, images, etc). Below is an example of the default RegisterRoutes() method within Global.asax when you create a new ASP.NET MVC project where you can see both of these new helper methods in action. The MapRoute() helper method is overloaded and takes two, three or four parameters (route name, URL syntax, URL parameter default, and optional URL parameter regular expression constraints). You can call MapRoute() as many times as you want to register multiple named routes in the system. For example, in addition to the default convention rule, we could add a "Products-Browse" named routing rule like below: We can then refer to this "Products-Browse" rule explicitly within our Controllers and Views when we want to generate a URL to it. For example, we could use the Html.RouteLink view helper to indicate that we want to link to our "Products-Browse" route and pass it a "Food" category parameter using code in our view template like below: This view helper would then access the routing system and output an appropriate HTML hyperlink URL like below (note: how it did automatic parameter substitution of the category parameter into the URL using the route rule): We could alternatively use the new Url.RouteUrl(routeName, values) within views if we wanted to just retrieve the URL for a named route (and not output the <a> html element). We could also use the new RedirectToRoute(routeName, values) helper method on the Controller base class to issues browser redirects based on named routing rules. Richer URL Route Mapping Features ASP.NET MVC Preview 3 also supports a bunch of new URL route mapping features. You can now include "-", ".", ";" or any other characters you want as part of your route rules. For example, using a "-" separator you can now parse the language and locale values from your URLs separately using a rule like below: This would pass appropriate "language", "locale", and "category" parameters to a ProductsController.Browse action method when invoked: URL Route Rule Example URL Parameters Passed to Action method {language}-{locale}/products/browse/{category} /en-us/products/browse/food language=en, locale=us, category=food /en-uk/products/browse/food language=en, locale=uk, category=food Or you can use the "." file extension type at the end of a URL to determine whether to render back the result in either a XML or HTML format: This would pass both "category" and a "format" parameters to the ProductsController.Browse action method when invoked: URL Route Rule Example URL Parameters Passed to Action method products/browse/{category}.{format} /products/browse/food.xml category=food, format=xml /products/browse/food.html category=food, format=html ASP.NET MVC Preview 3 also supports wildcard route rules (these were also in Preview 2). For example, you can indicate in a rule to pass all remaining URI content on as a named parameter to an action method: This would pass a "contentUrl" parameter to the WikiController.DisplayPage action method when invoked: URL Route Rule Example URL Parameters Passed to Action method Wiki/Pages/{*contentUrl} /Wiki/Pages/People/Scott contentUrl="People/Scott" /Wiki/Pages/Countries/UK contentUrl="Countries/UK" These wildcard routes are very useful to look at if you are building a blogging, wiki, cms or other content based system. Summary Today's Preview 3 release of ASP.NET MVC includes a bunch of improvements and refinements. We are starting to feel good about the URL routing and Controller/Action programming model of MVC, and feel that those areas are starting to bake really well. In future preview releases you'll start to see more improvements higher-up the programming model stack in areas like Views (html helpers, validation helpers, etc), AJAX, sub-controllers and site composition, deeper Login, Authentication, Authorization and Caching integration, as well as data scaffolding support. I also have a (very) long tutorial post that I started putting together this past weekend that walks-through building an application using ASP.NET MVC Preview 3 that I'm hoping to wrap up and post in the next few days. This should provide both a good intro to ASP.NET MVC, as well as help provide some context on how all the pieces fit together if you are interested in using the ASP.NET MVC option. Hope this helps, Scott |
| |
|
| |
| |
Apologies for the sparseness of my posting the last few weeks - work and life have been busy here lately. Below is a new post in my link-listing series to help kick things up a little. Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past. ASP.NET Bulk Inserting Data with the ListView Control: Matt Berseth continues his awesome posts with one that shows how to handle bulk-editing of data using the ASP.NET ListView control in .NET 3.5. Master-Detail with the GridView, DetailsView, and ModalPopup Controls: Another great post from Matt that describes how to cleanly handle a common data entry scenario. Creating Great Thumbnail Images in ASP.NET: A really nice blog post by a different Matt that details an approach that generates high quality (and small) thumbnail images. Warning the User when Caps-Lock is on: Scott Mitchell has a nice article that describes how to automatically detect and warn users in login pages when the caps-lock button is on. ASP.NET Perf Issue: Large numbers of application-restarts due to virus scanners: Tess Ferrandez has a great post that details a debug session to determine why an ASP.NET application was restarting frequently (causing performance slowdowns). The issue was a virus scanner that was causing files to be constantly updated. Make sure to check out the logging code you can add to your application to identify restart causes like this. ASP.NET AJAX ASP.NET AJAX Progress Bar Control: Matt Berseth has another great article that describes his new ASP.NET AJAX Progress Bar control. Faster Page Loading By Combining Multiple JavaScript files in Batch: Omar Al Zabir (founder of PageFlakes.com and author of the great Building a Web 2.0 Portal with ASP.NET 3.5 book) has a good article that describes the performance benefit of merging multiple JavaScript file downloads. Note that .NET 3.5 SP1 will include a new script combiner feature that helps make doing this even easier. Create ASP.NET AJAX Server Controls using the ScriptControl base class: Chris Pietschmann has a nice article that talks about how to build new ASP.NET AJAX server controls by deriving from the built-in ScriptControl base class. Inline Edit Box and Postback Ritalin Beta: Dave Ward and Mike Davis have created a new CodePlex project for their popular Inline Edit Box and PostBack Ritalin ASP.NET AJAX controls. .NET 7 Ways to Simplify your code with LINQ: Igor Ostrovsky has a great blog post that talks about new code techniques you can use to improve your code using .NET 3.5 and the new language and LINQ features in it. Visual LINQ Query Builder for LINQ to SQL: Mitsu Furuta has created a cool Visual Studio designer that allows you to graphically construct LINQ to SQL queries. Also make sure to download download the latest LINQPad utility - which is invaluable for learning LINQ and trying out LINQ queries. DataContracts without Attributes (POCO support): Aaron Skonnard has a good post that talks about a nice usability change with .NET 3.5 SP1 that allows you to serialize POCO (plain old objects) using the WCF serializers. Ukadc.Diagnostics: Josh Twist pointed me at a new CodePlex project he is working on that extends the System.Diagnostics features in .NET to include richer logging features (SQL trace support, email support, etc). Visual Studio 11 More VS Short Cuts you Should Know: A great post that talks about a bunch of useful shortcuts to print out and remember when using Visual Studio. Did you know you can show extension methods in the object browser?: Sara Ford continues her excellent "Did you know" series. I confess I didn't know this one. Silverlight 50 New Silverlight 2 Beta 1 Screencasts: Mike Taulty and Mike Ormond have put together 50 nice tutorial screen-casts that cover Silverlight 2 - all in their "spare time". Wow. AutoComplete for Silverlight TextBoxes: Nikhil Kothari has a nice blog post that demonstrates how he built an auto-complete behavior control for Silverlight. Scrolling through Large Resultsets with Silverlight 2 and LINQ to SQL: The Swiss MSDN team has a nice blog post that demonstrates how to scroll through large resultsets using the Silverlight DataGrid and LINQ to SQL. IValueConverter: The Swiss Army Knife of Bindings: David Anson has a useful blog post and sample that demonstrates how to use the IValueConverter feature in Silverlight and WPF to support richer bindings against complex objects. Silverlight 2 Pie Chart: Peter McGrattan has posted a nice control and article that demonstrates how to use a new Silverlight charting control he has written. WPF WPF week on Channel9: Watch 6 great videos on Channel9. Each one includes interviews and demos with members of the WPF team talking about some of the awesome work that went into WPF 3.5 SP1 (read my blog post here for a summary of some of it). WPF Testing and Application Quality Guide: Check out the 0.2 release of a free online book being developed by Microsoft that covers how to test WPF applications. Definitely worth book-marking if you are doing WPF development. Moving Toward WPF Data Binding One Step at a Time: Josh Smith has a great article on CodeProject.com that explains WPF data binding and walksthrough how to use it. WPF 3.5 SP1 StringFormat: Lester has a nice post that describes how to use the new StringFormat feature in WPF 3.5 SP1. This makes it much easier to handle formatting of databound values. Hope this helps, Scott |
| |
|
| |
| |
One of the things I like to track are book sales on Amazon.com, which provides a useful data point to monitor what developers are interested in on any given day. I use the www.TitleZ.com site (which is built using ASP.NET) to track specific titles I want to watch - it then generates a report showing real-time Amazon sales ranking data, as well as 7 day, 30 day and 90 day sales ranking averages. This morning I pulled up my report and saw the usual books near the top of my list, and was about to navigate away when I noticed the eye-popping amazon ranking of the top book -"Professional ASP.NET 3.5: In C# and VB" by Bill Evjen, Scott Hanselman and Devin Rader. Its Amazon sales rank was a stunning #95 (of all books on Amazon), which meant it was outselling even Harry Potter (which is pretty much unheard of for any technology book). It turns out that Amazon is holding a special price promotion for a short time on a few books - and this was one that was selected. Instead of the usual $54 price, you can buy it for a short time for a ridiculous $16.49. I'm not sure how long this promotion will last - but if you are looking for a great ASP.NET 3.5 book this might be something you might want to take advantage of: The book is a great ASP.NET 3.5 book and an excellent end to end resource. It has been on the best seller list for programming books since it came out in March (usually in the top 5 of all programming titles), and has received glowing reviews (I posted a review of it on Amazon a few weeks ago and gave it 5 stars). If you are in the market for a good ASP.NET book, you might want to consider taking Amazon up on this offer before it closes (and apologies in advance if the price changes before you read this). Hope this helps, Scott P.S. If you are looking for other good .NET 3.5 and VS 2008 books - I also recommend: C# 3.0 In a Nutshell, LINQ in Action, and Pro LINQ: Language Integrated Query in C# 2008 (all of which average a 5 star rating on Amazon). |
| |
|
| |
| |
We recently opened up a new ASP.NET CodePlex Project that we will be using to provide previews (with buildable source code) for several upcoming ASP.NET features and releases. Last month we used it to publish the first drop of the ASP.NET MVC source code. This first drop included the source for the ASP.NET MVC Preview 2 release that we shipped at MIX, along with Visual Studio project files to enable you to patch and build it yourself. A few hours ago we published a refresh of the ASP.NET MVC source code on the site. This source refresh is not an official new ASP.NET MVC preview release - instead it is an interim drop that provides a look at the current state of the source tree. We will ship the official "ASP.NET MVC Preview 3" release in a few weeks after we finish up some more work (more features and tweaks to existing ones, better VS tool integration, VS express edition support, documentation, etc). If you are someone who wants a hassle-free installation of ASP.NET MVC to use that ships with documentation and full tool support you'll probably want to wait for this official preview release. If you are someone who wants a chance to see an early "preview of the preview" and have the opportunity to start using and giving feedback on some of the features immediately, today's source refresh is probably interesting to look at. Improvements with this ASP.NET MVC Source Refresh This week's update (which you can download here) includes a number of improvements to ASP.NET MVC. Some of these include: In addition to posting the source code for the ASP.NET MVC framework, we are also posting the source code for the unit tests that we use to test it. These tests are implemented using MSTest and the open source Moq mocking framework. A VS 2008 project file for the unit tests is included to make it easy to build and run them locally within your VS 2008 IDE. Significantly easier support for testing Controller classes. You can now unit test common Controller scenarios without having to mock any objects (more details on how this works below). Several nice feature additions and usability improvements to the URL routing system (more details below). Creating a New ASP.NET MVC Project You can build your own copy of the ASP.NET MVC assemblies by downloading the MVC source and compiling it locally, or alternatively you can download a VS Template package to get a pre-built version of them along with a Visual Studio project template that you can use to quickly build a new ASP.NET MVC Project that uses the latest bits. After you install the ASP.NET MVC source refresh .VSI template, a new "ASP.NET MVC Application" project template will show up under the "My Templates" section of your "New Project" dialog: This new "My Templates" version of the MVC project template lives side-by-side with the previous ASP.NET MVC Preview 2 release (which you can see above it in the main project templates section of the dialog). This allows you to safely create new projects and and use both the latest source version and the last official preview version on the same machine. When you create a new project using this updated ASP.NET MVC Project template you'll by default get a project that looks like below: This new project solution contains one Controller ("HomeController") under the "\Controllers" directory and two View templates ("About" and "Index") under the "\Views\Home" sub-directory. Both view templates are based on a common master page for the site ("Site.master"), all of whose styles are defined within a "Site.css" file under the "\Content" directory. When you run the application the built-in web-server will automatically start up and you'll see the site's "Home" content: Clicking the "About us" tab will then display the "About" content: The "HomeController" class in the project is responsible for handling both of the URLs above and has two action methods like below: The default "Site.master" template looks for a "Title" value in the ViewData collection and uses it to render the <title> element of the HTML page. The default "Index" view template looks for a "Message" value and uses it to render the home page's welcome message. You can obviously go in and customize these files however you want. Controller Changes with this ASP.NET MVC Drop If you were reading the above code closely you might have noticed a few changes with how Controller classes are by default implemented using this new ASP.NET MVC source refresh drop. With the ASP.NET MVC Preview 2 release the above HomeController action methods would have instead been implemented like below: The MVC feature team is experimenting with a few ideas in this week's drop and are trying out some new ideas: Action methods on Controllers now by default return an "ActionResult" object (instead of void). This ActionResult object indicates the result from an action (a view to render, a URL to redirect to, another action/route to execute, etc). The RenderView(), RedirectToAction(), and Redirect() helper methods on the Controller base class now return typed ActionResult objects (which you can further manipulate or return back from action methods). The RenderView() helper method can now be called without having to explicitly pass in the name of the view template to render. When you omit the template name the RenderView() method will by default use the name of the action method as the name of the view template to render. So calling "RenderView()" with no parameters inside the "About()" action method is now the same as explicitly writing "RenderView('About')". It is pretty easy to update existing Controller classes built with Preview 2 to use this new pattern (just change void to ActionResult and add a return statement in front of any RenderView or RedirectToAction helper method calls). Returning ActionResult Objects from Action Methods So why change Controller action methods to return ActionResult objects by default instead of returning void? A number of other popular Web-MVC frameworks use the return object approach (including Django, Tapestry and others), and we found for ASP.NET MVC that it brought a few nice benefits: It enables much cleaner and easier unit testing support for Controllers. You no longer have to mock out methods on the Response object or ViewEngine objects in order to unit test the response behavior of action methods. Instead, you can simply assert conditions using the ActionResult object returned from calling the Action method within your unit test (see next section below). It can make Controller logic flow intentions a little clearer and more explicit in scenarios where there might be two different outcomes depending on some condition (for example: redirect if condition A is true, otherwise render a view template it is false). This can make non-trivial controller action method code easier to read and follow. It enables some nice composition scenarios where a FilterActionAttribute can take the result of an action method and modify/transform it before executing it. For example: a "Browse" action on a ProductCatalog controller might return an RenderActionResult that indicates it wants to render a "List" view of products. A FilterActionAttribute declaratively set on the controller class could then have a chance to customize the specific "List" view template rendered to be either List-html.aspx or List-xml.aspx depending on the preferred MIME type of the client. Multiple FilterActionAttributes can also optionally be chained together to flow the results from one to another. It provides a nice extensibility mechanism for people (including ourselves) to add additional features in the future. New ActionResult types can be easily created by sub-classing the ActionResult base class and overriding the "ExecuteResult" method. It would be easy to create a "RenderFile()" helper method, for example, that a developer writing an action could call to return a new "FileActionResult" object. It will enable some nice Asynchronous execution scenarios in the future. Action methods will be able to return an AsyncActionResult object which indicates that they are waiting on a network operation and want to yield back the worker thread so that ASP.NET can use it to execute another request until the network call completes. This will enable developers to avoid blocking threads on a server, and support very efficient and scalable code. One of the goals with this interim preview is to give people a chance to play around with this new approach and do real-world app-building and learning with it. We will also post an alternative Controller base class sample that you can use if you still prefer the previous "void" action return approach. We deliberately didn't include this alternative Controller base class in this source refresh drop, though, because we want to encourage folks to give the "ActionResult" return approach a try and send us their app-building feedback on it. How To Unit Test Controller Action Methods I mentioned above that the new ActionResult approach can make unit testing controllers much easier (and avoid the need to use mocking for common scenarios). Let's walk through an example of this in action. Consider the simple NumberController class below: This Controller class has an "IsEvenNumber" action method that takes a number as a URL argument. The IsEvenNumber action method first checks whether the number is negative - in which case it redirects the user to an error page. If it is a positive number it determines whether the number is even or odd, and renders a view template that displays an appropriate message: Writing unit tests for our "IsEvenNumber" action method is pretty easy thanks to the new ActionResult approach. Below is an example unit test that verifies that the correct Http redirect occurs when a negative number is supplied (for example: /Number/IsEvenNumber/-1): Notice above how we did not need to mock any objects to test our action method. Instead we simply instantiated the NumberController class and called the action method directly (passing in a negative number) and assigned the return value to a local "result" variable. I used the C# "as type" syntax above to cast the "result" variable as a strongly typed "HttpRedirectResult" type. What is nice about the C# "as" keyword is that it will assign the value as null instead of throwing an exception if the cast fails (for example: if the action method returned a RenderViewResult instead). This means I can easily add an assertion check in my test to verify that the result is not null in order to verify that an Http redirect happened. I can then add a second assertion check to verify that the correct redirect URL was specified. Testing the scenarios where non-zero numbers are passed in is also easy. To do this we'll create two test methods - one testing even numbers and one testing odd numbers. In both tests we'll assert that a RenderViewResult was returned, and then verify that the correct "Message" string was passed within the ViewData associated with the view: We can then right click on our NumberControllerTest class inside VS 2008 and choose the "Run Tests" menu item: This will execute our three unit tests in-memory (no web-server required) and report back on whether our NumberController.IsEvenNumber() action method is performing the right behavior: Note: with this week's source drop you still need to use mocking to test the TempData property on Controllers. Our plan is to not require mocking to test this with the ASP.NET MVC Preview 3 drop in a few weeks. MapRoute Helper Method URL routing rules within ASP.NET MVC applications are typically declared within the "RegisterRoutes" method of the Global.asax class. With ASP.NET MVC Previews 1 and 2 routes were added to the routes collection by instantiating a Route object directly, wiring it up to a MvcRouteHandler class, and then by setting the appropriate properties on it to declare the route rules: The above code will continue to work going forward. However, you can also now take advantage of the new "MapRoute" helper method which provides a much simpler syntax to-do the same thing. Below is the convention-based URL route configured by default when you create a new ASP.NET MVC project (which replaces the code above): The MapRoute() helper method is overloaded and takes two, three or four parameters (route name, URL syntax, URL parameter default, and URL parameter regular expression constraints). You can call MapRoute() as many times as you want to register multiple named routes in the system. For example, in addition to the default convention rule, we could add a "Products-Browse" named routing rule like below: We can then refer to this "Products-Browse" rule explicitly within our Controllers and Views when we want to generate a URL to it. For example, we could use the Html.RouteLink view helper to indicate that we want to link to our "Products-Browse" route and pass it a "Food" category parameter using code in our view template like below: This view helper would then access the routing system and output an appropriate HTML hyperlink URL like below (note: how it did automatic parameter substitution of the category parameter into the URL using the route rule): Note: with this week's source drop you need to pass-in the controller and action parameters (in addition to the Category param) to the Html.RouteLink() helper to resolve the correct route URL to generate. The ASP.NET MVC Preview 3 drop in a few weeks will not require this, and allow you to use the Html.RouteLink call exactly as I've written it above to resolve the route. Other URL Route Mapping Features This week's MVC source drop also supports a bunch of new URL route mapping features. You can now include "-", ".", ";" or any other characters you want as part of your route rules. For example, using a "-" separator you can now parse the language and locale values from your URLs separately using a rule like below: This would pass appropriate "language", "locale", and "category" parameters to the ProductsController.Browse action method when invoked: URL Route Rule Example URL Parameters Passed to Action method {language}-{locale}/products/browse/{category} /en-us/products/browse/food language=en, locale=us, category=food /en-uk/products/browse/food language=en, locale=uk, category=food Or you can use the "." file extension type at the end of a URL to determine whether to render back the result in either a XML or HTML format: This would pass both "category" and a "format" parameters to the ProductsController.Browse action method when invoked: URL Route Rule Example URL Parameters Passed to Action method products/browse/{category}.{format} /products/browse/food.xml category=food, format=xml /products/browse/food.html category=food, format=html ASP.NET MVC Preview 2 introduced wildcard route rules. For example, you can indicate in a rule to pass all remaining URI content on as a named parameter to an action method: This would pass a "contentUrl" parameter to the WikiController.DisplayPage action method when invoked: URL Route Rule Example URL Parameters Passed to Action method Wiki/Pages/{*contentUrl} /Wiki/Pages/People/Scott contentUrl="People/Scott" /Wiki/Pages/Countries/UK contentUrl="Countries/UK" These wildcard routes continue to work fine with this week's preview - and are very useful to look at if you are building a blogging, wiki, cms or other content based system. Note that in addition to using the new routing system for ASP.NET MVC scenarios, we are also now using the same routing system within ASP.NET Dynamic Data (which uses ASP.NET Web Forms). Summary Hopefully the above post provides a quick update on some of the new features and changes exposed with this week's ASP.NET MVC source update drop. You can download it here if you want to start using it immediately. Alternatively, you can wait a few weeks for the official ASP.NET MVC Preview 3 drop - which will have some more features (and incorporate feedback people provide on this week's drop), deliver a more seamless installer, provide nice VS integration, and deliver up to date documentation. For any questions/issues with this week's drop of ASP.NET MVC, make sure to also check out the ASP.NET MVC forum on www.asp.net. Hope this helps, Scott |
| |
|
| |
| |
The timetable for launching a new Welsh language daily newspaper is put "under review". |
| |
|
| |
| |
Fabio Trabocchi’s dishes on Fiamma’s new menu are a road map to rich and saucy decadence. |
| |
|
| |
| |
|
| |
|
| |
| |
Java Developer, Scientist, Graduate Java Developer, Java Engineer
Job Title: Java Developer, Scientist, Graduate Java Developer, Java Engineer
Based: London
Salary: £35,000
Benefits: Bonus dependent on performance, health insurance, pension plan
Essential
PhD in field of complex systems, computer science, applied mathematics, economics or statistics
Experienced with Java programming and a solid understanding of Object Orientation
Knowledge of agent-based modelling, dynamic scheduling, simulation, optimisation, data mining, learning heuristics or decision support systems.
Desirable
Design Patterns
XML
UML
Unit Testing
Fluency in a European Language
You have the opportunity to work in part of a highly intellectual team of developers and on your own in what is a challenging and fast-paced environment, commercialising the science of complexity and complex adaptive systems through market driven software products. If you have experience with decision support tools combining powerful complexity-science based techniques such as Agent-based modelling, dynamic scheduling, simulations, optimisation, data mining, or Learning Heuristics, then your CV will be of particular interest.
Buzzwords: Java, Object-Oriented, Object Orientation, OOA/OOP/OOD, UML, XML, Unit Testing, Design Patterns, Agent-based modelling, optimisation, dynamic scheduling, Learning Heuristics, simulation
About Idealpeople
Idealpeople exist to align industry specialists with client expectations. We’re recruitment experts in the IT, Communications, e-business and New Media Sectors in the UK and Internationally.
Contact
Dominic.spinelli@idealpeople.net
Dominic Spinelli: 01908 565910
Idealpeople are acting as an employment agency in relation to this vacancy.
Find Top Tips for Job Hunters and Hirers at the [a href="www.idealpeopleblog.com"]Idealpeople blog[/a]
Take a look at all of Idealpeople's vacancies at [a href="www.idealpeople.net"]www.idealpeople.net[/a] |
| |
|
| |
|
|
Related Companies
|
| |
|
|
|