Advertisement
yuvarajupadhyaya

Get data from another page

Aug 17th, 2022
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | Source Code | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7.  
  8. namespace WebFormApplication
  9. {
  10.     public partial class Validate : System.Web.UI.Page
  11.     {
  12.         protected void Page_Load(object sender, EventArgs e)
  13.         {
  14.             //before getting data dont forget to put postbackurl of this page in previuos page button property
  15.             string username = ((TextBox)PreviousPage.FindControl("txtUsername")).Text;
  16.             string password= Request.Form["txtPassword"];
  17.             if(username=="admin" && password=="admin")
  18.             {
  19.                 Response.Write("Login Successfuly");
  20.             }
  21.             else
  22.             {
  23.                 Response.Write("Invalid Login");
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement