Skip to content
Loading
 
0
  • 0
    i want to use a class in email because the email is decryped format.
     
    so for encrpted i am using a class AESCryptography.AES256_Decrypt .
     
    so where should i write this class in email decryption in datatable?? 
    0
  • Ramesh Palanivel
    0
    Hi Manoj,
     
    Have wrote this encryption and Decryption in javascript?
    0
  • 0
    no how?? can you tell me??
    0
  • Ramesh Palanivel
    0
    Hi Manoj,
     
    The best way is, Pass the encrypted email id to javascript fucntion.
     
    Then write the ajax in that function and post your value to controller and get the value in controller and pass it to decryption class and store the value.
    0
  • 0
    The best way is, Pass the encrypted email id to javascript fucntion.
    Then write the ajax in that function and post your value to controller and get the value in controller and pass it to decryption class and store the value. 
    ???
     
     i am using datatable server side.
    write down the code to pass the encrypted email id to javascript function??
     
    0
  • Ramesh Palanivel
    0
    Hi Manoj,
     
    May I know where the datatable you wrote?
     
    Can you share this entire source
    0
  • 0
    in the of the table i am using.look at the top of my question i have mention the table.
     
    1. public ActionResult GetData()  
    2.        {  
    3.            // Initialization.  
    4.            JsonResult result = new JsonResult();  
    5.   
    6.            try  
    7.            {  
    8.                // Initialization.  
    9.                string search = Request.Form.GetValues("search[value]")[0];  
    10.                string draw = Request.Form.GetValues("draw")[0];  
    11.                string order = Request.Form.GetValues("order[0][column]")[0];  
    12.                //string ordColumnName = Request.Form.GetValues("order[0][columnname]")[0];   
    13.                string orderDir = Request.Form.GetValues("order[0][dir]")[0];  
    14.                int startRec = Convert.ToInt32(Request.Form.GetValues("start")[0]);  
    15.                //  int pageSize = Convert.ToInt32(Request.Form.GetValues("length")[0]);  
    16.   
    17.   
    18.                var start = Request.Form.GetValues("start").FirstOrDefault();  
    19.                var length = Request.Form.GetValues("length").FirstOrDefault();  
    20.                int pageSize = length != null ? Convert.ToInt32(length) : 0;  
    21.                int recordStatr = start != null ? Convert.ToInt32(start) : 0;  
    22.                recordStatr = recordStatr == 0 ? 1 : recordStatr;  
    23.                var pageIndex = (recordStatr / pageSize) + 1;  
    24.                int recordsTotal = 0;  
    25.   
    26.   
    27.   
    28.              
    29.   
    30.   
    31.   
    32.                // Loading.  
    33.                List data = this.LoadData();  
    34.   
    35.                // Total record count.  
    36.                int totalRecords = data.Count;  
    37.   
    38.                // Verification.  
    39.                //if (!string.IsNullOrEmpty(search) &&  
    40.                //    !string.IsNullOrWhiteSpace(search))  
    41.                //{  
    42.                //    // Apply search  
    43.                //    data = data.Where(p => p.Title.ToString().ToLower().Contains(search.ToLower()) ||  
    44.                //                           p.Name.ToLower().Contains(search.ToLower()) ||  
    45.                //                           p.Email.ToString().ToLower().Contains(search.ToLower())).ToList();  
    46.                //    //p.ProductName.ToLower().Contains(search.ToLower()) ||  
    47.                //    //p.SpecialOffer.ToLower().Contains(search.ToLower()) ||  
    48.                //    //p.UnitPrice.ToString().ToLower().Contains(search.ToLower()) ||  
    49.                //    //p.UnitPriceDiscount.ToString().ToLower().Contains(search.ToLower())).ToList();  
    50.                //}  
    51.   
    52.                // Sorting.  
    53.                data = this.SortByColumnWithOrder(order, orderDir, data);  
    54.   
    55.                // Filter record count.  
    56.                int recFilter = data.Count;  
    57.   
    58.                // Apply pagination.  
    59.                // data = data.Skip(startRec).Take(pageSize).ToList();  
    60.   
    61.                // Loading drop down lists.  
    62.                // result = this.Json(new { draw = Convert.ToInt32(draw), recordsTotal = totalRecords, recordsFiltered = recFilter, data = data }, JsonRequestBehavior.AllowGet);  
    63.   
    64.              
    65.                 
    66.   
    67.                // Apply pagination.  
    68.                
    69.   
    70.   
    71.   
    72.                //Find Order Column  
    73.                //var sortColumn = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault();  
    74.                //var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();  
    75.   
    76.   
    77.   
    78.   
    79.                var client = new HttpClient();  
    80.   
    81.   
    82.                client.BaseAddress = new Uri("http://localhost:1849");  
    83.                client.DefaultRequestHeaders.Accept.Clear();  
    84.                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));  
    85.   
    86.                // string _url = _apiTicket + ".Get?UserId=" + 10 + "&PageIndex=" + pageIndex + "&PageSize=" + pageSize;  
    87.                //var response = client.GetAsync(_url).Result;  
    88.                //var response1 = client.GetAsync("/Areas/Ticket/Api/Get/10,10,10").Result;  
    89.                //if (response1.IsSuccessStatusCode)  
    90.                //{  
    91.                //    string responseString = response.Content.ReadAsStringAsync().Result;  
    92.                //}  
    93.                // string apiUrl = "http://localhost:1849/Api/Ticket?UserId=10";  
    94.                //string _url = _apiTicket + "Get1/10?searchstr=Monaj&PageIndex=" + pageIndex + "&PageSize=" + pageSize;  
    95.                // string apiUrl = "http://localhost:1849/Api/Ticket?UserId=" + 10  ;  
    96.                //string apiUrl = "http://localhost:1849/Api/Ticket?UserId=10&start=1&length=10";  
    97.                string apiUrl = "http://localhost:1849/Api/Ticket?UserId=10&start="+ start + "&length="+ length +"&searchstr="+search +"&orders="+order+"&orderDir="+orderDir+ "";  
    98.                //string apiUrl = "../Areas/Api/Ticket/1?searchstr=Monaj&start=0&length=10";  
    99.                var response = client.GetAsync(apiUrl).Result;  
    100.                 
    101.                var result1 = response.Content.ReadAsStringAsync().Result;  
    102.   
    103.                var settings = new JsonSerializerSettings();  
    104.                settings.MetadataPropertyHandling = MetadataPropertyHandling.Ignore;  
    105.                 
    106.                var obj = JsonConvert.DeserializeObject(result1, settings);  
    107.                
    108.                 
    109.                // HttpResponseMessage response = await client.GetAsync(_url);  
    110.                //  HttpResponseMessage response = client.GetAsync(_url).Result;  
    111.                //var response = client.GetAsync(_url).Result;  
    112.                // var result1 = response.Content.ReadAsStringAsync().Result;  
    113.   
    114.                JsonResult jsonresult = Json(result1, JsonRequestBehavior.AllowGet);  
    115.               // var friends = new JavaScriptSerializer().Deserialize>(jsonresult.Data.ToString());  
    116.                //var responseResult = JsonConvert.DeserializeObject>  
    117.                //    (response.Content.ReadAsStringAsync().Result);  
    118.                //JToken root = JObject.Parse(jsonresult.Data.ToString());  
    119.                //JToken user = root["data"];  
    120.                //User deserializedUser = JsonConvert.DeserializeObject(user.ToString());  
    121.   
    122.                //var settings = new JsonSerializerSettings() { Culture = System.Globalization.CultureInfo.InvariantCulture };  
    123.                //var dataOut = JsonConvert.DeserializeObject>(jsonresult.Data.ToString(), settings);  
    124.                ////welsh culture, case I think that is what you are using, but for me is working   
    125.   
    126.                //Dictionary dictionary = JsonConvert.DeserializeObject>(jsonresult.Data.ToString());  
    127.   
    128.   
    129.                GetSSASAcademyBookedCoursesModel _contacts = new GetSSASAcademyBookedCoursesModel();  
    130.   
    131.                _contacts = JsonConvert.DeserializeObject(jsonresult.Data.ToString());  
    132.               recordsTotal = _contacts.totalRecords;  
    133.                 
    134.                // var summoners =Jsovar friends = new JavaScriptSerializer().Deserialize>(theJsonString);nConvert.DeserializeObject>(jsonresult.Data.ToString());  
    135.                // result = this.Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = _contacts.listcourses }, JsonRequestBehavior.AllowGet);  
    136.                // result = this.Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = _contacts }, JsonRequestBehavior.AllowGet);  
    137.                result = this.Json(new { draw = Convert.ToInt32(draw), recordsFiltered = totalRecords, recordsTotal = recordsTotal, data = _contacts.listcourses }, JsonRequestBehavior.AllowGet);  
    138.   
    139.   
    140.   
    141.   
    142.            }  
    143.            catch (Exception ex)  
    144.            {  
    145.                // Info  
    146.                Console.Write(ex);  
    147.            }  
    148.   
    149.            // Return info.  
    150.            return result;  
    151.        }  
     
    0