ASP.NET When page edit Dropdown get value returning issue?
ASP.NET When page edit Dropdown get value returning issue?
I have a these two table for Dropdown
Db.Aletler: Id - Ad
Db.Setaletler: Id - AletID
Sample
When save dropdown insert values in Db.Setaletler table
Code
public static List<Aletler> GetAlets()
{
using (CATSDDEntities db = new CATSDDEntities())
{
var getallusedAlet = db.Setalets.ToList().Select(s => s.AletId).ToList();
return db.Aletlers.Include(s => s.AletAD).Where(s => !getallusedAlet.Contains(s.Ad)).ToList();
}
}
it working good now but when ı do edit go any data create page problem here not get values existing saved values. this time it does not get in dropdown when I enter the edit page for the registered items
you'll see above I am updating
– Epelden
Jun 30 at 0:23
Check LINQ
Where
method.– Shyju
Jun 30 at 0:26
Where
I've already checked and I can not find a clear solution to this question ask here maybe you can do sample for it
– Epelden
Jun 30 at 0:31
The code you shared is returning a list of Products. Are you trying to exclude the Product With ID
5
?– Shyju
Jun 30 at 0:36
5
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
How are you populating the dropdown items ? You can exclude items there
– Shyju
Jun 30 at 0:18