Hi I am using ajax based autocompl开发者_高级运维ete combobox in asp.net by official Microsoft Ajaxtoolkit, I am fetching three attributes behind it, one is its text, second is its value, third is another attribute related to each value, coming from database, i can access value and text, but cant access the third attribute from it, is there any option to do so, like we do SelectedItem.Value to get value, SelectedItem.Text for text, for any other attribute, what we can do?
Many Thanks Atif
you can do that by appending the third attribute with the value part
what i mean is when you are fetching the value from database con cat both the values with a separator and split it.
for sql server concatenating use this link
http://msdn.microsoft.com/en-us/library/ms177561%28v=sql.90%29.aspx
You can set the attributes value of Dropdown from codebehind using "key" "Value" combination, please check below syntax:
To set:
ddl.Attributes.Add("key", "value");
To Fetch:
string val = ddl.Attributes["key"].ToString();
You have to use this key and value according to your logic and condition.
精彩评论