C# .net 的一些问题

老蒋 2008-12-02 11:06:43
问题1:为什么asp.net用C#语言时,各个对象的事件在.cs文件中找不到,必须要自己写出来,比如button1_click事件,用VB语法时,我可以先选择button1,然后选择click事件,但是用C#就没有这么方便
问题2:比如说我要执行button1_click事件,为什么要在page_load中先来这样一句话this.Button1.Click += new EventHandler(Button1_Click);以后才能执行button1_click事件.
因为我以前是用VB写的,好象都不会有这种问题,但是用C#后,就出现了这么多问题,要是有人懂的话,就麻烦你解释一下,谢谢!
...全文
47 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
vrhero 2008-12-02
  • 打赏
  • 举报
回复
谁说没有...在“设计视图”中选中控件...在“属性”视图点“事件”按钮,在事件栏选择或双击创建...直接双击控件就是创建缺省事件...

另外不要过于依赖IDE,VB用久了人都变懒了...手写有什么不好?免得VS胡乱命名...
sikezx 2008-12-02
  • 打赏
  • 举报
回复
。。。谁说没有啊?你说的这些东西在vs2003里面就可以实现勒,跟不要说05、08勒
自己好好的找找哦!
jiang_jiajia10 2008-12-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 magicbacon 的回复:]
在vs2005下,新建页面时不选中"把代码放在单独的文件中",就不会有这些问题了~
[/Quote]
amanizty 2008-12-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 magicbacon 的回复:]
在vs2005下,新建页面时不选中"把代码放在单独的文件中",就不会有这些问题了~
[/Quote]
up~~~
magicbacon 2008-12-02
  • 打赏
  • 举报
回复
在vs2005下,新建页面时不选中"把代码放在单独的文件中",就不会有这些问题了~
Paperback: 1625 pages Publisher: Apress; 7th ed. 2015 edition (January 1, 2016) Language: English ISBN-10: 1484213335 ISBN-13: 978-1484213339 This new 7th edition of Pro C# 6.0 and the .NET 4.6 Platform has been completely revised and rewritten to reflect the latest changes to the C# language specification and new advances in the .NET Framework. You'll find new chapters covering all the important new features that make .NET 4.6 the most comprehensive release yet, including: A Refined ADO.NET Entity Framework Programming Model Numerous IDE and MVVM Enhancements for WPF Desktop Development Numerous updates to the ASP.NET Web APIs This comes on top of award winning coverage of core C# features, both old and new, that have made the previous editions of this book so popular. Readers will gain a solid foundation of object-oriented development techniques, attributes and reflection, generics and collections as well as numerous advanced topics not found in other texts (such as CIL opcodes and emitting dynamic assemblies). The mission of this book is to provide you with a comprehensive foundation in the C# programming language and the core aspects of the .NET platform plus overviews of technologies built on top of C# and .NET (ADO.NET and Entity Framework, Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF), ASP.NET (WebForms, MVC, WebAPI).). Once you digest the information presented in these chapters, you’ll be in a perfect position to apply this knowledge to your specific programming assignments, and you’ll be well equipped to explore the .NET universe on your own terms. What you’ll learn Be the first to understand the .NET 4.6 platform and C# 6. Discover the ins and outs of the leading .NET technology. Learn from an award-winning author who has been teaching the .NET world since version 1.0. Find complete coverage of XAML, .NET 4.6 and Visual Studio 2015 together with discussion of the new Windows Runtime. Who this book is for This book is perfect for anyone who is interested in the new .NET Framework 4.6 and the C# language. Whether you are moving to .NET for the first time or are already writing applications using previous .NET versions, this book will provide you with a comprehensive grounding in the new technology and serve as a complete reference throughout your coding career.

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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