udir
asked on
CommandArgument and Dictionary...
Hi,
I built an Click Event for Button and i need to pass to another function A Dictionary.
The Event :
protected Dictionary<string, object> LogGetField;
protected void submitButton_Click(object sender, CommandEventArgs e)
{
LogGetField = GetValues();
UpdateDataGridCondition(Lo gGetField) ;
Button bt = new Button();
bt.CommandName = "ButtonClicked";
bt.CommandArgument = LogGetField; ------------------>>> HERE IS THE PROBLEM
}
OK, the problem is that i need to pass a Dictionary, and bt.CommandArgument gets a string.
Is it possible to let the bt.CommandArgument have a Dictionary ?
Thanks
I built an Click Event for Button and i need to pass to another function A Dictionary.
The Event :
protected Dictionary<string, object> LogGetField;
protected void submitButton_Click(object sender, CommandEventArgs e)
{
LogGetField = GetValues();
UpdateDataGridCondition(Lo
Button bt = new Button();
bt.CommandName = "ButtonClicked";
bt.CommandArgument = LogGetField; ------------------>>> HERE IS THE PROBLEM
}
OK, the problem is that i need to pass a Dictionary, and bt.CommandArgument gets a string.
Is it possible to let the bt.CommandArgument have a Dictionary ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi, just an addition...
I was thinking that using LogGetField.GetHashCode() for the key may not be the best way because it doesn't guarantee uniqueness. It may be better to append a random number at the end or a Guid like Guid.NewGuid().ToString();
I was thinking that using LogGetField.GetHashCode() for the key may not be the best way because it doesn't guarantee uniqueness. It may be better to append a random number at the end or a Guid like Guid.NewGuid().ToString();
ASKER
Yha thats can be a good Idea :)
Thanks