Obout Grid in UpdatePanel gets disabled on asynchronous postbacks - asp.net

I have a Obout Grid inside usercontrol and usercontrol is inside updatepanel. User control is not loaded dynamically. It is registered and a static reference is made. Obout Grid is getting disabled , whenever there is an asynchronous postback from grid or usercontrol.
I cannot select any rown or do anything on the grid. I can see that Obout grid is getting updated or usercontrol is working good, as same usercontrol is referred in many other places.
Help is really appreciated. I really cannot understand why the Obout grid is getting disabled. Initial load is good and also when grid makes a full postback it works good,but not for asynchronous postback ( I think so).
Edit:
Enabled is true. Grid is also not readonly. But i cannot click on grid or any buttons on my grid.
<asp:UpdatePanel ID="uplSelectOwner" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<tuc:selectOwner ID="uclSelectOwner" runat="server"/> </ContentTemplate>
<ContentTemplate>
</asp:UpdatePanel>

in pageinit assign:
this.grid.id= this.id +"grid";
The grid id repeat for each user control, then only one funk.

Try to set CallbackMode property of grid to false (link).

Related

ASP.NET webform Fileupload inside an ascx which is inside an updatepanel in the aspx

here is some code in my page :
<asp:UpdatePanel ID="UpdatePanelEQSelector" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc12:EQSelector ID="custEQSelector" OnEqChange="custEQSelector_OnEqChange" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
Inside my user Control, I'm asked to add a fileuploader.
After coding it simply, I tested and my fileuploader is always empty.
I've searched a while and discovered that it was a normal behavior.
The solution to make it work is to add a PostBackTrigger for the updatePanel.
When I tested it in my aspx page, I achieved to do it and my fileUploader had the file.
Then I tried to add it dynamically (to finally do it in my control), it worked with that :
PostBackTrigger trigger = new PostBackTrigger();
trigger.ControlID = this.btnTest.ID;
this._UpdatePanelEQSelector.Triggers.Add(trigger);
But I can't manage to make this code work in my control (I passed my updatePanel as a parameter to my control set in Load, the fileUpload is always empty)
Do you see a solution ?
Thanks
Does it postback, but leaves the control empty? or is it not posting back at all. If it's not posting back at all I'd add this
ScriptManager.GetCurrent(this).RegisterPostBackControl(btnTest);
to the page_load of the user control.
If it is posting back, but the control is empty, then I'd wager there is probably some dodgy html somewhere on the page and the values are getting lost.

DevExpress Hidden GridView CSS Issues

I have a repeater control that repeats a DevExpress ASPxGridView for every item bound to the repeater. The repeater is contained within an update panel. Events on the page, outside of the UpdatePanel, trigger the UpdatePanel (and subsequently the repeater) to update. All works fine if records are present to bind to the repeater. The repeater renders a grid for each record and all styles look perfect.
If the page initially loads and there are no items to display in the repeater, no grids are rendered (works as intended up until this point). If a record is eventually added and the repeater rebinds (because of the triggered UpdatePanel), the grid styles don't display. If the entire page is refreshed, the grid's styles display perfectly. Keep in mind that I'm using one of the default styles that comes with the grid, so these are being pulled from an AXD and not included in my MasterPage.
A bit too much code to post, but the nuts of the markup looks similar to this:
<asp:UpdatePanel ID="the UpdatePanelInQuestion" runat="server" UpdateMode="Conditional">
<asp:Repeater ID="theRepeaterInQuestion" runat="server" OnItemDataBound="theMethodThatHandlesGridPopulation">
<ItemTemplate>
<dxwgv:ASPxGridView ID="theGridViewInQuestion" runat="server" EnableViewState="false">
<Columns>
...
</Columns>
</ItemTemplate>
</asp:Repeater>
</asp:UpdatePanel>
Any ideas on how to make the styles of the grid display correctly without:
1) Refreshing the entire page instead of triggering.
2) Placing another empty grid on the page with style="display: none;" to force the styles to download.
This problem is caused by the fact that the required scripts for the DX ASP.NET controls are not registered on the page initially. It is possible to register them explicitely via the DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterBaseScript method.
Please check the http://www.devexpress.com/issue=B191046 Support Center ticket regarding this.

How can I refresh a dropdownlist during an event of another dropdownlist without refreshing whole web page?

I am developing my first asp.net website, my requirement is to refresh DropDownListB at SelectedIndexChanged event of DropDownListA, I have set AutoPostBack="True" for DropDownListA. Now the problem is whole web page gets refreshed, its unnecessary for me, is there any other technique that i can use to refresh only that control or only that panel rather than refreshing whole page?
Put the dropdowns inside
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
// Dropdowns
</ContentTemplate>
</asp:UpdatePanel>
and include <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager> at the top
1- You can simply place the dropdown in an UpdatePanel, this will avoid a complete post back.
You can get more details on UpdatePanel here
2- You can use jQuery AJAX to fetch the data in JSON format and bind it to the dropdown list, this approach is more efficient but little complex in comparison to UpdatePanel
You can find so many articles on this if you search this on google , like
[EDIT]
You can find a similar implementation here

An extender can't be in a different UpdatePanel than the control it extends asp.net

I am getting this error "An extender can't be in a different UpdatePanel than the control it extends". what could be the reason and how to tackle this problem.
You are using an AJAX ToolKit Extender Control to extend the functionality of one of your ASP.NET Controls. You have placed the Extender Control in a different UpdatePanel than the one the Extended Control resides in.
Both Extender and Extended controls must reside in the same UpdatePanel to avoid this exception.
Both Extender and Extended controls must reside in the same UpdatePanel to avoid the exception, this solved my problem.
I had an extra UpdatePanel that was giving this error, so I just had to remove the extra update panel lines of my aspx web page code.
What it says really - you've got an extender control that relates to a control that is in a different updatepanel. This means the extender is unable to act properly on the control it extends. You'll need to move your extender to be within the same updatepanel as the main control
In my case I was using button...outside the Update panel as below shown....
<asp:Button ID="btnClub" runat="server" Text="Club" OnClick="btnClub_Click" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
I just solved it by putting the <asp:Button ID="btnClub" runat="server" Text="Club" OnClick="btnClub_Click" /> inside the
update Panel
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btnClub" runat="server" Text="Club" OnClick="btnClub_Click" />
Here you make your panel code
</ContentTemplate>
</asp:UpdatePanel>
Reason :Your iD is mis matching Ex:Text box id or dropdown id mismatch in Calender extender or RequiredFieldValidator
Ex:
Hear Id Value And Target Control Id Must Match .....
Check for controls with extenders that are have the same ID especially if you copy pasted from another form
Hi I got the solution of my problem by myself. The problem occurred when the target
control id of the extender control was different from the control it
had extend inside update panel. I resolved this proble a long time
back and replying now.

Asp.net Update Panel

I am working in asp.net 3.5 and have some issue of update panel.I have some html content and Formview control in a page. I want to hide the html content when there is no data in the Formview and to show when there is data in the Formview control. My Formview control is in the updatepanel and it it is bind to SqlDataSource and Formview binds on some criteria.
If somebody know how to solve this issue then please help me.
If you want the HTML content to be hidden after an Ajax postback, it will need to be in an UpdatePanel, either the same one your FormView is in, or a separate one.
If it's in a separate one, you'll need some way of forcing it to update when the FormView updates. You can either do this in some code-behind, calling the Update() method of the UpdatePanel, or by adding an AsyncPostBackTrigger to the UpdatePanel containing the HTML, maybe using the DataBound event of the FormView.
Also, to easily hide the HTML content, put it in a Panel, and use the Visible property.
An example of the trigger:
<asp:UpdatePanel ID="updatePanel" ... runat="server">
<ContentTemplate>
...
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="formViewId" EventName="DataBound" />
</Triggers>
</asp:UpdatePanel>
This issue simply resolved using the putting all the html content in the Updatepanels and on UpdatePanel_preRender event of Updatepanels check that if Gridview has data then show html content otherwise hide

Resources