S
Sam Solomon
Dear All,
I am trying to retrieve the value of a DataList cell in a label and assign
it to a Session Variable. For this purpose I am using a method :
private void OpenForm(object strDate,object
strScore,DataListCommandEventArgs f)
{
if((f.Item.ItemType==ListItemType.Item)||(f.Item.ItemType==ListItemType.Item))
{
Label lblDate=((Label)f.Item.FindControl("lblActivityDate"));
lblDate.Text =(string)DataBinder.Eval( f.Item.DataItem,"ActivityDate" );
strDate =lblDate.Text;
Label lblScore=((Label)f.Item.FindControl("lblActivityScore"));
lblScore.Text =(string)DataBinder.Eval( f.Item.DataItem,"Score" );
strScore =lblDate.Text;
}
Below is the code where it is implementated
protected void dgdActivities_ItemCommand(Object s,DataListCommandEventArgs e)
{
OpenForm(Session["BDate"],Session["BScore"],e);
}
However for some reason Session["BDate"]ToString() and
Session["BScore"].ToString() are both NULL. I have debugged the code and I
can see that parameters strDate and strScore
both NULL values. Why is it ?. Are you not allowed to pass session
variables as method parameters.
Kindly help.
cheers,
Sam Solomon
I am trying to retrieve the value of a DataList cell in a label and assign
it to a Session Variable. For this purpose I am using a method :
private void OpenForm(object strDate,object
strScore,DataListCommandEventArgs f)
{
if((f.Item.ItemType==ListItemType.Item)||(f.Item.ItemType==ListItemType.Item))
{
Label lblDate=((Label)f.Item.FindControl("lblActivityDate"));
lblDate.Text =(string)DataBinder.Eval( f.Item.DataItem,"ActivityDate" );
strDate =lblDate.Text;
Label lblScore=((Label)f.Item.FindControl("lblActivityScore"));
lblScore.Text =(string)DataBinder.Eval( f.Item.DataItem,"Score" );
strScore =lblDate.Text;
}
Below is the code where it is implementated
protected void dgdActivities_ItemCommand(Object s,DataListCommandEventArgs e)
{
OpenForm(Session["BDate"],Session["BScore"],e);
}
However for some reason Session["BDate"]ToString() and
Session["BScore"].ToString() are both NULL. I have debugged the code and I
can see that parameters strDate and strScore
both NULL values. Why is it ?. Are you not allowed to pass session
variables as method parameters.
Kindly help.
cheers,
Sam Solomon