开发者

C# event using jQuery

开发者 https://www.devze.com 2023-04-03 04:41 出处:网络
I need ASP.NET C# button click event to be done by the jQuery. The following sample code taken from my project in which instead of document.write(\'Passed\') I need C# button click even to be done. Ho

I need ASP.NET C# button click event to be done by the jQuery. The following sample code taken from my project in which instead of document.write('Passed') I need C# button click even to be done. How it can be done?

Sample code in which button click Button1_Click to be replaced instead of document.write

$("#slider").draggable({
        axis: 'x',
        containment: 'parent',
        drag: function(event, ui) {
            if (ui.position.开发者_C百科left > 550) {
                document.write('Passed');
                $("#well").fadeOut();
            } else {
            }
        }


I'm not sure if this is what you want, but you could trigger the 'click' event for the button on the page using jQuery. This would cause your event to fire server side, as it would if the button had been manually clicked -

$('#yourbuttonid').trigger('click');


I'm little confused here now. But This is what you want to be replace document.write

$("#Button1").click(function() {
                        alert("Hello world!");
                    });
0

精彩评论

暂无评论...
验证码 换一张
取 消