467,118 Members | 994 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,118 developers. It's quick & easy.

FormView DropdownList - On Selection Change populate Text Box

C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.

Mar 28 '08 #1
  • viewed: 3750
Share:
5 Replies
The selectIndexChanged event absolutely should fire. However, if you are
expecting it to cause a postback when you change the selection, you need to
set the AutoPostback property= true in the properties for this control.

Once you have got the event fireing its jsut a matter of writing your code
based on the selected index data.

HTH


"Satish" <Sa****@discussions.microsoft.comwrote in message
news:1E**********************************@microsof t.com...
C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.

Mar 28 '08 #2
Nope, tried adding code in SelectionIndexChanged Event and even tried with
the Debugger, nothing.

"Satish" wrote:
C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.
Mar 28 '08 #3

Does your page_load event fire ?, if not, check that your Autowireup event
is set to true. Also, you didnt comment on the Autopostback I mentioned have
you checked this.

Whatever you problem is, its likely to be very basic.

"Satish" <Sa****@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
Nope, tried adding code in SelectionIndexChanged Event and even tried with
the Debugger, nothing.

"Satish" wrote:
>C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.

Mar 28 '08 #4
Should read "Autowireup" @page property
"Just Me" <news.microsoft.comwrote in message
news:Oi*************@TK2MSFTNGP04.phx.gbl...
>
Does your page_load event fire ?, if not, check that your Autowireup event
is set to true. Also, you didnt comment on the Autopostback I mentioned
have you checked this.

Whatever you problem is, its likely to be very basic.

"Satish" <Sa****@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
>Nope, tried adding code in SelectionIndexChanged Event and even tried
with
the Debugger, nothing.

"Satish" wrote:
>>C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.


Mar 28 '08 #5
Page load fires, regardless of Postback - true/false.

However, the selectionindexchanged event just does not fire.
I read thru the AutoEventWireup attribute and made sure that it is set to
true everywhere, webconfig as well as the aspx page itself.

I am also using VS2008.

"Just Me" wrote:
Should read "Autowireup" @page property
"Just Me" <news.microsoft.comwrote in message
news:Oi*************@TK2MSFTNGP04.phx.gbl...

Does your page_load event fire ?, if not, check that your Autowireup event
is set to true. Also, you didnt comment on the Autopostback I mentioned
have you checked this.

Whatever you problem is, its likely to be very basic.

"Satish" <Sa****@discussions.microsoft.comwrote in message
news:66**********************************@microsof t.com...
Nope, tried adding code in SelectionIndexChanged Event and even tried
with
the Debugger, nothing.

"Satish" wrote:

C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.


Mar 31 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bas Paap | last post: by
11 posts views Thread by Santosh | last post: by
reply views Thread by jobs at webdos | last post: by
reply views Thread by Theam Kok Ming | last post: by
3 posts views Thread by J055 | last post: by
reply views Thread by mkidd | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.