Örneğin; Repeater içini doldurduktan sonra her satırın buton ile silinmesini istiyoruz; bunun için kod ile bu butonu kontrol etmemiz lazım yapmamız gereken şunlardır arkadaşlar;
Repeater component inin itemCommand eventini tıklıyoruz. Bundan sonra linkbutton veya imagebuttonumuza bir CommandName vererek o butona ulaşmamızı ve CommandArgument ile verilen değeri kontrol etmemizi sağlıyoruz. Şuan alt kızımda CommandArgument değerini “ID” olarak gönderiyoruz bu sayede gönderdiğimiz bu ID ile veritabanından o satırı silebileceğiz.
Bu kısım: Default.aspx
<asp:Repeater ID=”Repeater1″ runat=”server” OnItemCommand=”Repeater1_ItemCommand”>
<ItemTemplate>
<%#Eval(“Baslik”) %>
<asp:ImageButton ID=”ImageButton1″ runat=”server” ImageUrl=”images/del.png”
CommandName=”sil” CommandArgument='<%#Eval(“Id”) %>’ />
</ItemTemplate>
</asp:Repeater>
Alt kısımda da eğer CommandName imiz sil ise butona tıklanmıştır ve e.CommandArgument.ToString() ile gönderilen ID yi yakalıyoruz. tbl_Haber tablosunun prosedür methodu ile de yakaladığımız bu Id yi göndererek veri tabanından siliyoruz.
Bu kısım: Default.cs
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "sil")
{
int sonuc = tbl_Haber.Delete(Convert.ToInt32(e.CommandArgument.ToString()));
}
}
Repeater içinde ki button v.b. event’ına ulaşmaya çalışıyordum, bir türlü halledememiştim, sayende oldu. Çok teşekkürler Allah razı olsun…
Yardımcı olabildiysem sevindim Hocam, İyi çalışmalar..
Thanks for all your efforts on this site. Ellie takes pleasure inn carrying out inverstigation and it’s really simmple to grasp why.
All of us know all abkut the powerful mod you render practical suggestions
via thhe blog and even foster contribution from people about this area of interest plus our own girl is now undrstanding a whole lot.
Have fun with the remaining portion of the year.
Youu aare performing a geeat job.[X-N-E-W-L-I-N-S-P-I-N-X]I’m extremely
inspired with your writing talents and also with the layout for your weblog.
Is that this a paid subject or did you modify it your self?
Either way stay up the nice high quality writing, it is rare
to peer a nice weblog like this one nowadays.
my blog: free dating websites West Yorkshire
Remarkable! Its truly awesome piece of writing, I have got mucch clear idea cncerning from this piece of writing.
Feeel free to visit my web page – fast bathroom remodel
My developer is trying to convince me to move to
.net from PHP. I have always disliked the idea because of the costs.
But he’s tryiong none the less. I’ve been usibg Movable-type on various websites for about a yearr and am
concerned about switching to another platform. I hafe hdard excellent things bout blogengine.net.
Is there a waay I can transfer all my wordpress content into it?
Any help wiuld be really appreciated!
Feel free to visit my web site – bathtub replacement cost
Howdy! This posst could not be written we buy any flat better!
Reading through this post reminds me of my old rooom mate!
He always kept talking about this. I will forward this write-up
to him. Pretty sure he will have a good read. Thank you for sharing!
Примеры продаж на Etsy через Pinterest https://youtu.be/qg-3C_7W1kM после ужасающего падения количества посетителей в месяц
Уникальные индикаторы для трейдинга показывают куда будет двигаться рынок с точностью до 80%, а торговый бот автоматически торгует на бирже без вашего участия. Присоединяйтесь
Массажер-Тренажер Backwood для тела https://youtu.be/lVA65Xvds8Y (спины, поясницы, шеи, плеч, седалищного нерва, живота)
Заработок, благодаря рекламе в Pinterest https://youtu.be/TT31RsoY5x0 от 7000 до 100 000 usd в месяц в Etsy
Адыгея достопримечательности