Problem in paginghttp://forums.asp.net/t/1799927.aspx/1?Problem+in+pagingFri, 04 May 2012 06:23:51 -040017999274964709http://forums.asp.net/p/1799927/4964709.aspx/1?Problem+in+pagingProblem in paging <p>I used a data pager in my application,this shows the &lt;a&gt; tags for paging which is under a span tag, and the name of span tag is the name of the datapage which i given it at .aspx page.</p> <p>Now my problem is i want to stop _doPostBack function of javascript and use my own function i use the follwing line for that</p> <p>&#36;(&quot;span['id*='Pager1] a&quot;).bind('click', function() {</p> <p>var pageId = &#36;(this).text();<br> </p> <p>//some code here</p> <p><br> return false;<br> });</p> <p>But this function not work,i dont understand what is problem</p> <p>&nbsp;</p> 2012-05-04T04:38:49-04:004964726http://forums.asp.net/p/1799927/4964726.aspx/1?Re+Problem+in+pagingRe: Problem in paging <p>Code is correct ...it would work for html like this&nbsp;&nbsp;&lt;span id=&quot;Pager1&quot;&gt;&lt;a&gt;1&lt;/a&gt;&lt;/span&gt;, check generated html to see if it is same. Make sure you write it inside &#36;(document).ready(function(){}); I tested it at my end and its working fine...obviously i replaced var pageId = &#36;(this).text() with alert(&#36;(this).text());</p> <p>Thanks</p> 2012-05-04T04:49:13-04:004964805http://forums.asp.net/p/1799927/4964805.aspx/1?Re+Problem+in+pagingRe: Problem in paging <p>My html is as follows</p> <pre class="prettyprint">&lt;span id=&quot;ctl00_CPHPackage_Pager1&quot;&gt;&lt;span&gt;1&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;javascript:__doPostBack('ctl00$CPHPackage$Pager1$ctl00$ctl01','')&quot;&gt;2&lt;/a&gt;&amp;nbsp; &lt;a href=&quot;javascript:__doPostBack('ctl00$CPHPackage$Pager1$ctl00$ctl02','')&quot;&gt;3&lt;/a&gt;&amp;nbsp; &lt;a href=&quot;javascript:__doPostBack('ctl00$CPHPackage$Pager1$ctl00$ctl03','')&quot;&gt;4&lt;/a&gt;&amp;nbsp; &lt;a href=&quot;javascript:__doPostBack('ctl00$CPHPackage$Pager1$ctl00$ctl04','')&quot;&gt;5&lt;/a&gt;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;javascript:__doPostBack('ctl00$CPHPackage$Pager1$ctl00$ctl05','')&quot;&gt;...&lt;/a&gt;&amp;nbsp; &lt;/span&gt;</pre> <p><br> <br> </p> <p></p> <p>Now my problem is it works first time correctly,but when i click second time on this paging ,then my my jquery function is not called and postback occurs</p> 2012-05-04T05:35:59-04:004964847http://forums.asp.net/p/1799927/4964847.aspx/1?Re+Problem+in+pagingRe: Problem in paging <p>if you have registered the function in document.ready...it should not cause problem if it is normal postback (I assume you are not using updatepanel)...and i dont understand the __doPostBack in href ??&nbsp;</p> <p>Thanks</p> 2012-05-04T06:13:55-04:004964859http://forums.asp.net/p/1799927/4964859.aspx/1?Re+Problem+in+pagingRe: Problem in paging <p>Actualy i use Jquery Load Function to load data and the data it load contains paging by datapager therefore&nbsp;<span>__doPostBack comes in href,actually my problem is solved now i using live in place of bind...</span></p> <p><span>Thanks for your support,if you have some comments on that then i feel pleasured</span></p> 2012-05-04T06:17:45-04:004964881http://forums.asp.net/p/1799927/4964881.aspx/1?Re+Problem+in+pagingRe: Problem in paging <p>I would have suggestedt to use <strong>&quot;live&quot;&nbsp;</strong>if you were using updatepanel....partial postback unregisters the event you write using jquery&nbsp;and recreates the DOM ....<strong>&quot;live&quot;&nbsp;</strong>attaches event for those newly created DOM elements.</p> <p><a href="http://api.jquery.com/live/">http://api.jquery.com/live/</a></p> <p>Thanks</p> 2012-05-04T06:23:51-04:00