开发者

Calling a jquery function in telerik radgrid image button

I have one problem with RadGrid and Jquery.

I have a Telerik RadGrid which contains 2 imagebuttons. When I click on imagebuttons, these buttons should call the jquery functions. I'm not getting how to implement this.

This is开发者_JS百科 my jQuery function:

$(function () {
    $("#Link1").click(function(evt) {
        evt.preventDefault();
        $('#panelText').slideToggle('slow');
    });
});


You'll have to do something like

$(function () {
    $("#" + <%= Link1.ClientID %>).click(function(evt) {
        evt.preventDefault();
        $('#' + <%= panelText.ClientID %>).slideToggle('slow');
    });
});

Once the controls are rendered on the page, they get assigned unique ClientID's which you don't have direct access to in your JS -- but you can use this method to inject the correct ClientID by grabbing it from the server.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜