// Assign Context-Menu to Control
$(function () {
var txt1 = "#" + "<%= **myCal**.ClientID %>";
// Attach Context-Menu to Control
$(txt1).contextMenu(ctxtMenu, { theme: 'vista' });
});
代码
TextBox lbl = new TextBox ();
lbl.BorderColor = System.Drawing.Color.Black;
lbl.BorderStyle = BorderStyle.Double;
lbl.BackColor = System.Drawing.Color.BlanchedAlmond;
lbl.Text = eventname + "<br/>" + dt + "" + dt1;
e.Cell.Controls.Add(lbl);
我想使用动态创建的asp.net TextBox代替myCal
我该怎么办?请帮忙
答案 0 :(得分:1)
您可以为此控件定义一个CSS类:
lbl.CssClass = "menu";
然后使用类选择器:
$(function () {
// Attach Context-Menu to Control
$('.menu').contextMenu(ctxtMenu, { theme: 'vista' });
});