下VB語句怎么轉為C#﹖

mrguo 2004-04-26 11:07:08
Ctype(e.Item.Cells(5).Controls(0),LinkButton).Attributes.Add("onclick", "if (confirm('are you sure?')) return true;else return false;")
...全文
35 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
mrguo 2004-04-27
  • 打赏
  • 举报
回复
這樣編譯不過來的呀
mrguo 2004-04-26
  • 打赏
  • 举报
回复
不行﹐我也試了﹐怪怪的
zxkid 2004-04-26
  • 打赏
  • 举报
回复
((LinkButton)e.Item.Cells[5].Controls[0]).Attributes["onclick"] = "if (confirm('are you sure?')) return true;else return false;");
dzliang21 2004-04-26
  • 打赏
  • 举报
回复
((LinkButton)e.Item.Cells(5).Controls(0)).Attributes.Add("onclick", "if (confirm('are you sure?')) return true;else return false;");
试试看
accpyy 2004-04-26
  • 打赏
  • 举报
回复
((LinkButton)e.Item.get_Cells[5].get_Controls[0]).Attributes.Add("onclick", "if (confirm('are you sure?')) return true;else return false;");
Ninputer 2004-04-26
  • 打赏
  • 举报
回复
产生问题的原因:
C#不支持属性参数

可能导致的其他问题:


解决方案:
正确的翻译方法是
((LinkButton)e.Item.get_Cells(5).get_Controls(0)).Attributes.Add("onclick", "if (confirm('are you sure?')) return true;else return false;");


自己解决可尝试的步骤:


需要进一步学习和了解的内容:
可以了解关于属性参数的文章,见我的blog
http://blog.joycode.com/ninputer/posts/19148.aspx

mrguo 2004-04-26
  • 打赏
  • 举报
回复
不行呀﹐幫忙呀

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧