ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Apply Bootstrap class to custom pager using Repeater in ASP.Net<p>Hi <a class="username" rel="ahmeddeeb">ahmeddeeb</a>,</p> <p>Refer below sample code.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <p><strong>CS.aspx</strong></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head id=&#34;Head1&#34; runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;link type=&#34;text/css&#34; rel=&#34;stylesheet&#34; href=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css&#34; /&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js&#34;&gt;&lt;/script&gt; &lt;style type=&#34;text/css&#34;&gt; .page_enabled { background-color: #007AFE; color: #FFFFFF; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;asp:GridView ID=&#34;gvCustomers&#34; runat=&#34;server&#34; AutoGenerateColumns=&#34;false&#34; PageSize=&#34;5&#34;&gt; &lt;Columns&gt; &lt;asp:BoundField HeaderText=&#34;CustomerId&#34; DataField=&#34;CustomerID&#34; /&gt; &lt;asp:BoundField HeaderText=&#34;ContactName&#34; DataField=&#34;ContactName&#34; /&gt; &lt;asp:BoundField HeaderText=&#34;CompanyName&#34; DataField=&#34;CompanyName&#34; /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;br /&gt; &lt;ul class=&#34;pagination&#34;&gt; &lt;asp:Repeater ID=&#34;rptPager&#34; runat=&#34;server&#34;&gt; &lt;ItemTemplate&gt; &lt;li class=&#34;page-item&#34;&gt; &lt;asp:LinkButton ID=&#34;lnkPage&#34; runat=&#34;server&#34; Text=&#39;&lt;%#Eval(&#34;Text&#34;) %&gt;&#39; CommandArgument=&#39;&lt;%# Eval(&#34;Value&#34;) %&gt;&#39; CssClass=&#39;&lt;%# Convert.ToBoolean(Eval(&#34;Enabled&#34;)) ? &#34;page-link&#34; : &#34;page-link page_enabled&#34; %&gt;&#39; OnClick=&#34;Page_Changed&#34; OnClientClick=&#39;&lt;%# !Convert.ToBoolean(Eval(&#34;Enabled&#34;)) ? &#34;return false;&#34; : &#34;&#34; %&gt;&#39;&gt;&lt;/asp:LinkButton&gt; &lt;/li&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/ul&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><strong>VB.aspx</strong></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head id=&#34;Head1&#34; runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;style type=&#34;text/css&#34;&gt; .page_enabled { background-color: #007AFE; color: #FFFFFF; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;asp:GridView ID=&#34;gvCustomers&#34; runat=&#34;server&#34; AutoGenerateColumns=&#34;false&#34;&gt; &lt;Columns&gt; &lt;asp:BoundField HeaderText=&#34;CustomerId&#34; DataField=&#34;CustomerID&#34; /&gt; &lt;asp:BoundField HeaderText=&#34;ContactName&#34; DataField=&#34;ContactName&#34; /&gt; &lt;asp:BoundField HeaderText=&#34;CompanyName&#34; DataField=&#34;CompanyName&#34; /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;br /&gt; &lt;asp:Repeater ID=&#34;rptPager&#34; runat=&#34;server&#34;&gt; &lt;ItemTemplate&gt; &lt;asp:LinkButton ID=&#34;lnkPage&#34; runat=&#34;server&#34; Text=&#39;&lt;%#Eval(&#34;Text&#34;) %&gt;&#39; CommandArgument=&#39;&lt;%# Eval(&#34;Value&#34;) %&gt;&#39; CssClass=&#39;&lt;%# If(Convert.ToBoolean(Eval(&#34;Enabled&#34;)), &#34;page-link&#34;, &#34;page-link page_enabled&#34;)%&gt;&#39; OnClick=&#34;Page_Changed&#34; OnClientClick=&#39;&lt;%# If(Not Convert.ToBoolean(Eval(&#34;Enabled&#34;)), &#34;return false;&#34;, &#34;&#34;) %&gt;&#39;&gt;&lt;/asp:LinkButton&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/UQWrnA3.jpg" alt="" width="220" height="73" /></span></strong></p>https://www.aspforums.net:443/Threads/100555/Apply-Bootstrap-class-to-custom-pager-using-Repeater-in-ASPNet/https://www.aspforums.net:443/Threads/100555/Apply-Bootstrap-class-to-custom-pager-using-Repeater-in-ASPNet/Tue, 27 Aug 2019 07:37:56 GMT