Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

Kunal Mandloi

@Kunal Mandloi
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MVC Controller State Managment
    K Kunal Mandloi

    This is my home controller.... Where I am passing value in query string.......

    using IdentityModel.Client;
    using Microsoft.AspNetCore.Http;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Mvc.ModelBinding;
    using Newtonsoft.Json;
    using NLog;
    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.Http;
    using Newtonsoft;
    using System.Text.RegularExpressions;
    using System.Net.Http.Headers;
    using System.Diagnostics;
    using Newtonsoft.Json.Linq;
    using System.IO;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.Options;

    namespace MYApp.Controllers
    {

    public class HomeController : Controller
    {
       
       
       
        Logger logger = LogManager.GetCurrentClassLogger();
        private string clientId = "";
        private string clientSecret = "";
        
        private ModelStateDictionary ValidationMessages { get; set; }
    
         
    
        public class UserInfo
    
        {
            public string Addresses { get; set; }
            public string OriginatorNo { get; set; }
    
            public string OriginatorName { get; set; }
    
            public string ContactName { get; set; }
    
            public string FirstName { get; set; }
            public string LastName { get; set; }
            public string Email { get; set; }
    
        }
     
       
        public IActionResult Index()
        {
          
            try
            {
    
                //int a = 0;
                //int b = 1;
                //int c = b / a;
          
    
            string strUrl = "https://url";
          
    
                if (Request.Query\["UserName"\].ToString() != string.Empty && Request.Query\["Password"\] != string.Empty)
                {
    
                  
                    HttpContext.Session.SetString("UserName", Request.Query\["UserName"\].ToString());
                   
                    HttpContext.Session.SetString("Password", Request.Query\["strPassword"\].ToString());
                   
                }
                
              
    
    
            }
            catch (Exception ex)
            {
                
    
            }
    
    
        }
    
       
        public class ContactPerson
        {
            public string FirstName { get; set; }
            public string LastName { get; set; }
            public string Email { get; set; }
            public string IncludeInEmails { get; set; }
        }
      
        public IActionRes
    
    .NET (Core and Framework) database asp-net architecture help tutorial

  • MVC Controller State Managment
    K Kunal Mandloi

    I am working on Webhooks Concept. Since Webhooks act like an trigger. It will be firing an event like Update or Insert takes place. Its a MVC application and I have two Controller Home and Webhook Controller. I am passing argument through Query String on Home controller. I have tried Session,TempData, Cookies for passing variable from home to Webhooks HttpContext.Session.SetString("UserName", Request.Query["UserName"].ToString());

    and getting session value on webhook controller

    HttpContext.Session.GetString("UserName");

    Also tried the same for TempData

    Issue is On webbooks Controller its coming null.

    I need to store parameter (User Name ,password) and reused the same for database related operation

    Kindly guide

    .NET (Core and Framework) database asp-net architecture help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups