在asp.net中的html按钮 [英] html button in asp.net

查看:94
本文介绍了在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..

推荐答案

<使用AJAX请求:

Make AJAX request like this :

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

    })

});

这篇关于在asp.net中的html按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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