Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
asp.net中的html按钮_Asp.net_Html - Fatal编程技术网

asp.net中的html按钮

asp.net中的html按钮,asp.net,html,Asp.net,Html,我在asp页面中使用html,我必须使用html按钮。但问题是我想在c#中对html按钮进行编码。但是使用html按钮我做不到。。还有其他方法吗..我使用html按钮作为: <button id="MyButton" runat="server" onserverclick="MyButton_ServerClick" > </button> 我能为此做些什么?您可以使用jQuery调用.net Web服务,在服务器上完成您想要实现的功能 像这样发出AJAX请求

我在asp页面中使用html,我必须使用html按钮。但问题是我想在c#中对html按钮进行编码。但是使用html按钮我做不到。。还有其他方法吗..我使用html按钮作为:

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

我能为此做些什么?

您可以使用jQuery调用.net Web服务,在服务器上完成您想要实现的功能


像这样发出AJAX请求:

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

    })

});

使用
有什么问题?如果你想在服务器端处理代码,它必须发一篇帖子。@graham clark:但是我的页面是html的,如果我使用,那么在阅读html页面时就会出现错误。如果你的站点是xy.html,因为它们没有被asp.NET处理,那么问题就更大了。你的页面是.html还是.aspx?
$('#Button').click(function() {
    $.ajax( {
    type:'Get',
    url:'http://mysite.com/mywebservice',
    success:function(data) {
     alert(data);
    }

    })

});