473,466 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

UpdatePanel and Dropdown List

I have an UpdatePanel with a dropdown list that I can't seem to get to
update. It has a hidden button which I click from javascript added to the
page when another update panel is updated. Triggers didn't work for this that
is why I'm using the script.

The script is registered with...
ScriptManager.RegisterStartupScript(Page, GetType(), "Update",
String.Format("$get('{0}').click();", buttontoclick.ClientID), true);

<asp:UpdatePanel ID="panel" UpdateMode="Conditional"
ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<asp:Button ID="dropdownButton" runat="server" Style="display:
none;" OnClick="dropdown_Click" />
<asp:DropDownList ID="dropdown" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>

The code all executes and the data for the drop down is updated but it is
never rendered to the page. I put a text box in the panel just to see if
anything was getting updated and it wasn't.

I have another update panel that is updated in similar fashion to this but
its datasource is a repeater. It has the same issue. The data is updated but
never rendered.

I have other update panels on the page and they update just fine. I'm not
sure what the problem with these two panels are.
Nov 20 '07 #1
1 3164
I figured out a work around. If I call window.setTimeout with a wait of 3
seconds before I click the button, the panel updates. I think it has
something to do with the script loader. Scripts have to be fully loaded
before I can do another post back.

"Stormbringer" wrote:
I have an UpdatePanel with a dropdown list that I can't seem to get to
update. It has a hidden button which I click from javascript added to the
page when another update panel is updated. Triggers didn't work for this that
is why I'm using the script.

The script is registered with...
ScriptManager.RegisterStartupScript(Page, GetType(), "Update",
String.Format("$get('{0}').click();", buttontoclick.ClientID), true);

<asp:UpdatePanel ID="panel" UpdateMode="Conditional"
ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<asp:Button ID="dropdownButton" runat="server" Style="display:
none;" OnClick="dropdown_Click" />
<asp:DropDownList ID="dropdown" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>

The code all executes and the data for the drop down is updated but it is
never rendered to the page. I put a text box in the panel just to see if
anything was getting updated and it wasn't.

I have another update panel that is updated in similar fashion to this but
its datasource is a repeater. It has the same issue. The data is updated but
never rendered.

I have other update panels on the page and they update just fine. I'm not
sure what the problem with these two panels are.

Nov 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
0
by: Prashant Majhwar | last post by:
<atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <contenttemplate> <-------webpartcontro------l> </contenttemplate> </atlas:UpdatePanel> My webpart contains a dropdown list and...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
4
by: Rob Meade | last post by:
Hi all, Ok - this might sound kinda stupid - but I cant see how to do it... I've got an update panel which contains, on one horizontal line, a drop down list, then an image, then another drop...
0
by: Frank | last post by:
Hi, I have read the other post about hiding the updatepanel using the ajax lifecycle as such at the end of the aspx page: <script type="text/javascript" language =javascript> var c = new...
1
by: Sam Samson | last post by:
Hi All, I am creating a asp.net tool that uses 2 graphs (chartFx Pie chart and ChartFx Barchart ) The effect I'd like to get is to have the Bar chart in an update panel and when a user clicks...
0
by: Marc | last post by:
"jacoberg2" <jacoberg2@hotmail.comwrote in message news:cdcbd57a-8736-464e-9c57-defedcd3c7ff@l42g2000hsc.googlegroups.com... Never heard of this before....! Are you sure it's not reloading the...
3
by: =?Utf-8?B?Y21lZWsxXzE5OTk=?= | last post by:
Hello, On a webpage, create an UpdatePanel with two DropDownLists. Set AutoPostBack of DropDownList1 to true. In the SelectedIndexChanged method, refill DropDownList2 and set the focus to...
8
by: Nick | last post by:
Hi there, I have a GridView in an UpdatePanel, each time the UpdatePanels Load event fires I set the DataSource and call DataBind of the grid view. This works great once, I add an item to the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.