Confused about databinding and event order

L

Larry Bud

Newbie here, so be gentle.

I've tried writing this page a variety of ways, but can't get this to
work.

I have a drop down with monetary exchange rates.
I have a table with a bunch of columns (>20) being returned.
I bind the table to a FormView.

Wonderful

Now, I want to modify the dollars by multiplying it with the exchange
rate value. So I wrote a property function:

ReadOnly Property getCurrency() As String
Get
Dim curr As String
Dim dd As DropDownList

dd = FormView1.FindControl("currency_code")
curr = dd.SelectedItem.ToString

Return curr
End Get
End Property

For giggles (and testing) I have a label control which normally would
be databound, but since it wasn't working, I'm just displaying the
value of getCurrency() (which is why getCurrency is now returning a
string)

<asp:Label ID="Label1" runat="server" Text='<%# getCurrency()
%>'></asp:Label>

What happens is that the Label1 gets populated the first time, but as I
change the dropdown value, it's as if getCurrency never runs again. I
don't get it.
 
B

bruce barker

databinding happens when you call databind. you should re-databind the
label after a change in dropdown.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top