PC Review


Reply
Thread Tools Rate Thread

Ajax DropDownList

 
 
Chris Fink
Guest
Posts: n/a
 
      10th Mar 2008
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
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      11th Mar 2008
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)

Chris Fink wrote:
> 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

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      11th Mar 2008
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>
<aspropDownList ...>
<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" <(E-Mail Removed)> wrote in message
news:%236lBE%(E-Mail Removed)...
> 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)
>
> Chris Fink wrote:
>> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
postback question with 2 dropdownlist and AJAX ton Microsoft ASP .NET 0 22nd Apr 2009 04:44 PM
Ajax UpdatePanel DropDownList auto-repeat problem. cmeek1_1999 Microsoft ASP .NET 3 27th Sep 2008 03:07 PM
AJAX ModalPopup To Confirm Dropdownlist Change Ben Microsoft ASP .NET 2 16th Mar 2008 01:40 PM
Ajax DropDownList AutoPostBack only fires second time Med Microsoft ASP .NET 0 5th Dec 2007 02:02 AM
Dropdownlist and OnMouseover Event using Ajax =?Utf-8?B?RGVlcGE=?= Microsoft ASP .NET 3 1st Apr 2007 08:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:00 AM.