jquery not working after post back

Posted by Asarikumar under jQuery on 3/13/2013 | Points: 10 | Views : 10187 | Status : [Member] | Replies : 9
Hi ,

i have two drop down lists and grid use jquer plugins to sorting,paging....done
it's working fine ...but use update panel
it's working fine in first time page load after any post bask(drop down select) jquery not working...
i will serch more forem but not solve ....
some pepole told : write jquery code in side page load or document ready
but i given jquery plugin in gride ..... CssClass="fTable " in grid control how to write this in page load or document.ready function
<script language="javascript">
$(document).ready(function () {
//for table row
$("gridView").css( "fTable");
});
</script>
my code:

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" >
</asp:ScriptManager>
<asp:UpdatePanel ID="panel" runat="server">
<ContentTemplate>
<div class="widget">
<div class="head">
<div class="icon"><span class="icosg-target1"></span></div>
<h2>Table sorting</h2>
</div>
<div>
UniverSityId <asp:DropDownList ID="drplist1" runat="server" Width="20%" AutoPostBack="True"
onselectedindexchanged="drplist1_SelectedIndexChanged">
<asp:ListItem Value="0" >select</asp:ListItem>
<asp:ListItem Value="1" >0</asp:ListItem>
</asp:DropDownList>
city:
<asp:DropDownList ID="drplist2" runat="server" Width="20%" AutoPostBack="True"
onselectedindexchanged="drplist2_SelectedIndexChanged">
</asp:DropDownList></div>
<div class="block-fluid" >
<asp:GridView ID="gridView" runat="server" CssClass="fTable" AutoGenerateColumns="false" >
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" id="checkAll" onclick="SelectAllCheckboxesSpecific(this);"
runat="server" name="checkAll" />
<th width="25%"> UniverSityName</th>
<th width="20%"> UniverSityCode</th>
<th width="20%"> Addres</th>
<th width="20%">EmailId</th>
<th width="20%">Actions</th>
</HeaderTemplate>
<ItemTemplate>
<input type="checkbox" id="deleteRec" style="width: 13px; height: 13px" runat="server"
onclick="HighlightRow(this)" name="chk" />
<td> <%#Eval("UNIVERSITY_NAME")%></td>
<td> <%#Eval("UNIVERSITY_CODE")%></td>
<td> <%#Eval("UNIVERSITY_ADDRESS")%></td>
<td> <%#Eval("UNIVERSITY_EMAIL_ID")%></td>
<td class="TAC">
</td>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>




Responses

Posted by: Kusumas on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
In update panel you can add this one UpdateMode="Conditional"

this will help you.......

if useful mark as answer

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asarikumar on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi kusumas,

i have given UpdateMode="Conditional" in update panel but ..

still same problem

Thanks


Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Praveenraj on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
dont do any thing..leave it

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asarikumar on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
pls give any solution...
Thanks

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kusumas on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
You can use in jquery file

pageLoad() instead of $(document).ready(),


thanks

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kusumas on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
You can write like below in jquery file.

function pageLoad(sender, args) {
$(document).ready(function () {

//Write your code

});
}

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Asarikumar on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
hi
but i given jquery plugin in gride ..... CssClass="fTable " in grid control i con,t write code in <script></scripte> only apply jquery to gride
how to write this in page load or document.ready function

"fTable" is jquery plugin class ...

how to write in function pageload() or $(document).ready(),

thanks


Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kusumas on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
Hi try this below ..................
<script type="text/javascript">
Sys.Application.add_load(function() {

$(function(){

//add your jquey plug-in here.................

});

});

</script>

thanks

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dotnetrajanikanth on: 3/13/2013 [Member] Starter | Points: 25

Up
0
Down
You can use
function pageLoad(){

//your code
}


____________
www.flickr.com/photos/psdesigner/

Asarikumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response