Note that there are some explanatory texts on larger screens.

plurals
  1. POasp.net repeater returns weird html
    primarykey
    data
    text
    <p>I have a repeater that is supposed to create div tags with their onclick functions from databind. Which is like </p> <pre><code>onclick='&lt;%# "functionname('" + Eval("somestring") +"');" %&gt;' </code></pre> <p>but the single quotes ' after the js func ( and before ) , they become something like ?,= .. </p> <p>I don't understand what's happening. .. the full code is below</p> <pre><code>&lt;div id="dvPager"&gt; &lt;asp:Repeater ID="pagerSorular" runat="server"&gt; &lt;ItemTemplate&gt; &lt;div class='&lt;%# "pageritem pagertext" + ((this.PageNumber == int.Parse(Container.DataItem.ToString())) ? " pagerselected" : "") %&gt;' onclick='&lt;%# "gotopage('" + this.PageName + "', " + Container.DataItem + ");" %&gt;'&gt; &lt;%# Container.DataItem %&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/div&gt; </code></pre> <p>and codebehind is:</p> <pre><code>public int PageNumber { get { string strPgNum = Request.QueryString["pg"] as String; if (!String.IsNullOrEmpty(strPgNum)) { int pgnum; if (int.TryParse(strPgNum, out pgnum)) { if (pgnum &lt;= 0) { return pgnum; } else { return 1; } } else { return 1; } } else { return 1; } } } public string PageName { get { string url = Request.Url.ToString(); string[] parts = url.Split(new char[]{'/'}); return parts[parts.Length - 1]; } } public void Doldur(List&lt;SoruGridView&gt; sorulistesi) { gridSorular.DataSource = sorulistesi; gridSorular.DataBind(); /// PagerYap(sorulistesi); } protected void PagerYap(List&lt;SoruGridView&gt; sorulistesi) { List&lt;int&gt; numpgs = new List&lt;int&gt;(); int count = 1; foreach (SoruGridView sgv in sorulistesi) { numpgs.Add(count); count++; } pagerSorular.DataSource = numpgs.ToArray(); pagerSorular.DataBind(); } </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