ASP.Net Development Platforms Are Dissimilar

Officials have not designed all asp.net platforms equal. Here we will explain key factors that differentiate the platforms that change the way of interacting with CMS for the end user.

We are sharing an overview of these points, adopted from the Aegis Soft tech’s works and opinions. Developers are using asp.net mvc development platform to make a modern approach towards development.

.net platform

  1. Architecture- Tightly Coupled Vs Decoupled

A decoupled architecture can bring you flexibility to design your front-end and leverage your content management potential. In this architecture, content managing application is not equal to content delivering application.

In this situation, the CMS doesn’t dictate the stack, or required the set of technologies to deliver the website and content. Decoupled architecture model delivers content anywhere and in any format.

However, tightly coupled architecture is different and everything ranging from web content, analytics data, customer data, content delivery, and website presentation take place in a single database and app framework.

  1. Development Model – Web Forms Vs MVC

Web forms and MVC are two approaches examined by developers to code your front-end experience.

Asp.net web forms approach is conventional model and Microsoft officials intended web forms to assist developers in getting familiar with client server development swiftly migrate to creating web pages using a visual RAD interface.

The issue with Web Forms is that they support tightly coupled architecture. This explains the app code and the interface cannot be easily recycled.

MVC offers unique architectural pattern to developers. It is a modern approach to asp.net development.

Using MVC, a request can be sent to the Controller which later determines the Model and UI type to put together in order to develop apt front end interface.

You can also make use of Razor in MVC.

  1. Structured Content Vs Blob Content

In the IT world, where everyday new devices and channels are arriving, the content recycling task is absolutely critical. It takes several forms. It could be updating the content on multiple webpages or mobile devices, or for both digital and print.

Blob content is also known as binary large object content. Several CMS platforms are still storing content in blob format. You need a large WYSIWYG editing environment where you do content writing of the page, that includes multimedia, images, and some documents; and everything is stored as a Blob in the database.

Developers can rely on their precision expertise to explore asp.net mvc development platforms.

References:
http://www.internetbillboards.net/2016/02/16/asp-net-developers-guide-to-build-your-own-wiki/

http://www.rswebsols.com/tutorials/programming/asp-net-generate-pdf-html-itextsharp

 

How to Implement Convent Accordion plugin in ASP.NET MVC

A convent accordion plugin is one of those open source plugins that are relied on JQuery. To implement this plugin, you must meet minimum requirements that are discussed below in this article. Follow the instructions shared by asp.net development experts and learn their technique to implement convent accordion plugin in asp.net MVC development.

Today we are going to implement Convent Accordion plugin in asp.net MVC. Convent Accordion plugin is an open source plugin for jQuery. This plugin is depended on jQuery. Here we will see the basic example to implement it step by step.

Requirements :

jQuery Library reference :

jQuery Easing reference :

Convent Accordion Library reference

Convent Accordion Styles reference

after downloading this file store it in JS folder, folder structure will look like this.

 JS folder structure

And store css stylesheet file in css folder.

So now first of all we need to set the reference of downloaded JavaScript libraries and css styles.

<script src=”@Url.Content(“~/js/jquery.min.js”) type=”text/javascript”></script>

<script src=”@Url.Content(“~/js/jquery.conventAccordion.js”) type=”text/javascript”></script>

<script src=”@Url.Content(“~/js/jquery.easing.1.3.js”) type=”text/javascript”></script>

<link href=”@Url.Content(“~/css/style.css”) rel=”stylesheet” />

Now we will add following HTML Content in view for Accordion:

<ol class=”rounded basic” id=”cAccordion” style=”width803pxheight125pxlist-style-typenone”>

    <li>

        <div>Slide A</div>

        <div>

            <img src=”img-demo/Image-1.png” alt=”image” />

        </div>

    </li>

    <li>

        <div>Slide B</div>

        <div>

            <img src=”img-demo/Image-2.png” alt=”image” />

        </div>

    </li>

</ol>

You can set any HTML content instead of images.

Now we need to set following script to set Convent Accordion.

<script>

    (function ($, d) {

        $(‘#cAccordion’).conventAccordion({

            autoPlay: false,

            startSlide: 1,

            remember: false,

            slideInterval: 2000,

            pauseOnHover: true,

            actOnHover: false,

            continuous: false,

            autoScaleImages: true,

            easing: ‘easeInOutQuart’

        });

    })(jQuery, document);

</script>

After Implementation it will look like this.

3

You can try and make practice for asp.net development using Convent Accordion plugin. The purpose of ASP.NET MVC web development experts is to make you learn how to implement this plugin in asp.net mvc. If you still have doubts, clear them by asking our experts.

How To Develop Custom Action Filter Attribute In Asp.Net MVC Development

The article is written by Aegissofttech developer in order to share information about creating custom Action Filter Attribute at asp.net MVC development platform. The development team is sharing its experience with global community, so that other country’s developers can learn from them and make best practices of asp.net development.

Develop Custom Action Filter Attribute

MVC Authentication using Filter Attribute:

Create Action Filter class:
An action filter consists of codes that run either before or after an action runs. It can be used for tasks like logging, privileged based authorization, authentication, caching etc.

How to create custom Action Filter Attribute:

  • Create a class “LoginAuthAttribute”
  • Inherit that class with “ActionFilterAttribute, IAuthenticationFilter”
  • Override “OnAuthenticationChallenge” method.
 public class LoginAuthAttribute : ActionFilterAttribute, IAuthenticationFilter  
 {  
 public void OnAuthentication(AuthenticationContext filterContext)  
 {  
 }  
 public void OnAuthenticationChallenge(AuthenticationChallengeContext filterContext)  
 {  
 var user = filterContext.HttpContext.User;  
 if (user == null || !user.Identity.IsAuthenticated)  
 {  
 filterContext.Result = new HttpUnauthorizedResult();  
 }  
 }  
 }  

You can see above code, the “OnAuthencitcationChallenge” method is overridden, we want to execute this method before any action is executed.

In above code as you can see, we check the user is authenticated or not, if user is not authenticated then we set Result as a UnAuthorisezed result.

Set form authentication mode in web config file as per below code.

 <authentication mode="Forms">  
 <forms loginUrl="~/Login" timeout="2880" />  
 </authentication>  

To use LoginAuthAttribute in our controller we are creating a new BaseController. So, others controller’s is this controller are inherited by this BaseController.

 [LoginAuthAttribute]  
 public class BaseController : Controller  
 {  
 }  

Design Login form.

Create a Login controller and implement login method.

 [HttpPost]  
 public ActionResult Login(LoginModel model, string ReturnUrl)  
 {  
 FormsAuthentication.SetAuthCookie(model.UserName, false);  
 if (Url.IsLocalUrl(ReturnUrl) && ReturnUrl.Length > 1 && ReturnUrl.StartsWith("/")  
 && !ReturnUrl.StartsWith("//") && !ReturnUrl.StartsWith("/\\"))  
 {  
 return Redirect(ReturnUrl);  
 }  
 else  
 {  
 return RedirectToAction("Index", "Home");  
 }  
 }  
 public ActionResult Logout()  
 {  
 FormsAuthentication.SignOut();  
 return RedirectToAction("Index", "Login");  
 }  

Create two method as per above code Login and Logout in Login Controller.

Create a HomeController and inherit this controller with “BaseController”

 public class HomeController : BaseController  
 {  
 }  

Now each and every action methods of Home Controller checks the user is authenticate of not before execute. If user is not authenticate then this will redirect to Login page.

Conclusion:

In the above document we learned how to create custom attribute. Also learned how to use custom attribute with controller in MVC.

Author of this article is working with the Aegissofttech asp.net MVC development team. The post is published by expert to assist global developers and help them in making best development practices. To get more info on related topic, you can contact the Aegis experts anytime, any day, from anywhere. They will get in touch with you soon.

Author bio- Rohit is working with Aegissofttech since long time. Rohit has vast experience is developing asp.net MVC applications for global clients. This article story is published to let other developers know how they can develop a custom action filter attribute and use it for a project.