Synchronous postback with Telerik Radgrid in updatepanel - asp.net

I have a RadGrid with a custom edit form (FormTemplate). The grid is in an UpdatePanel for asynchronous postbacks, as changing the selection in drop down lists and checkboxes needs to enable or disable other controls on the form. (Updating the controls synchronously is not acceptable to the user.)
As part of the edit form, I have a FileUpload control, but this does not upload the files when in an update panel.
I have tried adding the Insert/Update button as a PostBackTrigger on the UpdatePanel, but this causes an error on page load, as the UpdatePanel cannot find the control (the edit form is not open on load).
Is there a way to add/remove the trigger at runtime when the form is opened/closed?
Or is it possible to have the FileUploads work with the async-postback?

Yes, you have problem with is as FileUpload is in the list of controls that are not compatible with update panel (for more info here). One workaround for you could be swfupload. Another option is to use this jQuery plugin http://www.plupload.com/example_all_runtimes.php as stated here

There is a demo on the Telerik site that shows how to upload the files.
By using a RadAjaxPanel, RadCodeBlock and RadScriptManager with RadUploads instead of FileUploads it is possible to detect on the client side whether files have been selected for upload.
If there are files to upload, the AJAX postback can be disabled during the upload.
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=upload&RadUrid=cde8a81e-0eb1-49ca-8c31-4dba37da90c4

Related

Fileupload inside repeater of updatepanel not working

To avoid auto post back I have used update panel covering my asp webpage which is having multiple repeater in it.
Each repeater having file upload control in it. Each file upload is showing me empty file when I am trying to save.
File Upload control faces issues working with updatepanel
so to solve it
define a postback trigger for your control in the updatepanel,
or
if that doesn't work then use AsyncFileUpload control from Ajax toolkit

jquery ajax not working after postback

Hi Here is the scenario:
I have an asp:Button on the page, and on clicking on the button, it verifies certain logic and displays a details block. This details block has bunch of web user controls, which make their own jquery ajax calls and load different controls using jquery templating plugin.
The details panel is inside a asp:Placeholder and i set visible property to true on postback.
The details panel was working fine earlier since i did not had a button click which does a postback to load the details panel. It was displayed by default earlier. How do i get my web user controls make an ajax call after the postback completes?
I got it working. I just added a hidden field on the page, and on postback i filled it with some value. On jquery instead of calling the functions directly on document ready, i checked what is the value set to the hidden field. This resolved the issue.

ASP.NET use AJAX to prevent a control from reloading

I'm using VS2008 to develop my ASP.NET web site, I know how to use AJAX and update panels to perform partial page refresh, but is there any way that I can do the reverse action? i.e. can I use update panels to prevent some controls from reloads? I have a control which I don't want to be reloaded in page reloads, it is located in my master page as it should be active in all pages, what are my options now?
thanks
Try using UpdateMode property of update panel to Conditional..
When UpdateMode set to Conditional, the UpdatePanel will be updated only on postback originated by controls inside the panel or from the triggers specified.
for more info:
http://codeclimber.net.nz/archive/2007/05/24/updatemode-default-value-for-the-updatepanel-is-always.aspx
http://ajax.net-tutorials.com/controls/updatepanel-control/
Regards.

Enable or Disable a Control without PostBack asp.net

Greetings, I have an ASP.Net form with some standard controls (DropDownLists and TextBoxes) that I need to be disabled or enabled based on the checked state of a checkbox control.
I currently have it working via the CheckChanged event on a postback.
Can I use Ajax to accomplish the same thing without Posting Back?
You can use Jquery or Javascript to Hide or disable the controls client side.

Detecting client-side DOM changes server-side in ASP.NET: Is It Possible?

I'm working on developing a custom control to select items from a predefined list. This is accomplished via 2 ASP.NET ListBox controls, with a few buttons to trigger the movement of ListItems from one ListBox to the other (lets call these ListBoxes lstSelected and lstDeselected).
This is easy enough to do in ASP.NET or JavaScript independently: I have both working. However, if modifications are made via JavaScript, ASP.NET retains no knowledge of this. Is there any way to register the creation of of options in a select tag without AJAX?
You could also do this with traditional postbacks, it doesn't have to be ajax. The postbacks would be triggered by clicking your buttons which change which items are in which listboxes.
You could have a couple of hidden fields, say hdnHasSelectedChanged and hdnHasDeselectedChanged, and set those fields in your javascript code. Then, when a postback really happens, your code-behind can read those hidden fields to detect if changes occurred.

Resources