473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

refresh an updatePanel in an other updatePanel

Hye,
I've got some problems in developping web sites with Visual Studio
2005 (ASP.net & C#) and the Microsoft Ajax library.

In my webpage

default.aspx

I've got 2 update panels

The 1rst contains all my components (labels, textboxes, a combobox and
a 2nd update panel)
The 2nd update panel contains a single combobox.

The interest is when I change the first combobox index, the 2nd (which
is in the 2nd update panel).

But when I execute my program :
I select an item in my first combo, and it refresh my second with
right values.
But when I select another item, the program does'nt do
MyfirstCombo_OnSelectedIndexChanged and it does'nt refresh up2
In aspx page :

<asp:UpdatePanel id="up1" runat="server" UpdateMode="Conditional">
<contenttemplate>
.....
<asp:combobox ID="MyfirstCombo" runat="server">
<asp:UpdatePanel id="up2" runat="server"
UpdateMode="Conditional">
<contenttemplate>
<asp:combobox ID="MySecondCombo"
runat="server">
</contenttemplate>
<triggers>
<asp:AsyncPostBackTrigger ControlID="MyfirstCombo"
EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
</triggers>
</asp:UpdatePanel>

<triggers>
<asp:AsyncPostBackTrigger ControlID="MyButton"
EventName="Click"></asp:AsyncPostBackTrigger>
</triggers>
</contenttemplate>
<asp:Button ID="MyButton" runat="server" OnClick="MyButton_Click" />
</asp:UpdatePanel>
In aspx.cs page :

MyfirstCombo.SelectedIndexChanged += new
combobox.SelectedIndexChangedHandler(MyfirstCombo_ OnSelectedIndexChanged);

Please, Have you go a solution ?

Aug 6 '07 #1
3 4726
<fr*********@yahoo.frwrote...
Please, Have you go a solution ?
Try setting the following property:

AutoPostBack = True

to the first control which will cause the population on the second control.

There's an article here for you, but its in vb rather than c#...

<http://www.singingeels.com/Articles/Populating_Related_Drop_Down_Lists_With_AJAX.aspx>

Regards

Rob
Aug 6 '07 #2
<Rob Meadewrote...
AutoPostBack = True
...
<http://www.singingeels.com/Articles/Populating_Related_Drop_Down_List...>

Thanks a lot, It works !!!!!

I put the 2 comboBoxes in the same update panel and I put
autoPostBack="true" in the 1rst comboBox.
I set ChildrenAsTriggers="false".

Regards

Akuma

Aug 6 '07 #3
<fr*********@yahoo.frwrote ...
Thanks a lot, It works !!!!!
You're welcome :o)

Regards

Rob
Aug 8 '07 #4

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

Similar topics

0
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
0
by: wiertara | last post by:
Hi, i have a problem with refreshing data in UpdatePanel. In aspx file i have a AjaxToolKit TabContainer and inside it a UpdatePanel: <asp:UpdatePanel ID="upRemoveUser" runat="server"...
1
by: =?Utf-8?B?cml2YWxAbmV3c2dyb3Vwcy5ub3NwYW0=?= | last post by:
Morning, I've still got an issue with an AJAX enabled site. I've a master page with two ContentPlaceholders. I've then got a default aspx page which contains several user controls I've...
3
by: =?Utf-8?B?T2xlZw==?= | last post by:
(in .NET 2.0 with AJAX extensions) I have an UpdatePanel on the form. Now I want to use a link outside of my UpdatePanel to make it to update (asynchronously) and also send some(at least one )...
0
by: Barno77 | last post by:
Hi Everyone, I have a Gridview in a UpdatePanel and everytime I click Edit button to edit a row of data in Gridview, the page refreshes. Would like to not Refresh page everytime! Any...
4
by: pechar | last post by:
Hi All, This question has been asked many times and I've checked most of the sites with resolutions. None worked for me. 1) I have a page which is a content page to a Masterpage . 2) I have a...
1
by: abcd | last post by:
I have a master page which has Script Manager declared. I have content page TestContent.aspx, it includes User Controls (.ascx) called FirstControl.ascx. FirstControl.ascx includes another...
4
by: Peter | last post by:
ASP.NET 3.5 I have a web page and this web page has a DataList, when user hovers the mouse over a picture in the datalist a popup appers, this popup is a User Control and it has a cancel button....
2
by: qwedster | last post by:
Folks! The following is a "Hello World" kind of code for ViewState. I just want to know how to retain the ViewState 1) while Page Refresh when using UpdatePanel and also 2) While I reverting back...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.