Next I would like to speak about is Adaptive Rendering which allows your website is aware of the
browser’s proportions and corresponds to them, so it can present its content as user-friendly as possible.That
means even if you resize , the content is clipped. The meta-tag "Viewport " is helpful indeed. For eg:
Appending <meta name="viewport" content="width=device-width"/> would help us scale the complete
page properly even on mobile.
Then we have Bundling and Minification which are more useful in production than in development as
well can significantly improve your first page hit download time.
Bundling reduces the number of individual HTTP requests to server by combining multiple CSS filesand Javascript files into single CSS file and javascript file. We have
to register bundles function inApplication_Start() of Global Asax . Now to bundle js scripts together as one we add them into 1 bundle.
Minification reduces the file download size of CSS and javascript files by removing whitespace, comments and other unnecessary characters. Here we have to zip or minify the css & js files in order toreduce load.
For eg: we can use gzip to minify the files so "smaller files, less kb on the wire, faster page load".
Hope I could do justice to this blog by providing you all adequate detail on the above mentioned features of
MVC . I would even be posting more on my development experiences & issues faced periodically . In the
meanwhile if you get stuck @ any phase in development, you guys can mail me so that I can help you .
None
0 Points
1 Post
Interesting about Asp.Net MVC
May 15, 2013 09:33 AM|Shalin-Jirawla|LINK
As we all know that MVC has been a life-saver for Asp.Net , giving the power to do more . Now solution to
a complex application has been made easier due to the available MVC semantics. I am already amazed about
the following features which MVC provides :
So let's focus on some of the other revolutionary facets which has made development tasks simple .
First let's talk about MVC jQuery validation which is done on the front end (client side), without submitting
data to the controller (Server side). So it can save you some bandwidth/processing. If you have a slow or
overloaded server, users will get a quicker response to validation errors this way as well. Server side validation is
essential/required since it makes sure you are getting good data before you save it. The client side is nice to
have, but shouldn't be all you have since its possible to bypass. For jquery validation add the scripts
"jquery.validate.min.js" & "jquery.validate.unobtrusive.min.js" to your view .
Also add the following in App-Settings of web-config :
We even have Remote Validation which fires for the custom validation logic developed, so when client
presses submit button it shows the error fabricated . For eg : We set the remote attribute in model for property
[Remote("RegisterClientUser", "Registration", ErrorMessage = "User name is already taken!")]
public String UserName { get; set; }
Then we declare it's respective action in controller .
public class RegistrationController : Controller
{
// GET: /Registration/
private UserEntities userDB;
public RegistrationController()
{
userDB = new UserEntities();
}
public ViewResult RegisterClientUser()
{
return View(new UserModel());
}
[HttpPost]
public ActionResult RegisterClientUser(UserModel um)
{
try
{
clientuser user = new clientuser();
return Json(!um.UserName.Equals(userDB.clientuser.Find(um.UserName))
, JsonRequestBehavior.AllowGet);
if (ModelState.IsValid)
{
// your code
}
return RedirectToAction("Index", "Home");
}
catch
{
ViewBag.updateError = "Unable to register";
return View(um);
}
}
}
Next I would like to speak about is Adaptive Rendering which allows your website is aware of the
browser’s proportions and corresponds to them, so it can present its content as user-friendly as possible.That
means even if you resize , the content is clipped. The meta-tag "Viewport " is helpful indeed. For eg:
Appending <meta name="viewport" content="width=device-width"/> would help us scale the complete
page properly even on mobile.
Then we have Bundling and Minification which are more useful in production than in development as
well can significantly improve your first page hit download time.
Bundling reduces the number of individual HTTP requests to server by combining multiple CSS filesand Javascript files into single CSS file and javascript file. We have to register bundles function in Application_Start() of Global Asax . Now to bundle js scripts together as one we add them into 1 bundle.
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
Similarly we do for stylesheets as follows
bundles.Add(newStyleBundle("~/Content/Styles/css").Include(
"~/Content/Styles/css/style.css"));
Minification reduces the file download size of CSS and javascript files by removing whitespace, comments and other unnecessary characters. Here we have to zip or minify the css & js files in order to reduce load.
For eg: we can use gzip to minify the files so "smaller files, less kb on the wire, faster page load".
Hope I could do justice to this blog by providing you all adequate detail on the above mentioned features of
MVC . I would even be posting more on my development experiences & issues faced periodically . In the
meanwhile if you get stuck @ any phase in development, you guys can mail me so that I can help you .
So STAY TUNED !
Find More tutorials and articles here
Regards,
Shalin Jirawla
shalinitengg10@gmail.com
mvc asp.net mvc3 MVC4