I have a Rad Grid with a Hyperlink in its itemTemplate, The Hyperlink will open a Radwindow
我有一个Rad网格,它的itemTemplate中有一个超链接,超链接会打开一个Radwindow
<asp:Content ContentPlaceHolderID="MenuPlaceHolder" runat="server" ID="Menus">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowOnCar(id) {
window.radopen("OnCar.aspx?SN=" + id, "ShowOnCar");
return false;
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="onCarLink">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager></asp:Content>
<asp:Content ID="SheetContent" ContentPlaceHolderID="SheetContentPlaceHolder" runat="Server">
<telerik:RadAjaxPanel ID="RadAjaxPanel1d" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
<telerik:RadGrid ID="dt_lst_SN" runat="server" EnableEmbeddedSkins="false">
<MasterTableView AutoGenerateColumns="False">
<Columns>
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" UniqueName="TemplateColumn">
<ItemTemplate>
<asp:HyperLink ID="onCarLink" runat="server">
<asp:PlaceHolder runat="server" ID="TempPlaceholder" />
</asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</telerik:RadAjaxPanel>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="ShowOnCar" runat="server" Title="Details" Height="400px" Width="650px"
Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />
</Windows>
</telerik:RadWindowManager></asp:Content>
in code behind,
在代码中,
Protected Sub dt_lst_SN_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles dt_lst_SN.ItemDataBound If TypeOf e.Item Is GridDataItem Then Dim onCarLink As HyperLink = DirectCast(e.Item.FindControl("onCarLink"), HyperLink) onCarLink.Attributes("href") = "#" onCarLink.Attributes("onclick") = [String].Format("return ShowOnCar('{0}');", e.Item.Cells(dt_lst_SN.Columns.FindByUniqueName("SN_ID").OrderIndex).Text) End If End Sub
This code will open the radwindow correctly but just once! What is missing?
此代码将正确地打开radwindow,但只打开一次!缺少的是什么?
1 个解决方案
#1
1
Look for JavaScript errors, change function names, the RadWindow ID, etc. Try setting the href of the link to javascript:void(0);
查找JavaScript错误、更改函数名、RadWindow ID等。尝试设置到JavaScript链接的href:void(0);
#1
1
Look for JavaScript errors, change function names, the RadWindow ID, etc. Try setting the href of the link to javascript:void(0);
查找JavaScript错误、更改函数名、RadWindow ID等。尝试设置到JavaScript链接的href:void(0);