I have a very simple test page that contains the following:
RadAjaxManager
RadScriptManager
RadUpload
RadWindowManager
input type="button" x 2
The input buttons fire client-side events that cause an ajaxRequest.
This only works with the first ajaxRequest. Thereafter the $find("<%= RadAjaxManager1.ClientID %>"); does not find the RadAjaxManager
I have tried the setTimeout("InitiateAjaxRequest(FileString);", 0); trick but it does not make a difference.
RadAjaxManager
RadScriptManager
RadUpload
RadWindowManager
input type="button" x 2
The input buttons fire client-side events that cause an ajaxRequest.
This only works with the first ajaxRequest. Thereafter the $find("<%= RadAjaxManager1.ClientID %>"); does not find the RadAjaxManager
<head runat="server"> |
<title></title> |
<telerik:RadCodeBlock ID="cb1" runat="server"> |
<script type="text/javascript"> |
function InitiateAjaxRequest(arguments) { |
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); |
if (ajaxManager) ajaxManager.ajaxRequest(arguments); |
} |
</script> |
</telerik:RadCodeBlock> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<script type="text/javascript"> |
function OnClientFileSelected(radUpload, eventArgs) { |
var input = eventArgs.get_fileInputField(); |
var FileString = "UploadFile" + "|" + input.value; |
InitiateAjaxRequest(FileString); |
} |
function confirmCallBackFn(arg) { |
result = radalert("Confirm returned the following result: " + arg); |
InitiateAjaxRequest('confirm|' + result); |
} |
</script> |
<div> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> |
</telerik:RadAjaxManager> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
</div> |
<div> |
<telerik:RadUpload ID="RadUpload1" runat="server" Skin="Forest" OnClientFileSelected="OnClientFileSelected"> |
</telerik:RadUpload> |
</div> |
<div> |
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
</telerik:RadWindowManager> |
</div> |
<div> |
<input id="Button1" type="button" value="clientside button" onclick="javascript:InitiateAjaxRequest('btn|a');" /> |
</div> |
<div> |
<input id="Button2" type="button" value="show CONFIRM BOX" onclick="radconfirm('Are you sure?', confirmCallBackFn); return false;" /> |
</div> |
</div> |
</form> |
</body> |