动态控件用于在 ASP.NET 上创建链接按钮并分配属性
我想在后面的代码中生成如下链接按钮。
<asp:LinkButton ID="lnkCustomize" OnClientClick="showDialog('editPerson')" Text="Customize" CommandName="Customize" CommandArgument='<%#Eval("type") + ";" + Eval("facility") + ";" + Eval("timestamp")%>runat="server"></asp:LinkButton>
这是我到目前为止所拥有的,但未能从争论中获取价值。感谢您的任何回复。
LinkButton link = new LinkButton();
link.Text = "Customize";
link.ID = "lnkCustomize";
double timestamp = ConvertToUnixTimestamp(leftstartTime1);
link.CommandArgument = Eval("type") + "," + Eval("facility") + "," + Eval("timestamp");
link.Command += new CommandEventHandler(DynamicClick);
link.OnClientClick = "showDialog('editPerson')";
I would like to generate the Link Button as below in code behind.
<asp:LinkButton ID="lnkCustomize" OnClientClick="showDialog('editPerson')" Text="Customize" CommandName="Customize" CommandArgument='<%#Eval("type") + ";" + Eval("facility") + ";" + Eval("timestamp")%>runat="server"></asp:LinkButton>
This is what I have so far but failed to retrieve value from arguements. Appreciate for any reply.
LinkButton link = new LinkButton();
link.Text = "Customize";
link.ID = "lnkCustomize";
double timestamp = ConvertToUnixTimestamp(leftstartTime1);
link.CommandArgument = Eval("type") + "," + Eval("facility") + "," + Eval("timestamp");
link.Command += new CommandEventHandler(DynamicClick);
link.OnClientClick = "showDialog('editPerson')";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.通过正确定义格式来修复
2。通过提取以下参数的所有值来修复
1. Fixed by having proper defined format
2. Fixed by extracting all the values of arguements as below