Tag Archives: web development

MVC 6: Your Web Development World is About to Get Rocked!

If you missed the live-stream of our latest webinar on 7/22/2015, never fear! Check out the link below to get yourself up to speed with MVC 6. The webinar is led by instructor and skijoring enthusiast, Don Kiely, and I should warn you in advance …it will rock your world!

For years, Microsoft did its best in battling rapid changes with the Internet to keep its ASP.NET and MVC technology up to speed. However; it’s been nearly 15 years since ASP.NET first hit the web, and those changes simply became too dramatic to overcome.

Enter Visual Studio 2015, Microsoft’s way of throwing out the “old ASP.NET manual” and rebuilding things from the ground up. Visual Studio 2015 was released on 7/20/2015, along with the .NET Framework 4.6 and updated web development tools. With MVC being part of ASP.NET, it has strapped itself in and come along for the update adventure!

This massive update now sees MVC boasting new features like broad support for new web technologies, as well as editor updates for JSON, HTML, and JavaScript. It will also now be much easier and more fun (!) to write robust web applications thanks to tools like HTML5 and CSS.

So this is a big deal?

Absolutely! Not only is the jump from ASP.NET to ASP.NET 5 as significant as switching from Classic ASP to ASP.NET was, but this bad boy is also open source! MVC, Web API, and Web Pages have been combined into a single unified open source programming model, which is hosted on GitHub. There are new tag helpers, view components, simpler dependency management, dependency injection, and more!

As you can see, there is suddenly a lot of stuff to learn about the all new Visual Studio 2015. With our new webinar, you will get a high level look at the newest MVC 6 and ASP.NET 5 features, as well as a jumpstart on building web applications using the new Microsoft stack. Instructor Don Kiely will walk you through these new and exciting changes and features, and have you ready to be a Visual Studio superstar in no time.

Check out the link below (it’s free)…just be sure to turn the volume up to eleven!

http://www.learnnowonline.com/webinars

NOTE: Both MVC 6 and ASP.NET 5 are included with this release; however, you cannot yet use them for production purposes.

The RC1 (release candidate 1) for ASP.NET 5 is slated for release in November 2015, which will have a “Go Live License”. This “Go Live License” indicates that Microsoft is ready to fully support ASP.NET 5 and MVC 6 and that they are confident that users will be able to use the technologies for production applications.

A helpful roadmap of release dates can be viewed here:

https://github.com/aspnet/Home/wiki/Roadmap

About the Author:


zach2-300x225Zach Young
 manages the LearnNowOnline customer support department. In addition to making strange but surprisingly delicious smoothies, Zach divides his time between the LearnNowOnline recording studio, providing sales demos for new and existing clients, and ensuring that each customer is taken care of. In his spare time, Zach enjoys globetrotting with his wife, playing and recording music, and attempting to get the required 1.21 gigawatts for Doc Brown’s DeLorean.

 

Distribution & Monetization: 2 Areas Where HMTL5 May Overtake Native Apps

url1

Many technologists predict that HTML5 will be the future of the Web since it allows developers to create Web-based apps that can run on any type of device via a standard browser. And it’s hard to argue with that kind of promise.

But the IT world is littered with countless examples of technologies whose hype never matched reality. All of this is why a recent report from Business Intelligence is so important – it provides a compelling, fact-based case for a future where HTML5 dominates. Programmers and job-seekers owe it to themselves to give it a read (and then promptly sign up for an HTML5 tutorial.)

The reports cites four areas where the HTML5 vs. native-apps challenge is particularly acute. Today we’ll like to address the first two.

First, distribution. HTML5 is distributed through the open Web, not via controlled app stores (think the Apple Store or Google Play.) In a future that’s increasingly open, that’s a huge advantage. Secondly, the concept of monetization. Native apps have one-click buying options directly built into them. Technologists, however, envision that HTML5 apps will generate traditional revenue producing. If not handled properly, this aspect may backfire with users who generally do not like intrusive online advertising.

But there’s more – in our next installment we’ll look at two additional areas where HTML5 is poised to make further inroads in Web development.


 

(function(){
var s=’hubspotutk’,r,c=((r=new RegExp(‘(^|; )’+s+’=([^;]*)’).exec(document.cookie))?r[2]:”),w=window;w[s]=w[s]||c,
hsjs=document.createElement(“script”),el=document.getElementById(“hs-cta-c6aa8857-3e7e-4761-a672-02016ac3851d”);
hsjs.type = “text/javascript”;hsjs.async = true;
hsjs.src = “//cta-service-cms2.hubspot.com/cs/loader.js?pg=c6aa8857-3e7e-4761-a672-02016ac3851d&pid=153597&hsutk=” + encodeURIComponent(c);
(document.getElementsByTagName(“head”)[0]||document.getElementsByTagName(“body”)[0]).appendChild(hsjs);
try{el.style.visibility=”hidden”;}catch(err){}
setTimeout(function() {try{el.style.visibility=”visible”;}catch(err){}}, 2500);
})();

 

HTML5: A Dream Come True for Today’s Web Developers – And Here’s Why

site_title.png.pagespeed.ce.zzya4xgl2w

Recently we looked at how HTML5 is the language of the future given its compatibility with mobile devices and ease of use. But before you check out our HTML5 tutorial, it’s important to first understand the benefits and drawbacks to the language. And that’s because, like any language, if you’re starting from scratch, the learning curve may be a bit steeper.

On one side, HTML5 can provide tremendous power for the experienced Web developer. For example, it is now possible to execute multiple processes in background threads for intense processing and network requests.

On the other, developers new to HTML5 can also find advantages like being able to embed video without having to employ third-party plug-ins. HTML5 will not affect the loading time of a Web page so there’s no reason not to start upgrading. These are just a few of the language’s benefits, which, once again, explains why it’s so popular with Web developers.

It’s also why, according to Forrester Research, almost 75 percent of North American internet users surf the Web on HTML5-compatible browsers!


 

(function(){
var s=’hubspotutk’,r,c=((r=new RegExp(‘(^|; )’+s+’=([^;]*)’).exec(document.cookie))?r[2]:”),w=window;w[s]=w[s]||c,
hsjs=document.createElement(“script”),el=document.getElementById(“hs-cta-c6aa8857-3e7e-4761-a672-02016ac3851d”);
hsjs.type = “text/javascript”;hsjs.async = true;
hsjs.src = “//cta-service-cms2.hubspot.com/cs/loader.js?pg=c6aa8857-3e7e-4761-a672-02016ac3851d&pid=153597&hsutk=” + encodeURIComponent(c);
(document.getElementsByTagName(“head”)[0]||document.getElementsByTagName(“body”)[0]).appendChild(hsjs);
try{el.style.visibility=”hidden”;}catch(err){}
setTimeout(function() {try{el.style.visibility=”visible”;}catch(err){}}, 2500);
})();

 

Learn and Grow with Time for Dinner

When you have a family, it seems like there is really no good time to study. If you are taking courses at night or on the weekends, at a local Instructor led Training Company or college, for example, you run the risk of missing out on important family functions, school activities, and even just evening meals together. Learning new skills, especially those related to technology and the workplace, can give you a major leg up in your corporation. However, the time required to attend classes can leave you feeling guilty and stressed about what is not getting done at home.

An online HTML5 tutorial or online C#.net courses can help circumnavigate many of these issues. By taking courses online, you can choose the when, where, and duration of your learning/studying time. The flexibility of choosing your own “classroom” time means that you can truly focus when you sit down to study, rather than wondering what is going on at home. You can learn a new skill or program, increase your value at work, and still tuck your kids into bed at night. That’s a win-win for everyone.

Feel the Power of Web Design

Screen Shot 2012-10-18 at 2.34.12 PM

 

Knowledge is power and nowhere is this more apparent than in the world of web design. Having a strong, attractive, informative online presence can mean the difference between business success and failure, and companies will pay very well for someone to design a functional website for them. Knowing how to harness the potential of the internet with regards to website design, can increase your value at your current job, or provide a steady source of additional income.

If you are interested in adding web design skills to your portfolio, it would be wise to begin with an HTML5 tutorial. The latest version of HTML, HTML5 allows for even more flexibility in design and functionality. Combine your online HTML5 training with a C# video course, for example, and you will have an amazing combination of web design, and programming and networking skills, that will be useful no matter where you work. Knowledge really is power, so go forth, and become more powerful.

Pulling Out the Big Gun: The Ajax Method

Screen Shot 2012-10-18 at 11.46.55 AM

 

All of the Ajax features in jQuery are convenience methods that make using Ajax fairly easy for the most common scenarios. But when those convenience methods don’t work for you, you can pull out the big Ajax gun in jQuery: the ajax method. This is the method that all of the convenience methods ultimately use to make the actual call to the server. They do this by performing all the setup necessary and setting default values for various arguments that work for the particular Ajax task at hand.

You can make use of the ajax method directly to handle the scenarios not easily handled—or not handled at all—by the convenience methods. It has the deceptively simple syntaxes shown in the following code, taking just one or two arguments, url and options. With the first syntax option, you can pass the URL for the Web service and optionally follow it with as many option settings as you need. Or you can just pass a value for the options argument, one of which could be the url. This method is the embodiment of the saying that the devil is in the details, and providing the right options for what you want to do is the details you need to wade through to make the method work for you.

Let’s look at a simple example of using the ajax method by rewriting the ‘Hello World’ sample below. Here is the code from that sample:

The HelloWorldAjax.html page in the sample project uses the ajax method directly to make the Ajax call to the server. It uses the type option to make a GET call and the url option to specify the location of the Web service. Like the get and post methods, the ajax method is a utility function that doesn’t directly update a matched set of elements, so the method call uses the success event option to define a function to update the div elements on the page with the response text. This anonymous function uses the text method of the response object to extract the text from the XML returned from the Web service method and the html method to update the div elements.

The figure below shows the results of clicking the Get Info button on the page, where the code updates the three div elements on the page.

As you can see, using the ajax method is more complex than using the load method, both because you have to provide appropriate option values as well as because the method doesn’t directly update a matched set of elements. You have to write a function for the success event to update the page.

ldn-expertdkielyThis post is an excerpt from the online courseware for our ASP.NET 4.0 AJAX and jQuery Using Visual C# 2010 course written by expert Don Kiely.

AJAX: The Technology that Saved the Web

ajax-jquery

 

Many people see Ajax as the technology that saved the Web, that made it possible to create much richer Web 2.0 applications than was ever possible using just HTML and plain old JavaScript. Part of the key to Ajax’s success is that it uses standards-based, widely implemented technologies instead of proprietary tools like Flash, Air, Silverlight, and many others. All modern browsers have an implementation of JavaScript and include the key object used to make asynchronous calls to the server, XmlHttpRequest (XHR).

Ajax is a powerful Web technology because it makes pages far more interactive to the user, performing actions and updating parts of the page with data from the Web server without requiring a full page refresh and accompanying flash of a blank page. This is one of the biggest visual differences between a regular Web application and a rich client application, and gives the illusion of running on the client machine even though it is in a browser. An Ajax page feels faster to the user and reduces the load on the server by requiring small chunks of data and HTML rather than the content of full pages on every user action. Ajax is inherently asynchronous, so it leaves the user interface responsive to the user even if the last operation takes a while to complete.

Updating a Web Page Using Ajax

Using Ajax to call a Web service on the server is one of the best ways to dynamically update part of a Web page using Ajax. You can request only the data you need to save bandwidth and thereby get the best performance, and you can do anything you want in the Web service to retrieve data. You can read files, hit a database, call other Web services, format the server’s hard drive (although we don’t recommend this one), whatever you want. Best of all, Ajax and jQuery can handle several different data formats, so you usually won’t have to write any client-side JavaScript code to parse the response before using it.

There is really not all that much different when using the load method to retrieve data from a Web service rather than static HTML files. The HelloWorld.html sample page uses the HelloWorld Web service in AjaxServices to retrieve a string, which the page uses to update the content of three div elements on the page, as shown in Figure below. The Web service increments the number with each invocation, so that you can see that the page updates with each click.

jQuery Ajax

The Web service that the page calls is just about as simple as a Web service can be, using the following code. The HelloWorld method returns a string consisting of the requisite Hello World along with an integer that increments with each call. There is nothing special about this Web service that indicates that the client page will use jQuery to invoke the method.

The following code defines the body section of the page. The only interesting thing here is that there are three div elements, which the page uses to demonstrate that using a ‘div’ selector for the load method will update all three of the matching elements. There is also a style in the page that sets the divSays1 element to 24pt font size, just to vary things a bit.

The following code defines the click event function for the button. Yes, that’s all the code you need to call the Web service and update the contents of the div elements with the string retrieved from the Web service. The sole argument in this very simple example is the URL with the name of the desired method appended as a path element.

ldn-expertdkielyThis post is an excerpt from the online courseware for our ASP.NET 4.0 AJAX and jQuery Using Visual C# 2010 course written by expert Don Kiely.

When is your PC not your PC?

Windows-Vista-Start-Button

 

Since growing up in Seattle I have always been a big proponent of Microsoft. One of the key characteristics of Microsoft’s software that kept me loyal was that they always gave me enough rope to hang myself with. With any operating system or software, I was allowed to get in and tweak the system to be however I wanted it to be. And over time, I could solve most any technical issue because I knew how the guts were put together as a direct result of constant experimentation.

So what’s got me on edge? The Windows Start Button. I am struggling to understand Microsoft’s obsession with removing it. Microsoft released a Developer Preview of Windows 8 and a Consumer Preview. In both releases, bloggers like Jake Durasamy quickly posted how to get the Start button back and life seemed normal again. But with RTM, to quote Paul Thurrott, ” Microsoft has been furiously ripping out legacy code in Windows 8 that would have enabled third parties to bring back the Start button.” Really?

Mary Jo Foley agrees and pointed out that clearly Microsoft has made deliberate attempts to prevent developers from circumventing the bringing back of the Start Button as well as being able to boot straight into the Windows 8 desktop. Microsoft did not comment on her observations.

Don’t get me wrong, I understand Microsoft’s desire to move its users into the next generation of operating systems and I’m certainly familiar with the term, “sink or swim,” but is that the right move? TechRepublic has an infographic regarding pros and cons of Windows 8 and listed “No Start menu” and “Need for Massive Training” as two key negatives. Businesses are already struggling for compelling reasons to upgrade their employee’s computers. Is Microsoft’s being bullish on removing all training wheels really helping their cause?

I don’t deny the future and it is clear that the Start Button is not meant to be in it. The new Windows 8 style environment is here to stay and will be the new standard just like the Start Button was back in 1995. But is asking for little conveniences of the past asking too much before we go cold-turkey? Is going overboard in preventing its return better than simply making it optional? As I see it, it’s hard to go wrong by giving customers the freedom to do what they want.

win8-start-screen-1

Martin Schaeferle – Marty has taught IT professionals nationwide to develop applications using Visual Basic, Microsoft® SQL Server, ASP, and XML. He has been a featured speaker at Microsoft® Tech-Ed and the Microsoft® NCD Channel Summit, and he specializes in developing Visual Basic database applications, COM-based components, and ASP-based Web sites. In addition to writing and presenting technical training content, Martin is also LearnNowOnline’s Vice President of technology.

Updating Existing Entities

 

Querying data is a useful benefit of using Entity Framework, but you’ll often need to create, modify, and delete entity data as well. As with most of its features, Entity Framework provides rich support for changing data and has lots of options. This article discusses updating existing entities.

When you query the model and retrieve one or more entities then modify them, you can simply call SaveChanges to persist the changes. The following code retrieves all customers with the first name Ann and selects the first one, then writes the entity’s current state to the console window. Then the code changes a couple of property values, and again writes the state. Then it calls SaveChanges and writes the state yet again, then confirms that it updated the entity.

Figure 1 shows the results in the console window. Notice that immediately after materializing the Customer object, its state is Unchanged. This is as you’d expect, since no entity data has changed. After making changes but before saving them, the state is Modified. And after saving the changes, the state is once again Unchanged, because the context updated the entity’s original values to the new values to reflect the values now stored in the database.

results-of-changing-a-single-entity

Figure 1. The results of changing a single entity.

If you run SQL Profiler and examine the UPDATE statement that Entity Framework generated to persist the changes, you’ll find the following statement. Notice that Entity Framework is passing only the two updated fields, not the entire set of entity data. The context keeps track of which
properties changed, so is able to create more efficient SQL for the operation.

An interesting experiment is to update the FirstName property to Ann instead of Anne; in other words to set the value of the property to its current value. Change the code for that statement to the following and comment out the line that updates the ModifiedDate property. Then run the application again. And again. And once more. Notice that each time you get the same Unchanged/Modified/Unchanged states that you saw in Figure 1. Entity Framework sees that you assign a value to the property and changes the state to Modified without comparing the new value to the old one.

If you use SQL Profiler to look at the SQL statement generated with this new version of the code, you’ll find that it is the following statement every time. The UPDATE statement sets the FirstName field to ‘Ann’ even though that is already its value.

You can also update related data using the navigation properties of each entity, as long as those related objects are materialized in the query. Usually the easiest way to do that is to use the Include method for the related entities to make sure their data is available in memory for modification.

The Entity Data Model Designer

CS.Ch02_blog

 

Entity Framework’s Entity Data Model is the key link between the entity data objects in your application and the backend data store where data resides. It provides all the pieces that Entity Framework needs to provide your application with a conceptual model that the application uses, a storage model of the data store schema, and mappings between the two, along with support for relationships between the various entities in the model. Entity Framework uses the model to generate .NET entity classes and APIs that provide powerful data access features to an application.

At design time, you’ll most often work with the Entity Data Model in the graphical designer in Visual Studio, which provides a great way to see, understand, and modify the model. But all of the details of the model, including how it appears in the designer, are stored in a .edmx XML file.

The Entity Framework takes care of all the work of connecting to the data store, generating commands and executing them, providing entity data objects to the application, and processing changes to the data.

In this blog, you’ll learn about how the Entity Data Model Designer works, so that you can make effective use of it in applications.

Entity Data Model Designer

Your model will open in the Entity Data Model designer, shown in the figure below, once the Entity Data Model Wizard finishes its work. The wizard creates an entity for each table and view you selected in the database and association lines that reflect the table relationships defined in the database. Each entity has properties that reflect the corresponding table’s fields, and entities with associations that have navigation properties. Notice how all the entity names are singular, and the navigation properties are either singular or plural, reflecting whether they reference a single entity or a collection, which in turn reflects the multiplicity of the relationship. For example, a Customer can have multiple addresses so it has a CustomerAddresses navigation property to the CustomerAddress entity. But a customer address can have only a single associated customer, so the CustomerAddress entity has a Customer property. The model implemented this singular/plural naming scheme because you left the Pluralize or singularize generated object names option checked in the wizard.

Each entity has scalar properties—listed under the header Properties on each entity in the designer—that have values contained within the entity. The Customer entity includes CustomerID, Title, FirstName, and LastName scalar properties, and more, each of which will contain the current value of the corresponding field in the Customer table from the database when the object is materialized at runtime.

Entities that have associations with other entities also have one or more navigation properties. These properties are references to the related entities. For example, the Customer entity can have one or more addresses and sales orders, so the entity has CustomerAddresses and SalesOrderHeaders navigation properties. These properties let you navigate from a Customer to its addresses or orders without having to write a join in a LINQ expression.

The lines that connect related entities are associations, which represent the relationships between the tables in the database, and define the relationship between the associated entities. Each end of an association is described by its multiplicity, which is the number of entities that can be on that end. (Multiplicity is often referred to as cardinality in relational database theory, but Entity Framework more often uses the term multiplicity.) There are three options for the multiplicity of each end of an association, with the symbol used in the designer:

  • One: 1
  • Zero or one: 0..1
  • Many: *

WARNING! The location of the end points of an association line in the designer have no bearing on the fields involved in the relationship between the two entities. If you look back at the figure above, the association between the Customer and SalesOrderHeader entities has nothing to do with the Customer’s FirstName field, even though that end of the line is adjacent to FirstName.

You can then combine the multiplicity of the two ends of an association to describe the relationship, such as:

  • 1:* means “one to many.” For example, a single customer can have many orders.
  • *:* means “many to many.” An example of this relationship would be customers to addresses (although this is not the type of relationship in the AdventureWorksLT database). A customer can have many addresses (home, school, work, mailing), and each address can be used by multiple people, such as several family members living at the same home address.
  • 0..1:* means “zero or one to many.” An example of this relationship is the association between the ProductCategory and Product entities in AdventureWorksLT. A product category can have many products, and a product can optionally have a category assigned to it.

NOTE: The CustomerAddress entity, shown back in the figure above, is a many-to-many table in the AdventureWorksLT database. If a many-to-many table in the database contains only the foreign keys to the related tables, the Entity Data Model Wizard simply creates a many-to-many association between the two tables, and doesn’t include an entity for the many-to-many table. But because CustomerAddress includes other fields—AddressType, rowquid, and ModifiedDate—that describe the type of customer address, the model includes it as a separate entity so that you can access those additional properties in your application.

NQMDTN5Y47AP