Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating Bootstrap-Datepicker with multiple asp:Repeater TextBoxes
    primarykey
    data
    text
    <p>I am creating form using an asp:Repeater, each object of the repeater has one textbox that will need it's own unique bootstrap-datepicker linked to it. (the datepicker is a javascript addon to twitter-bootstrap 2.3.2 found here: <a href="http://www.eyecon.ro/bootstrap-datepicker" rel="nofollow">http://www.eyecon.ro/bootstrap-datepicker</a> -- Wanted to add that the link is safe, but there is no real need to view the page in regards to the question)</p> <p>My problem is that I am not able to use the asp.net clientid to correctly target the text boxes.</p> <p>aspx code:</p> <pre><code>&lt;asp:Repeater ID="repList" runat="server"&gt; &lt;HeaderTemplate&gt; &lt;ul class="gridul"&gt; &lt;li class="gridli userrole"&gt;&lt;span class="short liheader"&gt;Jenz ID&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="long liheader"&gt;Name&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="short liheader"&gt;S/S/F&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="short liheader"&gt;Date&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="long liheader"&gt;Payment Type&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="mid liheader"&gt;Sent to B.O.&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;ul class="gridul"&gt; &lt;li class="gridli userrole"&gt;&lt;span class="short"&gt;&lt;%# Eval("jenzabar_id") %&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="long"&gt;&lt;%# Eval("first_name") %&gt;&amp;nbsp&lt;%# Eval("last_name") %&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="short"&gt;&lt;%# Eval("student_staff_faculty") %&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="short"&gt;&lt;%# Eval("reservation_date") %&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="long"&gt;&lt;asp:TextBox ID="PayType" runat="server" Text='&lt;%# Eval("payment_type") %&gt;' /&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="gridli"&gt;&lt;span class="mid"&gt;&lt;asp:TextBox ID="SentBo" runat="server" Text='&lt;%# Eval("sent_to_bo") %&gt;' /&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; &lt;asp:HiddenField ID="hidJenz" runat="server" Value='&lt;%# Eval("jenzabar_id") %&gt;' /&gt; &lt;asp:HiddenField ID="hidPayType" runat="server" Value='&lt;%# Eval("payment_type") %&gt;' /&gt; &lt;asp:HiddenField ID="hidSentBo" runat="server" Value='&lt;%# Eval("sent_to_bo") %&gt;' /&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>The textbox being targeted is: </p> <pre><code>&lt;asp:TextBox ID="SentBo" runat="server" Text='&lt;%# Eval("sent_to_bo") %&gt;' /&gt; </code></pre> <p>In my scripts.js I can target an individual textbox by viewing the aspx source and copying in the generated id such as "ctl00_MainContent_repList_ctl01_SentBo" but I cannot figure out how to use &lt;%# SentBo.ClientID %> with the repeater. It just doesn't work.</p> <p>Example:</p> <pre><code>$(function () { $('ctl00_MainContent_repList_ctl01_SentBo').datepicker(); }) </code></pre> <p>is successful</p> <pre><code>$(function () { $('&lt;%#= SentBo.ClientID %&gt;').datepicker(); }) </code></pre> <p>is not</p>
    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