473,397 Members | 2,099 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,397 software developers and data experts.

ASP.NET C# Ajax: Problem getting UpdatePanel refresh

56
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 ScriptManager on the Masterpage.
3) On the content page I have a TabContainer control.
4) On one of the tabs I have a form, part of which (a FileUpload control) I set to disabled if a Checkbox is ticked.

So I decided to put an UpdatePanel around this FileUpload control and set a trigger for the Checkbox (which has Autopostback="true"). When stepping through the project the OnCheckChanged where the FileUpload is enabled/disabled is called but the UpdatePanel is not updating i.e. The FileUpload remains disabled.

Below is my code:
Expand|Select|Wrap|Line Numbers
  1. <asp:UpdatePanel ID="upnlAgentLogo" runat="server" UpdateMode="Conditional">
  2.     <ContentTemplate>
  3.       <tr>                                      
  4.           <td >
  5.               <asp:CheckBox ID="chkAgent" runat="server" 
  6.               AutoPostBack="True" OnCheckedChanged="chkAgent_CheckedChanged" />
  7.           </td>
  8.       </tr>
  9.       <tr>                                        
  10.           <td >
  11.               <asp:FileUpload ID="fuAgentLogo" runat="server" />
  12.           </td>
  13.       </tr>                                    
  14.     </ContentTemplate>
  15.     <Triggers>
  16.         <asp:AsyncPostBackTrigger ControlID="chkAgent" />
  17.     </Triggers>
  18. </asp:UpdatePanel>
I tried many different things like putting the checkbox out of the updatepanel but still nothing. Any idea what is going on?

Thanks
Luk
Jul 11 '08 #1
4 11839
Frinavale
9,735 Expert Mod 8TB
... When stepping through the project the OnCheckChanged where the FileUpload is enabled/disabled is called but the UpdatePanel is not updating i.e. The FileUpload remains disabled.

I tried many different things like putting the checkbox out of the updatepanel but still nothing. Any idea what is going on?

Thanks
Luk
When you autopostback with the CheckBox, are you attempting to upload the file in the FileUpload control?

At this time (as far as I'm aware) the UpdatePanel does not support the FileUpload control. If the FileUpload control is within an UpdatePanel the file will never get to the server. The FileUpload may be enabled, but because its in the UpdatePanel the file cannot get to the server.

FileUpload controls require full page postbacks.

-Frinny
Jul 11 '08 #2
pechar
56
When you autopostback with the CheckBox, are you attempting to upload the file in the FileUpload control?

At this time (as far as I'm aware) the UpdatePanel does not support the FileUpload control. If the FileUpload control is within an UpdatePanel the file will never get to the server. The FileUpload may be enabled, but because its in the UpdatePanel the file cannot get to the server.

FileUpload controls require full page postbacks.

-Frinny
Hi Frinny,

Thanks for your reply. I'm not trying to upload the file only enable the FileUpload control thats all. Otherwise for uploading I dont mind having a full postback. Any idea what I could be doing wrong?

Thanks
Luk
Jul 14 '08 #3
Frinavale
9,735 Expert Mod 8TB
Hi Frinny,

Thanks for your reply. I'm not trying to upload the file only enable the FileUpload control thats all. Otherwise for uploading I dont mind having a full postback. Any idea what I could be doing wrong?

Thanks
Luk
I would recommend using JavaScript to enable the FileUpload control when the checkbox has been checked.Something like the solution I recommended in this thread.

-Frinny
Jul 14 '08 #4
pechar
56
I would recommend using JavaScript to enable the FileUpload control when the checkbox has been checked.Something like the solution I recommended in this thread.

-Frinny
Thanks Frinny,

Will have a look at it.

Luk
Jul 14 '08 #5

Sign in to post your reply or Sign up for a free account.

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...
7
by: MikeB | last post by:
Hello All, I am new to ajax and wanted to start by trying something simple. I have a web form with an updatepanel and then inside the update panel I have a listbox. Then outside of the updatepanel...
1
by: Nightcrawler | last post by:
I have a parent updatepanel with a repeater in it that generates 10 child updatepanels. I have one button that will refresh all these 10 updatepanels. On the button click I go through the...
9
by: vital | last post by:
Hi, I have a User control which has a fileupload control. With the requirements I placed the user control in a UpdatePanel of ASP.NET Ajax and the fileupload.postedfile.filename giving error. ...
2
by: laziers | last post by:
Hi, I have a question this is very simple code: <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
1
by: Mark B | last post by:
This is my first try at using AJAX. I want the calendars to be enabled if the user checks CheckBox1. It works OK for a normal all page refresh but once I introduced the AJAX code it stopped...
4
by: Peter | last post by:
ASP.NET 2.0 I have an AutoCompleteExtender which works fine- I am using name, id pair in the WebService , but what I am trying to do is: once the user selects an item from the...
2
by: Chris | last post by:
I'm developing an ASP.NET Page that processes some files, does some things to them. I'd like to have a gridview that displays each file, and it's status, if it's done processing, still processing,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.