After Postback, JQuery is not working
Hi
I have a problem when server postback, all scripts are didn't work.
one of my script is
- $(document).ready(function() {
// For Create Resources
// Here we will write a function when link click under class popup
$('#ctl00_Body_chkNewCat').live('click', function() {
// Now we need to popup the marked which belongs to the rel attribute
// Suppose the rel attribute of click link is popuprel then here in below code
// #popuprel will fadein
$('#popuprel').fadeIn();
// append div with id fade into the bottom of body tag
// and we allready styled it in our step 2 : CSS
$('body').append('<div id="fade"></div>');
$('#fade').css({ 'filter': 'alpha(opacity=80)' }).fadeIn();
// Now here we need to have our popup box in center of
// webpage when its fadein. so we add 10px to height and width
var popuptopmargin = ($('#popuprel').height() + 10) / 2;
var popupleftmargin = ($('#popuprel').width() + 10) / 2;
// Then using .css function style our popup box for center allignment
$('#popuprel').css({
'margin-top': -popuptopmargin,
'margin-left': -popupleftmargin
});
});
// Now define one more function which is used to fadeout the
// fade layer and popup window as soon as we click on fade layer
$('a.close, #fade').live('click', function() {
// Add markup ids of all custom popup box here
$('#fade , #popuprel').fadeOut()
$('#ctl00_Body_chkNewCat').each(function() { $(this).attr('checked', false); });
return false;
}); });
and in my aspx page,
when i click checkbox, it will show popup. And in Popup box, i've applied GridView, in gridview user can CRUD.
for example. In rowupdating
- if (upd != 0)
{
lblPoupMessage.CssClass = "success";
lblPoupMessage.Text = "Category Id <b>" + txtId.Text.ToString().Trim() + "</b> has been updated.";
grdCategory.EditIndex = -1;
fillGrid();
fillCategory();
}
I do like this. I just rebind. but after binding, all scripts didn't work... why? how to solve