C# event using jQuery
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!");
});
精彩评论