我正在使用 .ascx 用户控件来填充员工数据和员工图片。在单击员工图片时,我想显示一个对话框,其中我希望有一个文本字段和一个文本框供用户输入。Click 事件触发良好,但通过对话框它给了我“Microsoft JScript 运行时错误:对象不支持属性或方法'对话框'”的错误。请任何人帮助我用文本字段和文本框填充对话框。我对 JQUERY 真的很陌生,并且努力让它发挥作用。
在下面的代码片段中,我添加了一个来自我在网上找到的示例之一的对话框代码。
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="OpenAccessDataProvider,a4a794260c0b4440b466f75d11146db8.ascx.cs" Inherits="SitefinityWebApp.SfCtrlPresentation.OpenAccessDataProvider_a4a794260c0b4440b466f75d11146db8" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<telerik:RadListView ID="dynamicContentListView" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
<LayoutTemplate>
<ul class="sfitemsList sfitemsListTitleDateTmb">
<asp:PlaceHolder ID="ItemsContainer" runat="server" />
</ul>
</LayoutTemplate>
<ItemTemplate>
<li class="sfitem sfClearfix">
<h2 class="sfitemTitle">
<sf:DetailsViewHyperLink ID="DetailsViewHyperLink" TextDataField="Title" runat="server" />
</h2>
<sf:AssetsField ID="AssetsField1" runat="server" DataFieldName="Picture" />
<sf:SitefinityLabel ID="SitefinityLabel1" runat="server" Text='<%# Eval("Designation")%>' WrapperTagName="div" HideIfNoText="true" CssClass="sfitemShortTxt" />
<sf:SitefinityLabel ID="SitefinityLabel2" runat="server" Text='<%# Eval("CompanyName")%>' WrapperTagName="div" HideIfNoText="true" CssClass="sfitemShortTxt" />
<sf:AssetsField ID="AssetsField2" runat="server" DataFieldName="Documents"/>
</li>
</ItemTemplate>
</telerik:RadListView>
<sf:Pager id="pager" runat="server"></sf:Pager>
<script type="text/javascript">
$(document).ready(function () {
$(".sfClearfix .sfimageWrp img").click(function () {
// $(document).ready(function () {
var $dialog = $('<div></div>')
.html('This dialog will show every time!')
.dialog({
autoOpen: false,
title: 'Basic Dialog'
});
$('#opener').click(function () {
$dialog.dialog('open');
// prevent the default action, e.g., following a link
return false;
});
// });
//alert("HEY THERE " + $(this).attr("src"));
});
});
</script>
Regards.