M
mirlisa
I'm using an HtmlSelect (runat=sever).
I add the items programmatically and I also add a custom attribute to
each listitem because I need to track an additional field value.
I'm having a problem getting that attribute value upon postback. I keep
getting a null reference error. I was under the impression that the
attribute collection is saved in viewstate.
My code to get the attribute value is:
string val=
mySelect.Attributes["attrname"][mySelect.SelectedIndex].ToString();
What am I doing wrong?
Thanks.
Lisa
I add the items programmatically and I also add a custom attribute to
each listitem because I need to track an additional field value.
I'm having a problem getting that attribute value upon postback. I keep
getting a null reference error. I was under the impression that the
attribute collection is saved in viewstate.
My code to get the attribute value is:
string val=
mySelect.Attributes["attrname"][mySelect.SelectedIndex].ToString();
What am I doing wrong?
Thanks.
Lisa