Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i pass my imagebutton values to c# function
    primarykey
    data
    text
    <p>I keep a variable named id and it keeps the value which comes from db <code>(id = row[3].ToString();)</code></p> <p>Then I assign the id of class yildiz to 'id' then I try to pass the c# function but I cannot do it.</p> <p>When in the click event value of id is "id" (the code I try is (<code>string id = objImage.UniqueID; objImage.ID</code> )) but actually it must be such as "26" the value which comes from db but it does not. </p> <p>Actually my problem handling the data in c# side. I tried also commandarguments but I cannot do it there is any way to do it how can i solve the problem? thanks..</p> <pre><code> id = row[3].ToString(); %&gt; &lt;div class="sag-re"&gt;- &lt;div class="sag-re-baslik" runat="server"&gt;&lt;asp:HyperLink ID=baslik runat="server"&gt;HyperLink&lt;/asp:HyperLink&gt;&lt;/div&gt; &lt;!--&lt;div class="sag-re-resim"&gt;&lt;img src="images/rss-image.jpg" width="120" height="120" /&gt;&lt;/div&gt;--&gt; &lt;div class="sag-re-icerik" id = icerik runat="server"&gt;Lorem ipsum dolor sit amet, , arcu nec viverra mollis, turpis neque feugiat massa, non dapibus neque nunc ac orci. &lt;/div&gt; &lt;div class="oy-verme"&gt; &lt;!-- &lt;body onload="getDivs()"&gt; --&gt; &lt;!-- &lt;input type="image" src="images/yildiz.png" ID="ImgButton" runat="server" OnServerClick="ImgButton_ServerClick" /&gt;--&gt; &lt;% for (j = i * 5 + 1; j &lt; (i *5)+6; j++) { //Imageid = "Img" + j; %&gt; &lt;div class="yildiz"&gt;&lt;asp:ImageButton ID= id runat="server" Height="19px" ImageUrl="~/images/yildiz.png" OnClick="ImageButton2_Click" Width="20px" style="position: relative; top: 13px; left:6px; float:left; " /&gt;&lt;/div&gt; &lt;% } %&gt; </code></pre> <p>It is c# side</p> <pre><code>protected void ImageButton2_Click(object sender, ImageClickEventArgs e) { ImageButton objImage = (ImageButton)sender; string id = objImage.UniqueID; /* if (e.CommandName == "Comment") { string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' }); string scrapid = commandArgs[0]; string uid = commandArgs[1]; } */ // string s= Imageid.UniqueID.ToString(); //this.baslik2.Text = s; } </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