How to return a message from my repository class to my controller and then to my view in asp.net-mvc
Posted
by Pandiya Chendur
on Stack Overflow
See other posts from Stack Overflow
or by Pandiya Chendur
Published on 2010-05-17T06:01:34Z
Indexed on
2010/05/17
6:30 UTC
Read the original article
Hit count: 219
I use this for checking an existing emailId in my table and inserting it...It works fine how to show message to user when he tries to register with an existing mailId....
if (!taxidb.Registrations.Where(u => u.EmailId == reg.EmailId).Any())
{
taxidb.Registrations.InsertOnSubmit(reg);
taxidb.SubmitChanges();
}
and my controller has this,
RegistrationBO reg = new RegistrationBO();
reg.UserName = collection["UserName"];
reg.OrgName = collection["OrgName"];
reg.Address = collection["Address"];
reg.EmailId = collection["EmailId"];
reg.Password = collection["Password"];
reg.CreatedDate = System.DateTime.Now;
reg.IsDeleted = Convert.ToByte(0);
regrep.registerUser(reg);
Any sugesstion how to show "EmailID" already exists to the user with asp.net mvc...
© Stack Overflow or respective owner