在asp.net中的html按钮

问题描述:

我在asp页面中使用html,我必须使用html按钮。但问题是我想在c#中的HTML按钮上进行编码。但通过使用HTML按钮,我不能这样做..是否有任何其他方式做到这一点..我使用HTML按钮作为:

i am using html in asp page where i have to use html button. but the problem is i want to do the coding on html button in c#. but by using html button i cant do that.. is there any other way to do so..i am using html button as:

 <button id="MyButton" runat="server" onserverclick="MyButton_ServerClick" >
   </button>

如果我双击.aspx页面中的html按钮,它会在脚本下生成代码as:

if i double-click on the html button from .aspx page it generates the code as function under script as:

 function MyButton_onclick() {

        }

我可以为此做些什么。

what can i do for this..



Make AJAX request like this :

$('#Button').click(function() {
    $.ajax( {
    type:'Get',
    url:'http://mysite.com/mywebservice',
    success:function(data) {
     alert(data);
    }

    })

});