在Visual Studio 2010中的设计视图中的窗体控件双击插入,而不是插入的事件处理程序的脚本 [英] Double-clicking on a form control in Visual Studio 2010 design view inserts a script instead of inserting an event handler

查看:143
本文介绍了在Visual Studio 2010中的设计视图中的窗体控件双击插入,而不是插入的事件处理程序的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题pretty多precisely问这个问题,但我会重复;

The title pretty much precisely asks the question, but I shall repeat;

当我双击窗体控件而在Visual Studio 2010中的一个Web应用程序项目设计视图,说按钮或提交为例,它插入一个JavaScript函数到我的.aspx文件。当我做这个工作,它会自动创建在code-背后的控制事件处理程序。

When I double click on a form control while in the design view in a Web Application project within Visual Studio 2010, say a 'button' or a 'submit' for example, it inserts a javascript function into my .aspx file. When I do this at work it automatically creates an event handler for the control in the code-behind.

我要如何改变这个该设置?我用'/ resetsettings'已经和其他回答类似的问题并没有解决我的问题。我重新安装,通过每一个菜单中我能找到的(虽然我可能已经错过了一些东西)走了,我拉我的头发了。

How do I change this to that setting? I have used '/resetsettings' already, and other answers to similar questions do not solve my problem. I have reinstalled, gone through every menu I can find (though I may have missed something) and I'm pulling my hair out.

我不希望每次都输入这些事件处理子程序! HALP meee!

I don't want to type those event handler subroutines every time! Halp meee!

先谢谢您的任何有用的回复。

Thanks in advance for any helpful replies.

推荐答案

它是什么样子是怎么回事这个就是你是一个普通的HTML元素上双击。例如,如果你有

What it looks like is going on with this is that you are double clicking on a regular HTML element. For example, if you have

<input type="button" value="Test" id="Test" name="Test" />

和双击它在设计视图中,将创建的页面,并在元素的onclick事件的JavaScript函数。如果你想创建落后于code事件处理程序,你需要有一个Asp.Net控制像

and double click on it in design view it will create a JavaScript function on the page for it and an onclick event in the element. If you want to create an event handler in the code behind, you need to have an Asp.Net control like

&LT; ASP:按钮=服务器ID =测试文本=测试/&GT;

,然后双击该后面创建于code一个code事件。

and then double click that to create a code event in the code behind.

此外,确保在顶部的页面指令具有正确的文件名,它的 codeFILE 属性正确地映射到后面的文件中的现有code

Also, make sure that your page directive at the top has the correct filename for its CodeFile attribute to correctly map to an existing code behind file.

这篇关于在Visual Studio 2010中的设计视图中的窗体控件双击插入,而不是插入的事件处理程序的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆