Link to home
Start Free TrialLog in
Avatar of udir
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(LogGetField);
          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
Avatar of discon0
discon0
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of udir
udir

ASKER

Hi,
Yha thats can be a good Idea   :)
Thanks
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();