Posts

get value by jquery in c# Asp.net by newtonsoft plugin

HTML <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title></title>     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" />     <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossor

Grideview on row command

< asp : GridView   ID ="GridView1"   runat ="server"   AutoGenerateColumns ="false"   OnRowCommand ="GridView1_RowCommand">       < Columns >           < asp : TemplateField   HeaderText ="Name"   ItemStyle-Width ="150">               < ItemTemplate >                   < asp : TextBox   ID ="txtName"   runat ="server"   Text =' <% #   Eval("Name")   %> '   />               </ ItemTemplate >           </ asp : TemplateField >           < asp : BoundField   DataField ="Country"   HeaderText ="Country"   ItemStyle-Width ="150px"   />           < asp : TemplateField >               < ItemTemplate >                   < asp : Button   Text ="Select"   runat ="server"   CommandName ="Select"   CommandArgument =" <% #   Container.DataItemInd

Encription Manager In Asp.net

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Security.Cryptography; using System.Text; using System.IO; namespace screentestbrijesh.App_Code {     public class EncryptionManager     {         public string EncryptData(string clearText)         {             string EncryptionKey = "MAKV2SPBNI99212GFFDRBKJHKUA547765992775497HGFK6FF9LON00012SSDFFG";             byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);             using (Aes encryptor = Aes.Create())             {                 Rfc2898DeriveBytes pdb = new Rfc2898DeriveBytes(EncryptionKey, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });                 encryptor.Key = pdb.GetBytes(32);                 encryptor.IV = pdb.GetBytes(16);                 using (MemoryStream ms = new MemoryStream())                 {                     using (CryptoStream cs = new CryptoStream(ms, encryptor.CreateEncryptor(), CryptoSt

Image Show on change of fileupload

<head runat= "server" >       <title>Preview Image While Upload</title>          <script src= "jquery-1.8.2.js"  type= "text/javascript" ></script>          <script type= "text/javascript" >            function  ShowPreview(input) {                if  (input.files && input.files[0]) {                    var  ImageDir =  new  FileReader();                   ImageDir.onload =  function (e) {                       $( '#impPrev' ).attr( 'src' , e.target.result);                   }                   ImageDir.readAsDataURL(input.files[0]);               }           }       </script>      </head>   <body>       <form id= "form1"  runat= "server" >       <table cellpadding= "10"  cellspacing= "4"  width= "70%"  align= "center"  style="border: Solid 10px Green;           font-weight