
First of all, I believe that it is not a RadControls problem, but a general AJAX case. I have a webpage that generates an Excel file on the server, and the page uses AJAX to update the status (as it is a long process).
The following is the (partial) codes that I use:
Me.imgStatus.ImageUrl = "~/Images/tick.jpg"
Me.imgStatus.AlternateText = "Done"
Me.RadAjaxManager1.ResponseScripts.Add("window.location.href='DownloadFile.aspx';")
"Downloadfile.aspx" is another file that prompts the user to Open or Save the Excel (instead of displaying on within IE). The following is the code-behind in Downloadfile.aspx.vb:
Response.Clear()
Response.ContentType = "application/x-msdownload"
Response.AddHeader("content-disposition", "attachment;filename=WAT_ASWSalesWithGPByBrandCustomer_" & Format(Now(), "yyyyMMdd") & ".xls")
excelFile.SaveXls(Response.OutputStream)
Now, my problem: the image "imgStatus" sometimes does not show up, and there is no Red cross on the web page. When I right-click the location of "imgStatus", and select "Show picture", the "Tick.jpg" loaded.
I think it is "Response.Clear()" that prohibits the displaying of "imgStatus". To ensure that "imgStatus", i.e. the tick.jpg, shows, should I add one more post-back (thus delay the page redirection). Is there anyway to overcome this?
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="100%"
SelectedIndex="0" Skin="Web20" MultiPageID="RadMultiPage2">
<Tabs>
<telerik:RadTab runat="server" Selected="True" Text="Transaction History"
PageViewID="RadPageView1" ToolTip="Click here to view Transaction history">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Owner Information"
PageViewID="RadPageView2" ToolTip="Click here to view Owner Information">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage2" runat="server">
<telerik:RadPageView ID="RadPageView1" runat="server">
<table>
<tr><td>
<asp:Label ID="Label11" runat="server" Text="One"></asp:Label>
</td></tr>
</table>
</telerik:RadPageView>
<telerik:RadPageView ID="RadPageView2" runat="server">
<table>
<tr><td>
<asp:Label ID="Label14" runat="server" Text="Two"></asp:Label></td></tr>
</table>
</telerik:RadPageView>
</telerik:RadMultiPage>
<
telerik:RadComboBox ID="radcbxaccountnumber" runat="server" MaxLength="16" Width="160px" DropDownWidth="340" EnableEmbeddedSkins="false" Skin="WebIE7" AllowCustomText="true" MarkFirstMatch="true" Text='<%# DataBinder.Eval(database.duckds, "Tables(0).DefaultView.(0).txtvar1") %>' EnableLoadOnDemand="true" HighlightTemplatedItems="true" ItemRequestTimeout="500" OnItemsRequested="radcbxaccountnumber_ItemsRequested" OnItemDataBound="radcbxaccountnumber_ItemDataBound" ShowMoreResultsBox="true" EnableVirtualScrolling="true">
<HeaderTemplate><table style="width:300px;text-align:left">
<tr><td style="width:75px;">Account#</td>
<td style="width:75px;">Name</td>
<td style="width:100px;">Product</td>
</tr></table></HeaderTemplate>
<ItemTemplate><table style="width:300px;text-align:left">
<tr><td style="width:75px;vertical-align:top;"><%#DataBinder.Eval(Container.DataItem, "txtvar1")%></td>
<td style="width:75px;vertical-align:top;"><%#DataBinder.Eval(Container.DataItem, "txtvar2")%></td>
<td style="width:100px;vertical-align:top;"><%#DataBinder.Eval(Container.DataItem, "reqtype", "{0}") + " " + DataBinder.Eval(Container.DataItem, "prodtype", "{0}")%></td>
</tr></table></ItemTemplate></telerik:RadComboBox>
and
Public
requestdataview As DataView
Protected Sub radcbxaccountnumber_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
requestdataview = database.FillDataViewWithCaching(
"getrelatedducks " + Request.QueryString("flockid") + ",1")
radcbxaccountnumber.DataSourceID =
""
radcbxaccountnumber.DataSource = requestdataview
radcbxaccountnumber.DataBind()
End Sub
Protected Sub radcbxaccountnumber_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs)
e.Item.Text = (
DirectCast(e.Item.DataItem, DataRowView))("txtvar1").ToString()
e.Item.Value = (
DirectCast(e.Item.DataItem, DataRowView))("txtvar1").ToString()
End Sub