Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET AJAX

Reply
Thread Tools

ASP.NET AJAX

 
 
Ganesha
Guest
Posts: n/a
 
      05-14-2008
Hi,
I am new to AJAX and was trying to do the following. I want to update one
dropdownlist based on the selection in the other dropdownlist. I want it to
postback partially.
My code looks as follows:
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<aspropDownList ID="DropDownList1" runat="server"
DataTextField="fieldname" DataValueField="fieldname" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedInde xChanged">
</aspropDownList>

<aspropDownList ID="DropDownList2" runat="server"
DataTextField="Text" DataValueField="Val">
</aspropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>

When i click on Dropdownlist1 it posts back and works fine but the
IsInAsyncPostBack property of script manager will be set to false. As per my
knowledge it should be set to true for partial postback. Can anyone please
let me know why this propery is set to false. what am i doing wrong.

Thanks


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      05-14-2008
while the update panel can be used for this its a bad choice. why is it bad?
your code is rerendering all the content in the panel on every click of the
dropdown, including the control with focus. try hitting the up/down arrows
while the focus is on DropDownList1. also if you site runs on the internet,
there can be a couple second delay before the response.

the correct way to code this is to use client code attached to the dropdown.
when the index changes, disable the second dropdown, give some loading feed
back to the user, start an async web service call to get the new values. on
request complete, load the second drop down and enable. be sure to handle
case when a second request happens before the first completes.


-- bruce (sqlwork.com)


"Ganesha" wrote:

> Hi,
> I am new to AJAX and was trying to do the following. I want to update one
> dropdownlist based on the selection in the other dropdownlist. I want it to
> postback partially.
> My code looks as follows:
> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
> <ContentTemplate>
> <aspropDownList ID="DropDownList1" runat="server"
> DataTextField="fieldname" DataValueField="fieldname" AutoPostBack="True"
> OnSelectedIndexChanged="DropDownList1_SelectedInde xChanged">
> </aspropDownList>
>
> <aspropDownList ID="DropDownList2" runat="server"
> DataTextField="Text" DataValueField="Val">
> </aspropDownList>
> </ContentTemplate>
> <Triggers>
> <asp:AsyncPostBackTrigger ControlID="DropDownList1"
> EventName="SelectedIndexChanged" />
> </Triggers>
> </asp:UpdatePanel>
>
> When i click on Dropdownlist1 it posts back and works fine but the
> IsInAsyncPostBack property of script manager will be set to false. As per my
> knowledge it should be set to true for partial postback. Can anyone please
> let me know why this propery is set to false. what am i doing wrong.
>
> Thanks
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
An Ajax Dictionary... My first AJAX project... GreatDomainz@gmail.com HTML 20 03-31-2008 01:24 PM
Deploying ASP.NET AJAX-Enabled Web site to host without AJAX insta =?Utf-8?B?QnJpYW4gRWR3YXJkcw==?= ASP .Net 2 02-21-2007 10:22 PM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
Ajax installed.. where are Ajax controls like popup in my VS toolbox ?? jobs ASP .Net 0 11-06-2006 01:23 AM
beginner AJAX questions (AJAX.net) darrel ASP .Net 5 04-28-2006 06:42 PM



Advertisments