Each super student has a Unique ID,this super student can insert records using his iD too.when he logs in,their is a dropdown whereby it has a list of other super students in that role of Staff,He can select any item in the dropdown i.e other super student and he will see the list of items of that particular Super student.Am getting the StudentId by this code MembershipUser user = Membership.GetUser(Page.User.Identity.Name);
int StudentId = manageStudents.GetStudentId((Guid)user.ProviderUserKey);
This is the StudentID the super student adds records.
public int GetStudentId(Guid studentId)
{
try
{
return db.Students.FirstOrDefault(x => x.UseId == studentId).StudentId;
}
catch (Exception)
{
throw;
}
On loggin in ,the dropdowns are populating data according to the selected item,I need to restrict it such that on logging in,the ID of the currently logged in user is tracked such that what is in the dropdown is data which was added using that paricular id.
I have a table called Students whereby StudentID is the foreign Key to the table called Adminstrators where AdminstratorId is the Primary Key
Each of Adminstrators can have several "super students" and this super students can add now new records of student using their Ids,
Mark as answer if satisfied
Jopito, if this helps please login to Mark As Answer. | Alert Moderator