Posts

Showing posts from February, 2025

Bind A DropDownList With Another DropDownList In ASP.NET Web Forms

Image
 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Configuration; using System.Data; namespace BindingDDL {     public partial class WebForm1 : System.Web.UI.Page     {         string cs = ConfigurationManager.ConnectionStrings["dbcs"].ConnectionString;         protected void Page_Load(object sender, EventArgs e)         {             if (!IsPostBack)             {                 BindCountryDDL();             }         }         void BindCountryDDL()         {             SqlConnection con = new SqlConnection(cs);             st...

AJAX Method Of jQuery AJAX In ASP.NET Web Forms | Learn ASP.NET Web Forms

Image
 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Web.UI; using System.Web.UI.WebControls; using System.Threading; using System.Data.SqlClient; using System.Configuration; using System.Data; namespace ajax_method {     public partial class WebForm1 : System.Web.UI.Page     {         static string cs = ConfigurationManager.ConnectionStrings["dbcs"].ConnectionString;         protected void Page_Load(object sender, EventArgs e)         {         }         [WebMethod]         public static string Getdata(string uname,string surname)         {             //Thread.Sleep(2000); //Here, 2000 milliseconds = 2 seconds will delay             ////Above Web service(OR Attribute) "[WebMethod]" is used to...

Load Method Of jQuery AJAX | jQuery AJAX In ASP.NET Web Forms | Learn ASP.NET

Image
 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Load_Method.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title></title> </head> <body>     <form id="form1" runat="server">         <div>             <input type="button" id="btn" value="Click to Get Data"/>             <br/>             <div id="result">             </div>         </div>     </form>     <script src="scripts/JQuery.js"></script>     <script>         $(document).ready(function () {             $("#btn").click(function () {           ...

Implement Remember Me Functionality In ASP.NET Web Forms | Learn ASP.NET

Image
 using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Text; namespace RememberMeCheckBoxAsp {     public partial class Login : System.Web.UI.Page     {         string cs = ConfigurationManager.ConnectionStrings["dbcs"].ConnectionString;         protected void Page_Load(object sender, EventArgs e)         {             if (!IsPostBack)             {                 //To retrieve data from cookie, "Request" class is used                 //To send data to cookie, "Response" class is used                 if (Request.Cookies["username"] != null)     ...