how we validate in code behind using the xml file.

Posted by Jameschowdare under Regular Expressions on 1/27/2010 | Views : 1389 | Status : [Member] | Replies : 2
you have all the details at the logindetails.xml


but how we validate in code behind using the xml file.

and how to authenicate/validate the usr in xml file




Responses

Posted by: Abhi2434 on: 1/27/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Hey, I have already answered this.

Just check the username and password manually from the user entered values and put an Auth cookie in Session.

You might go for LINQ to select the particular record. Like

XDocument doc = XDocument.Load(path);

XElement elem = doc.Descendants().FirstOrDefault(item => item.Attribute('userid').Value.Equals(userid) && item.Attribute('passwd').Value.Equals(pass));
if(elem != null)
//success
else
//failed


Adjust the xml parse statements according to your own xml schema.
:)

www.abhisheksur.com

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 3/27/2010 [Member] Bronze

Up
0
Down
Hi friend

check following links


http://www.developer.com/tech/article.php/984901/article.htm


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response