Note that there are some explanatory texts on larger screens.

plurals
  1. POscrolling to a location on div Id using jquery?
    primarykey
    data
    text
    <p>I am trying to navigate to a div based on it's after capturing the Id from Url.</p> <p>The url is like below first time when user is navigated to this page</p> <pre><code>http://localhost:6447/products/all-products#productId2 </code></pre> <p>Here is #productId2 is div id in the page to which i need to scroll on page load</p> <p>I am displaying products in listview with paging</p> <pre><code>&lt;ItemTemplate&gt; &lt;tr&gt; &lt;td&gt; &lt;div id='#productId&lt;%#Eval("PId")%&gt;'&gt; &lt;a class="ProdcutText"&gt; &lt;%#Eval("PName")%&gt;&lt;/a&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;div class="PriceText"&gt; -&lt;a class="PPrice"&gt;&lt;%#Eval("Price")%&gt;&lt;/a&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;div class="PDesc"&gt; &lt;asp:Label ID="lblDesc" runat="server" Text='&lt;%#Eval("PrdocutDescription")%&gt;'&gt; &lt;/asp:Label&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; </code></pre> <p>and in content page i tried below but doesn't seem to work.</p> <pre><code>&lt;asp:Content ID="HeadContent" ContentPlaceHolderID="MasterHeadContentHolder" runat="server"&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('html,body').animate({ scrollTop: $("#productId6").offset().top }, 2000); }); &lt;/script&gt; </code></pre> <p></p> <p>What is wrong? and after paging the url changes to and i get error of undefined and null error.</p> <pre><code>http://localhost:6447/products/all-products?list=1 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload