Link to home
Start Free TrialLog in
Avatar of Gezna
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="ObjectDataSourceDistrict" runat="server" DataTextField="intDistrictcd" DataValueField="strDescE" AutoPostBack="True" >
                    </asp:DropDownList>
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

How does strLang get set?

Bob
Avatar of Gezna
Gezna

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")

 
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America 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 Gezna

ASKER

ha, ha, I tried exactly that, except I was saying .datavaluefield. no wonder