Thursday, 26 December 2019

Encrypt password in SQL Server

This post will show you how can you encrypt/decrypt the password in SQL server 2012 fully using SQL Server store procedure.

Encrypt



        INSERT INTO AdminMaster ( Name,  UserName, Password, Status)

        VALUES('Girfa', 'girfa',EncryptByPassPhrase('key', '123')  , 1)

Sunday, 15 December 2019

Textbox jquery option

Textbox jquery option

Textbox enter keypress detection


$j('#txtDesignCode').keypress(function (event) {

    var keycode = (event.keyCode ? event.keyCode : event.which);
    if (keycode == '13') {
       alert('Enter key hit'); 
    }

});

Thursday, 21 November 2019

Auto suggestion MVC C# ASP.Net

Auto Suggestion of names using C# MVC ASP.Net with Ajax

CSS



<style>
     .g-auto {
         position: absolute;       
        
         border: solid 1px #e3e2de;
         background-color: #ffffff;
         -webkit-box-shadow: 0px 3px 13px -1px rgba(0,0,0,0.75);
         -moz-box-shadow: 0px 3px 13px -1px rgba(0,0,0,0.75);
         box-shadow: 0px 3px 13px -1px rgba(0,0,0,0.75);
         padding:0px;
         display:none;
        
     }

Tuesday, 19 November 2019

Putting model data in Viewbag



Putting Model in viewbag is the easiest way to flow A model data controller to a view. Let see a case, Suppose You’re editing a student record, On the editing page, you need to fill student details in related textbox and different type of dropdown list, which data is coming from database i.e. course , session, etc.

Normally we bind one model control to a view at a time. But if you are putting the model in a viewbag then you can transfer any number of models to a view. The following code will show you, Getting course record from the controller and filling it in the drop-down list at the view 


Model



public class CourseModel
    {
        public string ID { get; set; }
        public string CourseName { get; set; }
        public string Description { get; set; }
    }