Create a custom autocomplete control in ASP.NET MVC

How to create a custom HTML control in ASP.NET MVC? using System; using System.Web.Mvc; namespace MvcApplication1.Helpers {      public static class LabelExtensions      {           public static string Label(this HtmlHelper helper, string target, string text)           {                return String.Format(“{1}”, target, text);           }      } } Refer link: https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/views/creating-custom-html-helpers-cs Auto complete custom control: Download  

Nth Highest Salary

Create table #tblEmployee (Id int, [Name] varchar(100), City varchar(100), Salary decimal (10,3)) Insert into #tblEmployee values(1, ‘Prakash Rathod’, ‘Gandhinagar’, 100000) Insert into #tblEmployee values(2, ‘Salman Khan’, ‘Mumbai’, 100000) Insert into #tblEmployee values(3, ‘Aamir Khan’, ‘Mumbai’, 90000) Insert into #tblEmployee values(4, ‘Katrina Kaif’, ‘Mumbai’, 80000) Insert into #tblEmployee values(5, ‘Rashmi Bansal’, ‘Indor’, 95500) Insert into #tblEmployee …

Generate x509 certificate in pem, cer and pfx and export public key

Generate x509 cerntifcate c:\Demo>openssl req -x509 -days 365 -newkey rsa:2048 -keyout my-key.pem -out -my-cert.pem Generating a RSA private key ………………………+++++ …………..+++++ writing new private key to ‘my-key.pem’ Enter PEM pass phrase: Verifying – Enter PEM pass phrase: —– You are about to be asked to enter information that will be incorporated into your certificate request. …

Send an image (stored as base64 string) inline in email

Byte[] bitmapData = Convert.FromBase64String(FixBase64ForImage(“Base64 string”)); System.IO.MemoryStream streamBitmap = new System.IO.MemoryStream(bitmapData); var imageToInline = new LinkedResource(streamBitmap, MediaTypeNames.Image.Jpeg); imageToInline.ContentId = “Pic1”; AlternateView avHtml = AlternateView.CreateAlternateViewFromString(mailMessage.Body, null, MediaTypeNames.Text.Html); avHtml.LinkedResources.Add(imageToInline); mailMessage.AlternateViews.Add(avHtml); public static string FixBase64ForImage(string Image) { System.Text.StringBuilder sbText = new System.Text.StringBuilder(Image, Image.Length); sbText.Replace(“\r\n”, string.Empty); sbText.Replace(” “, string.Empty); return sbText.ToString(); }

Put/Delete http verb not working server

Please add following code in web.cofig file. <system.webServer> <modules> <remove name="WebDAVModule"/> <remove name="FormsAuthentication" /> <remove name="ApplicationInsightsWebTracking" /> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" /> </modules> <handlers> <remove name="WebDAV" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <remove name="OPTIONSVerbHandler" /> <remove name="TRACEVerbHandler" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> If not solve then please follow link.

Dynamically add rows and html controls in table using jQuery

How to add rows dynamically in HTML table with textbox and textarea controls. Example: Download <html> <head> <title>Table Dynamic Row Add Delete Demo</title> <script src=”https://code.jquery.com/jquery-3.2.1.js” integrity=”sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=” crossorigin=”anonymous”></script> </head> <body> <div> <table id=”tbl1″> <thead> <tr> <th> Family </th> <th> Address </th> </tr> </thead> <tbody> <tr> <td> <input type=”text” id=”txtFamil_01″ name=”txtFamily_01″ /> </td> <td> <input type=”text” id=”txtAddress_01″ …

CSS style problem with MVC rendered checkboxes using MVC helper

I have faced the issue with CSS for checkboxes in asp.net mvc. Below is mvc code. @Html.CheckBoxFor(model => model.GroupClosed) <label for=”GroupClosed” class=”block”> Group Closed </label> It will render as below: <div class=”checkbox clip-check check-primary”> <span class=”control-label” style=”color:white”>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <input id=”GroupClosed” name=”GroupClosed” type=”checkbox” value=”true”><input name=”GroupClosed” type=”hidden” value=”false”> <label for=”GroupClosed” class=”block”> Group Closed </label> </div> Before modify the css …