I have an ASP.Net RadioButtonList control with AutoPostBack set to true and a server side handler for the SelectedIndexChanged event.
<asp:RadioButtonList runat="server" ID="btnAcceptReject" RepeatDirection="Horizontal" CssClass="checkboxlist borderless" ValidationGroup="data" AutoPostBack="true" OnSelectedIndexChanged="radioButtonList_SelectedIndexChanged">
<asp:ListItem Text="The edition is hereby validated for conformity to standards" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="The edition does not meet standards and still has to be reviewed" Value="1"></asp:ListItem>
</asp:RadioButtonList>
I am using a RadAjaxManager, a telerik control, to handle ajax postbacks
<telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManagerPRoxy1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnAcceptReject">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlControls" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
pnlControl is a panel on the page containing controls that will be enabled/disabled depending on which radio button was checked.
The above always performs a full postback of the page.
how can i make it perform an ajax partial postback?
Could it be a result of you using RadAjaxManagerProxy instead of RadAjaxManager?
RadAjaxManagerProxy expects that there is a RadAjaxManager declared elsewhere within a Master Page etc.
If that fails then I suggest to alter the pnlControl to become a RadAjaxPanel and then remove the RadAjaxManagerProxy declaration as the RadAjaxPanel will do all the work for you.
Good luck!
In reply to your comments, I would now suggest to do the following within the referencing ASPX page (if that is possible under your scenario):
Add a RadAjaxManagerProxy to the client-side
Within the code-behind add a new Sub to be called during Page_Load (outside the postback check)
Within the Sub:
Dim panel As Panel = CType(myUserControl.FindControl("pnlControls"),Panel)
Dim radio As RadioButtonList = CType(myUserControl.FindControl("btnAcceptReject"), RadioButtonList)
RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(radio, panel, Nothing)
*Nothing - Optionally a RadAjaxLoadingPanelID if you have one declared on the .ASPX page
Hope it helps!
Related
In my webpage, I have a RadTabStrip containing RadTab:s which will decide which page view the webpage that is shown.
<telerik:RadTabStrip ID="rtsTabs2" runat="server" MultiPageID="rmpMultiPage2"
AutoPostBack="True" SelectedIndex="0" OnTabClick="rtsTabs2_TabClick">
<Tabs>
<telerik:RadTab Text="Page 1" PageViewID="pvPage1" />
<telerik:RadTab Text="Page 2" PageViewID="pvPage2" />
</Tabs>
</telerik:RadTabStrip>
The page views are defined like this:
<telerik:RadMultiPage ID="rmpMultiPage2" runat="server">
<telerik:RadPageView ID="pvPage1" runat="server">
RadGrids etc
</telerik:RadPageView>
<telerik:RadPageView ID="pvPage2" runat="server">
More RadGrids etc
</telerik:RadPageView>
</telerik:RadMultiPage>
The page views contains numerous components that will be populated from the database.
However, I will only be interested in populate those when a page view containing them is displayed.
Which event should I listed at to determine when to populate components?
The OnLoad event in RadPageView is triggered when the page load, regardless if the page view is shown or not.
The OnPreRender event in RadPageView is also triggered on page load.
The OnNeedDataSource event in GridView is the same, the event triggers when the page loads.
Using Visible="False" in a RadPageView only results in page views that will never show up even if the corresponding RadTab is clicked.
I have a RadioButtonList control inside a nested user control. When one of its buttons is clicked, i want a panel to be refreshed with an ajax postback. I am using the telerik RadAjaxManager. The problem is that the list always triggers a FULL postback. markup is below
<telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManagerPRoxy1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnAcceptReject">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlControls" UpdatePanelRenderMode="Inline" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:RadioButtonList runat="server" ID="btnAcceptReject" RepeatDirection="Horizontal" CssClass="checkboxlist borderless" ValidationGroup="data" AutoPostBack="true" OnSelectedIndexChanged="btnAcceptReject_SelectedIndexChanged">
<asp:ListItem Text="The edition is hereby validated for conformity to standards" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="The edition does not meet standards and still has to be reviewed" Value="1"></asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="vldAcceptReject" ControlToValidate="btnAcceptReject" runat="server" CssClass="text-error" Text="please check an option" ValidationGroup="data"></asp:RequiredFieldValidator>
<asp:Panel runat="server" ID="pnlControls">
I reviewed my code and markup over and over and it does not seem there's anything missing, this should run out of the box! i've been reading a lot online however about issues that controls like RadioButtonList and CheckBoxList have with ajax postbacks. does anyone know how to solve this?
You should move the radio button list inside the pnlControls ajax panel. Then It should not do the postback.
Dear Fellows i have a usercontrol which takes destination details from users with multiple dropdownlist controls...
e.g. Country Dropdownlist produces postback and populate states dropdownlist based on select values. State's Dropdownlist produces postback to get cities based on states.Furthermore everything happens in an Ajax UpdatePanel.
--Select--
I'm using this control in popupextender to be displayed. Each time dropdownlist postback popupcontrol disappears. Please help me with that
<asp:Panel ID="pnlhotelsearch" runat="server">
<div>
</div>
<uc1:SlimMainsearchpanel ID="SlimMainsearchpanel1" runat="server" />
</asp:Panel>
<ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" TargetControlID="lnkbtnCriteriea" PopupControlID="pnlhotelsearch" runat="server">
</ajaxToolkit:PopupControlExtender>
There are several suggestions at ASP.net Modal Pop up extender and DropDownlist autopostback.
The way I solved it was to raise a new event, say DropDownChangedEvent, in the AutoPostBack event handler. The handler for the new DropDownChangedEvent calls PopupExtender.Show.
I have an update panel on an .aspx page. Within this aspx page I have a few ascx controls. One of the controls has my link button. When that button is pressed I'd expect to get the results I intend to get, but I expect to not see a page flicker or see the page postback. It does both. After I change some search information and click the link button again the page does an async postback (which is what I expected on the first click). After running this sequence through fiddler I see that the first time I click the button I am missing some information that is included in all subsequent requests.
ctl00$ScriptManager1=ctl00$cplContents$updatePanelOrderSearch|ctl00$cplContents$ucOrderSearchControl$btnRange&EVENTTARGET=ctl00%24cplContents%24ucOrderSearchControl%24btnRange&.....
Above is what I get on clicks 2, 3, etc.. This is not in the request when I click on the link button the very first time. Im wondering if this is why I am get a full, non async postback the first time.
Any help would be appreciated. My update panel code is below.
<asp:UpdatePanel ID="updatePanelOrderSearch" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
<ContentTemplate>
<uc:control1 "this control has the link button" />
<hr />
<div id="SearchResults">
<div id="SearchResultsMessage">
<asp:Literal ID="lblMessage" Text="No orders found" Visible="false" runat="server" />
</div>
<uc:contorl 2 />
</div>
<uc: control3 />
</ContentTemplate>
</asp:UpdatePanel>
Thanks
this was an issue from months ago and we wound up not using this solution
I am building a User Control (requirement – has to be User Control).
This user control is inside an AJAX Update Panel on the parent page.
The user control has two Infragistics Web Date Chooser controls on it.
Both dates are required.
I have placed asp.net RequiredFieldValicators on both controls.
I have placed ValidatorCalloutExtenders on both.
One control gets validated every time without fail. The other is intermittent. To debug I first removed the ValidatorCalloutExtender from the failing control and sure enough the RequiredFieldValidator fires correctly every time so it appears that the problem is with the ValidatorCalloutExtender. There are not a lot of options for the ValidatorCalloutExtender but I did play with them every way feasible and nothing seems to make any difference. The TargetControlID has to point to the validation control you are extending. Any help appreciated.
Here is the code that works correctly every time:
<igsch:WebDateChooser ID="wdcEndDatePop" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
Width="200px" MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvEndDate" runat="server"
ControlToValidate="wdcEndDatePop" Display="None"
ErrorMessage="End date required." ValidationGroup="endDatePop" />
<cc1:ValidatorCalloutExtender
ID="vceEndDatePop"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvEndDate"
WarningIconImageUrl="~/images/back_warning2.gif" />
And here is the code that works intermitemtly:
<igsch:WebDateChooser ID="wdcStartDate" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvStartDate" runat="server"
ControlToValidate="wdcStartDate" Display="None"
ErrorMessage="Start date required." ValidationGroup="access" />
<cc1:ValidatorCalloutExtender
ID="vceStartDate"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvStartDate"
WarningIconImageUrl="~/images/back_warning2.gif" />