G
Gerald
Hi,
Is it possible to do some action on the value that will be the
DataValueField of a listbox?
I have a listbox with a list of item. But I would like to encode the value
ID that the client will see in the html.
There is no way to do that on the database, it has to be done on the .net
side.
For instance:
I have
SearchID.DataSource = oReader;
SearchID.DataValueField = "Value";
SearchID.DataTextField = "Text";
SearchID.DataBind ();
And I would like to have something like:
SearchID.DataSource = oReader;
SearchID.DataValueField = EncodeID("Value");
SearchID.DataTextField = "Text";
SearchID.DataBind();
EncodeID being whatever you want, just a simple function.
I dont want to loop through anything and would like if possible to keep the
databinding stuff.
Another option would be to response.write the listitem, but again, I want to
keep the four lines there and apply a function to it.
Thanks for your help.
Gerald
Is it possible to do some action on the value that will be the
DataValueField of a listbox?
I have a listbox with a list of item. But I would like to encode the value
ID that the client will see in the html.
There is no way to do that on the database, it has to be done on the .net
side.
For instance:
I have
SearchID.DataSource = oReader;
SearchID.DataValueField = "Value";
SearchID.DataTextField = "Text";
SearchID.DataBind ();
And I would like to have something like:
SearchID.DataSource = oReader;
SearchID.DataValueField = EncodeID("Value");
SearchID.DataTextField = "Text";
SearchID.DataBind();
EncodeID being whatever you want, just a simple function.
I dont want to loop through anything and would like if possible to keep the
databinding stuff.
Another option would be to response.write the listitem, but again, I want to
keep the four lines there and apply a function to it.
Thanks for your help.
Gerald