一个asp.net标签设置为一个jQuery对话框的标题 [英] setting an asp.net label to the title of a jquery dialog
问题描述
我想设置使用asp.net标签jquery的对话框标题。这可能吗?
I would like to set the jquery dialog title using an asp.net label . Is it possible?
我已经试过这样的事情:
I have tried something like this :
$(Div1).dialog('option', 'title', 'Title Name');
但标题名称这里是静态的。我想在这里用我的asp.net标签,而不是标题名称'的。
But the Title Name here is static. I would like to use my asp.net label here instead of the 'Title Name'.
我也有我的code以下更新:
I also have my code updated below :
Asp.Net code:
Asp.Net code :
<div id="Div1" class="InsertBar">
<asp:Label ID="Label2" runat="server" Visible="true" Font-Bold="true"></asp:Label>
<asp:Panel ID="Panel1" runat="server" HorizontalAlign="left" ScrollBars="Auto">
<asp:GridView>
*******GRIDVIEW CODE ************************
</asp:GridView>
</asp:Panel>
</div>
Java脚本code:
Java Script Code :
<script type="text/javascript">
function ViewModelPopup1() {
$(Div1).dialog('option', 'title', $('#<%=Label2.ClientID%>').val());
}
</script>
我在这里使用一个标签的原因(以为我会提到它):
我有一个asp.net网格视图。我在显示一个jQuery对话框GridView的。我要取从一个值
网格视图并把它作为一个标题jquery的对话框。
I have an asp.net grid view. I am displaying the gridview in a jquery dialog. I have to fetch a value from the grid view and use it as a title to the jquery dialog.
我取出由网格视图的值,并将其存储在一个标签。
I am fetching the value from the grid view and storing it in a label.
我现在要分配的标签jquery的对话框标题的值。
I would now want to assign the value of the label to the jquery dialog title.
有谁知道我能做到这一点?或有什么想法
Does anyone know how I can do this ? or have any ideas
推荐答案
试试这个:
$(Div1).dialog('option', 'title', $('#<%=Label1.ClientID%>').text());
注:更改标签1
来匹配您的ASP.NET Label控件的名称
Note: Change Label1
to match the name of your ASP.NET Label control.
这篇关于一个asp.net标签设置为一个jQuery对话框的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!