Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# - Convert Pixels ( X & Y ) points to Longitude and Latitude Pin
V.17-Jun-18 21:45
professionalV.17-Jun-18 21:45 
GeneralRe: C# - Convert Pixels ( X & Y ) points to Longitude and Latitude Pin
Nathan Minier18-Jun-18 2:03
professionalNathan Minier18-Jun-18 2:03 
QuestionHow can I deserialize different XML files in a list/Array? Pin
SebGM201817-Jun-18 14:51
SebGM201817-Jun-18 14:51 
AnswerRe: How can I deserialize different XML files in a list/Array? Pin
Mycroft Holmes17-Jun-18 20:54
professionalMycroft Holmes17-Jun-18 20:54 
AnswerRe: How can I deserialize different XML files in a list/Array? Pin
Richard MacCutchan17-Jun-18 21:43
mveRichard MacCutchan17-Jun-18 21:43 
QuestionHandling Extraparam From jQGrid In MVC Controller Method Pin
MadDashCoder15-Jun-18 13:03
MadDashCoder15-Jun-18 13:03 
AnswerRe: Handling Extraparam From jQGrid In MVC Controller Method Pin
Richard MacCutchan15-Jun-18 21:19
mveRichard MacCutchan15-Jun-18 21:19 
QuestionNeed to compare textbox with list created by me and then redirect somewhere if successful. Pin
Dhruv Nunia14-Jun-18 0:58
Dhruv Nunia14-Jun-18 0:58 
I have written a code. But don't know where is the error. Please help.

<pre lang="c#"><pre>using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GridView
{
    public partial class practise : System.Web.UI.Page
    {
       public static List<User> listuser = new List<User>()
       {
                new User() {ID = 1, UserName = "Dhruv", Password = "hello"},
                new User() {ID = 2, UserName = "Gaurav", Password = "12345"},
                new User() {ID = 3, UserName = "Rahul", Password = "asdfg"},
                new User() {ID = 4, UserName = "Guru", Password = "qwerty"}
       };

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                listuser = new List<User>();
                GRIDDATA.DataSource = listuser;
                GRIDDATA.DataBind();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)

        {

            User data = new User();
            data.UserName = TextBox1.Text;
            data.Password = TextBox2.Text;
            //listuser.Add(data);

            bool UserExists(string userName, string password)
            {
                return listuser.Any(a => a.UserName.Equals(userName, StringComparison.CurrentCultureIgnoreCase) && a.Password.Equals(password));
            }

            if(UserExists(data.UserName, data.Password))
            {
                
                Response.Redirect("https://www.googel.com");
            }
        }
    }


    public class User
    {   
        public int ID { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }   
    }
}

AnswerRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
Eddy Vluggen14-Jun-18 2:23
professionalEddy Vluggen14-Jun-18 2:23 
GeneralRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
Richard Deeming14-Jun-18 2:30
mveRichard Deeming14-Jun-18 2:30 
GeneralRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
Eddy Vluggen14-Jun-18 2:56
professionalEddy Vluggen14-Jun-18 2:56 
GeneralRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
#realJSOP17-Jun-18 5:09
mve#realJSOP17-Jun-18 5:09 
GeneralRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
Eddy Vluggen17-Jun-18 7:01
professionalEddy Vluggen17-Jun-18 7:01 
GeneralRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
#realJSOP17-Jun-18 7:03
mve#realJSOP17-Jun-18 7:03 
GeneralRe: Need to compare textbox with list created by me and then redirect somewhere if successful. Pin
Eddy Vluggen17-Jun-18 7:10
professionalEddy Vluggen17-Jun-18 7:10 
QuestionC# Process Start Time & Run Duration. Pin
Member 1387227913-Jun-18 21:51
Member 1387227913-Jun-18 21:51 
AnswerRe: C# Process Start Time & Run Duration. Pin
BillWoodruff13-Jun-18 22:33
professionalBillWoodruff13-Jun-18 22:33 
AnswerRe: C# Process Start Time & Run Duration. Pin
Jochen Arndt13-Jun-18 23:28
professionalJochen Arndt13-Jun-18 23:28 
Questionhelp plz Pin
Member 1387054413-Jun-18 19:34
Member 1387054413-Jun-18 19:34 
AnswerRe: help plz Pin
Eddy Vluggen14-Jun-18 0:39
professionalEddy Vluggen14-Jun-18 0:39 
AnswerRe: help plz Pin
User 418025414-Jun-18 7:00
User 418025414-Jun-18 7:00 
QuestionRe: help plz Pin
Gerry Schmitz14-Jun-18 7:45
mveGerry Schmitz14-Jun-18 7:45 
AnswerRe: help plz Pin
#realJSOP17-Jun-18 5:11
mve#realJSOP17-Jun-18 5:11 
AnswerRe: help plz Pin
aparnalakshmi17-Jul-18 1:04
aparnalakshmi17-Jul-18 1:04 
QuestionHow can I deserialize/Load Different XML files? Pin
SebGM201813-Jun-18 17:38
SebGM201813-Jun-18 17:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.