You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: controls/ajaxpanel/troubleshooting/common-issues.md
+37-46Lines changed: 37 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,29 +15,9 @@ position: 1
15
15
16
16
Here are some of the common issues one can face when using **RadAjax** .
17
17
18
-
*[Inline JavaScript in dynamically loaded user controls is missing on the page.](#Problem1)
18
+
## Inline JavaScript in dynamically loaded user controls is missing on the page.
19
19
20
-
*[A control’s skin is not loaded after an AJAX update.](#Problem2)
21
-
22
-
*[Setting the EventName property in the AJAX settings for the AJAX initiator control does not work.](#Problem3)
23
-
24
-
*[The loading panel is not displayed if you invoke multiple requests from the same AJAX initiator before the previous request finished.](#Problem4)
25
-
26
-
*[My page went blank after I fired an event from a dynamically loaded user control.](#Problem5)
27
-
28
-
*[After postback/AJAX request, my control does not keep its last state.](#Problem6)
29
-
30
-
*[After dynamically loading a user control, I cannot fire the events of any of its controls.](#Problem7)
31
-
32
-
*[LoadingPanel is not displayed when dynamically created controls in a user control trigger the AJAXrequest.](#Problem8)
33
-
34
-
*[I used RadAjax to AJAX-enable controls but they are showing up twice.](#Problem9)
35
-
36
-
*[UseSubmitBehavior for ASP Button is ignored when the control is AJAX enabled through RadAjaxManager or RadAjaxPanel](#Problem10)
37
-
38
-
##
39
-
40
-
1. Problem: Inline JavaScript in dynamically loaded user controls is missing on the page.Solution: Wrap your script block into a **RadScriptBlock**. If the issue persists in your case, you ought to register the script through the **ScriptManager.RegisterStartupScript()** method.
20
+
Wrap your script block into a **RadScriptBlock**. If the issue persists in your case, you ought to register the script through the **ScriptManager.RegisterStartupScript()** method.
## A control’s skin is not loaded after an AJAX update.
63
43
64
-
2. Problem: A control’s skin is not loaded after an AJAX update.Solution: This issue usually occurs when a control is displayed after an AJAX update or the skin is changed upon AJAX update. In this case, set the control’s **EnableAjaxSkinRendering** property to **true** on **Page_Load** and after every postback
44
+
This issue usually occurs when a control is displayed after an AJAX update or the skin is changed upon AJAX update. In this case, set the control’s **EnableAjaxSkinRendering** property to **true** on **Page_Load** and after every postback
65
45
66
46
````C#
67
47
protectedvoidPage_Load(objectsender, EventArgse)
@@ -75,34 +55,35 @@ Protected Sub Page_Load(sender as Object, e as EventArgs) Handles Me.Load
75
55
EndSub
76
56
````
77
57
78
-
79
58
For example, if a **RadGrid** control is shown after a partial postback from a button click the **EnableAjaxSkinRendering** property of **RadGrid** should be set to **true** on button click. Also, keep in mind that if there are controls inside the grid, their **EnableAjaxSkinRendering**property should also be set to **true**. The code snippet below demonstrates how to load the skins of **RadGrid** and **RadDateTimePicker** control placed in the **ItemTemplate** of the grid template column after a partial postback.
## Setting the EventName property in the AJAX settings for the AJAX initiator control does not work.
101
81
82
+
The **EventName** property is obsolete for **RadAjax** . If your logic strongly relies on it, you should use an **asp:UpdatePanel** toAJAX-enable the controls instead of **RadAjax** . Another option is to wrap the updated control in a**RadAjaxPanel** instead of using the **RadAjaxManager** to AJAX-enable it. Then on certain client-side events of the AJAX initiator, invoke AJAX for the corresponding **RadAjaxPanel** manually. See the sample in[this help article]({%slug ajaxpanel/overview%}) for more information.
102
83
103
-
3. Problem: Setting the **EventName** property in the AJAX settings for the AJAX initiator control does not work.Solution: The **EventName** property is obsolete for **RadAjax** . If your logic strongly relies on it, you should use an **asp:UpdatePanel** toAJAX-enable the controls instead of **RadAjax** . Another option is to wrap the updated control in a**RadAjaxPanel** instead of using the **RadAjaxManager** to AJAX-enable it. Then on certain client-side events of the AJAX initiator, invoke AJAX for the corresponding **RadAjaxPanel** manually. See the sample in[this help article]({%slug ajaxpanel/overview%}) for more information.
84
+
## The loading panel is not displayed if you invoke multiple requests from the same AJAXinitiator before the previous request finished.
104
85
105
-
4. Problem: The loading panel is not displayed if you invoke multiple requests from the same AJAX initiator before the previous request finished.Solution: Modify your code to handle the **RadAjaxManager/RadAjaxPanel OnRequestStart** client-side event.
86
+
Modify your code to handle the **RadAjaxManager/RadAjaxPanel OnRequestStart** client-side event.
var obj =Sys.WebForms.PageRequestManager.getInstance();
112
93
if (obj.get_isInAsyncPostBack())
113
94
obj.abortPostBack();
114
-
}
95
+
}
115
96
</script>
116
97
</telerik:RadCodeBlock>
117
98
````
118
99
100
+
## My page went blank after I fired an event from a dynamically loaded user control.
119
101
120
-
121
-
5. Problem: My page went blank after I fired an event from a dynamically loaded user control.Solution: This can happen if user controls were improperly loaded. When loading user controls,you need to have two things in mind:
102
+
This can happen if user controls were improperly loaded. When loading user controls,you need to have two things in mind:
122
103
123
104
* Always recreate the last loaded user control on **Page_Init/Page_Load** .
124
105
125
106
* Assign unique IDs to the loaded controls.If the page goes blank, check if the control is always recreated. For more information about how to load user controls dynamically,please refer to [this]({%slug ajaxpanel/how-to/load-user-controls%}) topic.
126
107
127
-
6. Problem: After postback/AJAX request, my control does not keep its last state.Solution: This can happen if you are loading user controls and you do not assign unique IDs to them.In this case, the framework will generate an automatic ID which can be different than the original ID and therefore the ViewState is being lost.This is the cause for losing the last state of the control.
108
+
## After postback/AJAX request, my control does not keep its last state.
109
+
110
+
This can happen if you are loading user controls and you do not assign unique IDs to them.In this case, the framework will generate an automatic ID which can be different than the original ID and therefore the ViewState is being lost.This is the cause for losing the last state of the control.
111
+
112
+
## After dynamically loading a user control, I cannot fire the events of any of its controls.
113
+
114
+
This is caused by improper loading of the user controls. If the control is persisted on the page, but its events are not fired, check to see if you have assigned an ID to this control. This is required by the framework to preserve theViewState and handle the control events.
115
+
116
+
## LoadingPanel is not displayed when dynamically created controls in a user control trigger the AJAXrequest.
117
+
118
+
I have a user control that is populated with dynamically created controls. After I have AJAX-enabled the user control with **RadAjaxPanel(RadAjaxManager)**, the loading panel I have specified does not display at all when any of the dynamically created controls triggers the AJAX request (though the AJAX request itself is completed successfully and the content is updated).Solution: The most likely reason for this behavior is missing ID for the dynamically created controls.Please make sure you are assigning an ID to the controls and you should experience no further problems.
128
119
129
-
7. Problem: After dynamically loading a user control, I cannot fire the events of any of its controls.Solution: This is caused by improper loading of the user controls. If the control is persisted on the page, but its events are not fired, check to see if you have assigned an ID to this control. This is required by the framework to preserve theViewState and handle the control events.
120
+
## I used RadAjax to AJAX-enable controlsbut they are showing up twice.
130
121
131
-
8. Problem: I have a user control that is populated with dynamically created controls. After I have AJAX-enabled the user control with **RadAjaxPanel(RadAjaxManager)**, the loading panel I have specified does not display at all when any of the dynamically created controls triggers the AJAX request (though the AJAX request itself is completed successfully and the content is updated).Solution: The most likely reason for this behavior is missing ID for the dynamically created controls.Please make sure you are assigning an ID to the controls and you should experience no further problems.
122
+
This can happen if you have added controls to the Page controls collection dynamically on**Page.Render** and the page is AJAX-enabled through **RadAjax**. The control, is rendering twice because **RadAjax** is calling the **Render** method twice in order to achieve partial rendering.The additional call of the method is for rendering the AJAX-enabled controls only. However, note that the page itself is rendered once.Therefore, you should add controls earlier in the **Page** life cycle.
132
123
133
-
9. Problem: I used **RadAjax** to AJAX-enable controls but they are showing up twice.Solution: This can happen if you have added controls to the Page controls collection dynamically on**Page.Render** and the page is AJAX-enabled through **RadAjax**. The control, is rendering twice because **RadAjax** is calling the **Render** method twice in order to achieve partial rendering.The additional call of the method is for rendering the AJAX-enabled controls only. However, note that the page itself is rendered once.Therefore, you should add controls earlier in the **Page** life cycle.
124
+
## UseSubmitBehavior for ASP Button is ignored when the control is AJAXenabled through RadAjaxManager or RadAjaxPanel
134
125
135
-
10. Problem: **UseSubmitBehavior** for **ASP Button** is ignored when the control is AJAX enabled through **RadAjaxManager** or **RadAjaxPanel** .When you enable AJAX for **ASP Button** through **RadAjaxManager** or **RadAjaxPanel** ,the **UseSubmitBehavior** property of the button is internally set to **false** ,which causes the input element rendered for the button to always be set to "**button** ".
126
+
When you enable AJAX for **ASP Button** through **RadAjaxManager** or **RadAjaxPanel** ,the **UseSubmitBehavior** property of the button is internally set to **false** ,which causes the input element rendered for the button to always be set to "**button** ".
2. Subscribe to the [OnClientSelectedIndexChanged]({%slug combobox/client-side-programming/events/onclientselectedindexchanged%}) event and update that hidden field:
37
+
After that, subscribe to the [OnClientSelectedIndexChanged]({%slug combobox/client-side-programming/events/onclientselectedindexchanged%}) event and update that hidden field:
0 commit comments