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.

What to do and don’t do While Hiring an ASP.NET MVC Developer?

How to find and hire ASP.NET MVC Developer?

Technology has evolved a lot in last few years. It would not be an exaggeration that technology is evolving at a rapid speed. ASP.Net is a technology which has completely changed the way how users used to practice, process and interact with the ideas in their daily life. It was introduced by the Microsoft Corporation to provide developers with an all new robust technology which can build trustable and sustainable apps on Internet. Now, ASP.NET has grown so much that it can compete with ever evolving needs of users.

hire-asp-developer-

ASP.NET offers systematized programming approach which is in great demand among developers. ASP.NET has gained a lot of popularity in last few years and this is the reason that it is getting bigger and better by day and day.

What to do While Hiring an ASP.NET MVC Developer?

whattodo

Just going through the development portfolio is not a right way to hire an ASP.NET mvc developer. Try to get into the details as much as you can and if possible, enquire the provider by yourself. Going with reliable personal references is a good choice. You can trust on internet searches but, you will need to do a complete verification which is a time consuming process.
While looking at the portfolio section, do not forget to check out the credentials of the applicant like partners and certificates. You should try to get more details on how the applicant helped the company with Asp.net development. Taking a look at the reviews and ratings is also a decent way while hiring an ASP.NET mvc developer. Always read all the terms and policies attached with the portfolio.

What Not to Do While Hiring ASP.NET MVC Developer?

what-not-to-do

ASP.NET developer plays a very vital role so making hurry while hiring an ASP.NET developer is not a desirable thing to do. Your money and project, both are on the stake so don’t just trust a company just because their portfolio looks beautiful. Always ask company’s brochure and accreditation certificates while doing the hiring.

Never ever hire a person or company before checking the qualifications in details. Make sure that the applicant possesses all the necessary and required experience needed to do the job. Experienced applicant should always be given the priority. Discussing about the past projects and applicants view on those projects is a good step while hiring an ASP.NET MVC developer.