ASP.NET MVC 2 cookbook : over 70 clear and incredibly by Andrew Siemer; Richard Kimber

By Andrew Siemer; Richard Kimber

Show description

Read or Download ASP.NET MVC 2 cookbook : over 70 clear and incredibly effective recipes to get the most out of the many tools and features of the ASP.NET MVC framework PDF

Similar programming: programming languages books

Oracle InterMedia Java Classes. User's Guide and Reference

This consultant describes the best way to use Oracle interMedia Java periods. This consultant is for builders or database directors who're attracted to storing, retrieving, and manipulating multimedia facts in an Oracle database, together with builders of multimedia specialization purposes. clients of this consultant must have adventure with Java and JDBC.

Developing Applications with Java(TM) and UML

Constructing functions with Java™ and UML specializes in the craft of constructing caliber Java software program. The booklet introduces the basics of the Unified Modeling Language (UML) and demonstrates the right way to use this usual object-oriented notation to construct extra powerful Java functions that satisfy clients' requisites and stand the attempt of time.

Additional info for ASP.NET MVC 2 cookbook : over 70 clear and incredibly effective recipes to get the most out of the many tools and features of the ASP.NET MVC framework

Example text

NET libraries in the dependencies folder. Then add a reference to it from your project. 2. Then open up your HomeController. Add an action called ProductJson. This method will generate some JSON for you, using your existing Product and Category data. Then enter the following code (notice that this is almost identical to the previous recipes except for the highlighted JsonConvert call). SerializeObject(pv); return View(); } 41 Working with the View 3. Now you need to add a new view in the Views/Home folder that this action will pass its data down to.

For the most part, the logic is the same as our other recipes, in that we used NBuilder to generate some fake data for us. Instead of passing that generated data directly down to our view though, we used some jQuery functions to request the data after the client's Product view page loaded. We used the getJSON method that takes the URL of the JSON and a callback method to perform operations on the result of the method call. In this case, our callback was defined directly in the initial function call.

For that reason we need to have a way to pass in the text when we call on the services of our CAPTCHA generator. cs: public string _captchaText; public CaptchaResult(string captchaText) { _captchaText = captchaText; } 4. Now we are ready to create the ExecuteResult method to fulfill our contract with the inherited ActionResult. This is a two-part process. First we need to create an instance of our Captcha class and define a few properties. Then we can save the generated image into the response stream to the browser.

Download PDF sample

Rated 4.61 of 5 – based on 28 votes