asp.net mvc 中javascript

Garage_zkc 2012-09-12 01:59:33
为什么在View中写入的javascript代码不能用,特别是那个window.event,mvc中的JS都写在什么地方???
...全文
50 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
种草德鲁伊 2012-09-12
  • 打赏
  • 举报
回复
看最终生成的html,和mvc没关系。window.event更可能是浏览器兼容性的问题。
玄冰2013 2012-09-12
  • 打赏
  • 举报
回复
*.cshtml 或者写成*.js 然后再引入啊
Book Description Develop next-generation web applications with ASP.NET MVC Go deep into the architecture and features of ASP.NET MVC 5, and learn how to build web applications that work well on both the desktop and mobile devices. Web development expert Dino Esposito takes you through the web framework’s Model-View-Controller (MVC) design model, and covers the tools you need to cleanly separate business logic from the user interface. If you’re an experienced web developer new to ASP.NET MVC, this practical guide will get you going. Discover how to: Build web applications that are easy to test and maintain Dive into the functions of controllers—the heart of an MVC site Explore the structure and behavior of a view engine Process a variety of input data using a custom model binder Automate the writing of input forms, and streamline validation Design websites for mobile devices, localization, and error handling Provide security by implementing a membership system Inject script code into your site using JavaScript and jQuery Use Responsive Web Design to make sites mobile-friendly Table of Contents Part I: ASP.NET MVC fundamentals Chapter 1. ASP.NET MVC controllers Chapter 2. ASP.NET MVC views Chapter 3. The model-binding architecture Chapter 4. Input forms Part II: ASP.NET MVC software design Chapter 5. Aspects of ASP.NET MVC applications Chapter 6. Securing your application Chapter 7. Design considerations for ASP.NET MVC controllers Chapter 8. Customizing ASP.NET MVC controllers Chapter 9. Testing and testability in ASP.NET MVC Chapter 10. An executive guide to Web API Part III: Mobile clients Chapter 11. Effective JavaScript Chapter 12. Making websites mobile-friendly Chapter 13. Building sites for multiple devices Book Details Paperback: 516 pages Publisher: Microsoft Press; 3rd Edition (February 2014) Language: English ISBN-10: 0735680949 ISBN-13: 978-0735680944
The ASP.NET MVC 5 Framework is the latest evolution of Microsoft’s ASP.NET web platform. It provides a high-productivity programming model that promotes cleaner code architecture, test-driven development, and powerful extensibility, combined with all the benefits of ASP.NET. ASP.NET MVC 5 contains a number of advances over previous versions, including the ability to define routes using C# attributes and the ability to override filters. The user experience of building MVC applications has also been substantially improved. The new, more tightly integrated, Visual Studio 2013 IDE has been created specifically with MVC application development in mind and provides a full suite of tools to improve development times and assist in reporting, debugging and deploying your code. The popular Bootstrap JavaScript library has also now been included natively within MVC 5 providing you, the developer, with a wider range of multi-platform CSS and HTML5 options than ever before without the penalty of having to load-in third party libraries. What you’ll learn Gain a solid architectural understanding of ASP.NET MVC 5 Explore the entire ASP.NET MVC Framework as a cohesive whole Learn what's new in version 5 and how best to apply these new features to your own work See how MVC and test-driven development work in action Capitalize on your existing knowledge quickly and easily through comparison of features in classic ASP.NET to those in ASP.NET MV Who this book is for This book is for web developers with a basic knowledge of ASP.NET and C#who want, or need, to start using the new ASP.NET MVC 5 Framework. Table of Contents Part I: Introducing ASP.NET MVC 5 1. What's The Big Idea 2. Your first MVC Application 3. The MVC Pattern 4. Essential Language Features 5. Working with Razor 6. Essential Tools for MVC 7. Sports Store: A Real Application 8. Sports Store: Navigation 9. Sports Store: Cart 10. Sports Store: Mobile 11. Sports Store: Admin 12. Sports Store: Security and Finishing Touches 13. Deployment Part II: ASP.NET MVC 5 In Detail 14. Overview of MVC5 Projects 15. URL Routing 16. Advanced Routing Features 17. Controllers and Actions 18. Filters 19. Controllers Extensibility 20. Views 21. Helper Methods 22. Templated Helper Methods 23. URL and Ajax Helper Meothods 24. Model Binding 25. Model Validation 26. Bundles 27. WebAPI and Single Page Applications
作者简介 Jess Chadwick 专注于Web技术领域,独立软件技术顾问。超过10年的软件开发经验,就职的公司包括嵌入式设备创业公司、世界500强。ASPInsider、微软ASP.NET 领域的MVP。经常在新泽西的NJDOTNET做技术讲座。 Todd Snyder超过18年软件开发经验。微软平台的企业级系统架构提供技术咨询和开发指导。就职于美国 Infragistics公司,经常作为讲师受邀参加各种技术会议。 Hrusikesh Panda:架构师、RIA专家、Web架构师以及开源爱好者。 目录 第1章:ASP.NET MVC基础 第2章:ASP.NET Web Form开发人员必读 第3章:使用数据 第4章:客户端开发 第5章:Web应用程序架构 第6章:使用AJAX提升网站体验 第7章:ASP.NET Web API 第8章:高级数据 第9章:安全 第10章:移动Web网站开发 第11章:并行计算、异步和实时数据操作 第12章:缓存 第13章:客户端优化技术 第14章:高级路由 第15章:可复用UI组件 第16章:日志 第17章:自动测试 第18章:自动化生成 第19章:部署 附录A ASP.NET MVC与Web Form集成 附录B 作为平台使用NuGet 附录C ASP.NET MVC开发最佳实践原则 附录D 交叉引用:目标主题、特性和场景 索引 内容简介 本书介绍了微软最新的ASP.NET MVC 4框架,包括如何使用ASP.NET MVC 4框架构建Web应用程序,ASP.NET MVC 4框架的运行原理,如何在真实开发场景使用ASP.NET MVC 4框架新特性来解决不同的需求,如何使用HTML、JavaScript、Entity Framework以及其他Web相关的技术。同时,分享了许多实际项目开发的最佳实践经验,包括如何使用jQery、jQuery、Entity Framework、ASP.NET Web API进行应用程序开发。而且还深入阐述了许多高级知识点,如网站SEO、性能优化、日志、缓存等。 对于想要学习ASP.NET MVC Web编程的开发人员来说,本书无疑是最佳选择。

62,041

社区成员

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

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

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

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