Skip to main content

Posts

Showing posts from March, 2018

Login in asp.net using C# by webconfig file

Below is the code which will demonstrate how to design login functionality in asp.net using C# by with the help of web configuration file. Please note the login details are used as a static. The Web configuration file is:                                   The below is the design view of the project: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="ShoppingHeart.Admin.Login" %>                                                                                Style="font-weight: 700">                                 ...

Cookie example in C# Asp.net

Below is the program which will show you how to maintain user page visit counts for web page using cookies. After each manual page refresh the count goes on increasing. Here us the code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace cookie_example {     public partial class WebForm1 : System.Web.UI.Page     {         protected void Page_Load(object sender, EventArgs e)         {             int x = 0;             try             {                 HttpCookie c = Request.Cookies["mycookie"];                 if(c!= null)                 {                   ...

Maintain user page visit counts in C# asp.net

Below is the program which will show you how to maintain user page visit counts for web page. After each manual page refresh the count goes on increasing. Here us the code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace show_user_visit_count_demo {     public partial class WebForm1 : System.Web.UI.Page     {                     protected void Page_Load(object sender, EventArgs e)         {             int x = 0;             try             {                 if(Session["cnt"]==null)                 {                     x = 0;         ...