Gezna
asked on
.Net 2.0 datatextfield and object datasource
Hi,
I have a dropdown list that is being populated by an object datasource (.net 2.0)
The problem is that the datavaluefield is dependent on the user's language, so I need a way to get either a public value from the .vb page, or at a function or something, but nothing seems to work.
Basically if the public variable strLang = e then I want strDescE and if strLang = f then I want strDescF. Is there a way to do this with the new datasourceid field already set???
<asp:DropDownList ID="ddlDistrict" DataSourceID="ObjectDataSo urceDistri ct" runat="server" DataTextField="intDistrict cd" DataValueField="strDescE" AutoPostBack="True" >
</asp:DropDownList>
I have a dropdown list that is being populated by an object datasource (.net 2.0)
The problem is that the datavaluefield is dependent on the user's language, so I need a way to get either a public value from the .vb page, or at a function or something, but nothing seems to work.
Basically if the public variable strLang = e then I want strDescE and if strLang = f then I want strDescF. Is there a way to do this with the new datasourceid field already set???
<asp:DropDownList ID="ddlDistrict" DataSourceID="ObjectDataSo
</asp:DropDownList>
ASKER
It is a public variable on the codebehind that is set from the session.
The session variable could be used directly, I don't care. Basically I just need a way to say
datatextfield="if strlang='f' then strDescF else strDescE"
'Code behind
Public strLang as String
strLang = Session("headStrLang")
The session variable could be used directly, I don't care. Basically I just need a way to say
datatextfield="if strlang='f' then strDescF else strDescE"
'Code behind
Public strLang as String
strLang = Session("headStrLang")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ha, ha, I tried exactly that, except I was saying .datavaluefield. no wonder
Bob