Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ajax DropDownList

1 view
Skip to first unread message

Chris Fink

unread,
Mar 10, 2008, 4:00:01 PM3/10/08
to
I have a general question regarding VS2008 and Ajax Toolkit 3.5.

Currently I have a dropdownlist populated from the database. When the user
selects and item, the OnSelectedIndexChanged event fires (does a postback to
the server) and then loads the selected item's value into an asp:textbox
control. Using the Ajax toolkit, I'd like to perform this same
functionality, but without the entire page posting back. I'm looking for
suggestions on how to do this or any links to examples. Thank You

bruce barker

unread,
Mar 10, 2008, 8:33:22 PM3/10/08
to
no ajax or postback is required for this, just a simple one liner in
javascript. (server side could be one line also)


string script = myTextBox.ClientID + ".value=this.value;";
myDropdown.Attributes["onchange"] = script;

-- bruce (sqlwork.com)

Eliyahu Goldin

unread,
Mar 11, 2008, 5:56:56 AM3/11/08
to
If for whatever reason you do need to go to server, you don't need the
Toolkit. Rather use standard ajax controls that come out of box with VS2008:

<asp:ScriptManager ID="ScriptManager" runat="server" />
<asp:UpdatePanel runat="server" ID="UpdatePanel">
<ContentTemplate>
<asp:DropDownList ...>
<asp:TextBox ...>
</ContentTemplate>
</asp:UpdatePanel>

Program the server side in a regular way.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"bruce barker" <nos...@nospam.com> wrote in message
news:%236lBE%23wgIH...@TK2MSFTNGP02.phx.gbl...

0 new messages