Hi,
I have strange problem.
I initialize some values in session after click on selected row in grid view.
it is working fine.
But when two or more users (* All have different machines and different user) click on different rows of grid view than values of all session will assign to other users.
for example if usser1 and user2 click on gridview on same time than all sessions of user1 will assign to user2 that mean user2 now have all credentials of user1.
but when i added thread.sleep(500) just before the initialization of session than it is working fine.
can anyone enlighten me the problem how i can stop sharing of sessions?
Sample code for better understanding :
1)
Class:-
namespace ABC.ZXY
{
[Serializable]
public class Employee
{
public Employee();
public Employee(EntAhsviresourcesRow row);
public Employee(EntEgemAhsresourcesRow row);
public AgressoAddress Address { get; set; }
public string AparGrId { get; set; }
}
}
2)
Grid View event "SelectedIndexChanging"
protected void grvEmployeeSearch_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
Employee resource = (Employee)grvEmployeeSearch.DataKeys[e.NewSelectedIndex].Value;
if (resource != null)
{
resource = ec.GetEmployeePositionsByEmployee(resource, Client);
SelectedResource = resource;
Session["Resource"] = resource;
Response.Redirect("Resource.aspx");
}
.
.
.
}
3)
On resource.aspx page:
Employee ResourceFromSearch
protected void Page_Load(object sender, EventArgs e)
{
ResourceFromSearch = (Employee)Session["Resource"];
}
Now on Resource.aspx we got invalid session.( Not only this session but all sessions)
Regards