<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"WebForm1.aspx.cs\" Inherits=\"WebApplication12.WebForm1\" %>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head runat=\"server\">\r\n <title></title>\r\n</head>\r\n<body>\r\n <form id=\"form1\" runat=\"server\">\r\n <div>\r\n <ul>\r\n <!-- Repeater oluşturma -->\r\n <asp:Repeater ID=\"rptKategori\" runat=\"server\">\r\n <ItemTemplate>\r\n <li> <%#Eval(\"Ad\") %></li>\r\n </ItemTemplate>\r\n </asp:Repeater>\r\n </ul>\r\n </div>\r\n </form>\r\n</body>\r\n</html>
C# Codebehind (.aspx.cs)
using System;\r\nusing System.Data.SqlClient;\r\nusing System.Data;\r\nnamespace WebApplication12\r\n{\r\n public partial class WebForm1 : System.Web.UI.Page\r\n {\r\n protected void Page_Load(object sender, EventArgs e)\r\n {\r\n KategorileriGetir();\r\n }\r\n\r\n void KategorileriGetir()\r\n {\r\n SqlDataAdapter adp = new SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\");\r\n DataSet ds = new DataSet();\r\n adp.Fill(ds);\r\n rptKategori.DataSource = ds.Tables[0];\r\n rptKategori.DataBind();\r\n \r\n }\r\n }\r\n}
Vb.Net dilinde bir asp.net Repeater kullanımı örneği
Imports System.Data.SqlClient\r\n\r\nPublic Class WebForm1\r\n Inherits System.Web.UI.Page\r\n\r\n Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\r\n KategorileriGetir()\r\n End Sub\r\n\r\n Sub KategorileriGetir()\r\n Dim adp As New SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\")\r\n Dim ds As New DataSet\r\n adp.Fill(ds)\r\n rptKategori.DataSource = ds.Tables(0)\r\n rptKategori.DataBind()\r\n End Sub\r\nEnd Class
","url":"https://uzmanim.net/soru/asp-net-te-repeater-nasil-kullanilir-repeater-a-nasil-veri-baglanir/1623#a1624","author":{"@type":"Person","name":"alattin"},"comment":[],"commentCount":0,"dateCreated":"2013-12-08T23:33:36.64+02:00","dateModified":"2013-12-08T23:33:36.64+02:00","text":"
C# dilinde bir asp.net Repeater kullanımı örneği (veri kaynağı olarak MS SQL tanımlanmıştır):
ASPX kodu:
<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"WebForm1.aspx.cs\" Inherits=\"WebApplication12.WebForm1\" %>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head runat=\"server\">\r\n <title></title>\r\n</head>\r\n<body>\r\n <form id=\"form1\" runat=\"server\">\r\n <div>\r\n <ul>\r\n <!-- Repeater oluşturma -->\r\n <asp:Repeater ID=\"rptKategori\" runat=\"server\">\r\n <ItemTemplate>\r\n <li> <%#Eval(\"Ad\") %></li>\r\n </ItemTemplate>\r\n </asp:Repeater>\r\n </ul>\r\n </div>\r\n </form>\r\n</body>\r\n</html>
C# Codebehind (.aspx.cs)
using System;\r\nusing System.Data.SqlClient;\r\nusing System.Data;\r\nnamespace WebApplication12\r\n{\r\n public partial class WebForm1 : System.Web.UI.Page\r\n {\r\n protected void Page_Load(object sender, EventArgs e)\r\n {\r\n KategorileriGetir();\r\n }\r\n\r\n void KategorileriGetir()\r\n {\r\n SqlDataAdapter adp = new SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\");\r\n DataSet ds = new DataSet();\r\n adp.Fill(ds);\r\n rptKategori.DataSource = ds.Tables[0];\r\n rptKategori.DataBind();\r\n \r\n }\r\n }\r\n}
Vb.Net dilinde bir asp.net Repeater kullanımı örneği
Imports System.Data.SqlClient\r\n\r\nPublic Class WebForm1\r\n Inherits System.Web.UI.Page\r\n\r\n Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\r\n KategorileriGetir()\r\n End Sub\r\n\r\n Sub KategorileriGetir()\r\n Dim adp As New SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\")\r\n Dim ds As New DataSet\r\n adp.Fill(ds)\r\n rptKategori.DataSource = ds.Tables(0)\r\n rptKategori.DataBind()\r\n End Sub\r\nEnd Class
","upvoteCount":0},"answerCount":1,"suggestedAnswer":{"@type":"Answer","name":"
C# dilinde bir asp.net Repeater kullanımı örneği (veri kaynağı olarak MS SQL tanımlanmıştır):
ASPX kodu:
<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"WebForm1.aspx.cs\" Inherits=\"WebApplication12.WebForm1\" %>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head runat=\"server\">\r\n <title></title>\r\n</head>\r\n<body>\r\n <form id=\"form1\" runat=\"server\">\r\n <div>\r\n <ul>\r\n <!-- Repeater oluşturma -->\r\n <asp:Repeater ID=\"rptKategori\" runat=\"server\">\r\n <ItemTemplate>\r\n <li> <%#Eval(\"Ad\") %></li>\r\n </ItemTemplate>\r\n </asp:Repeater>\r\n </ul>\r\n </div>\r\n </form>\r\n</body>\r\n</html>
C# Codebehind (.aspx.cs)
using System;\r\nusing System.Data.SqlClient;\r\nusing System.Data;\r\nnamespace WebApplication12\r\n{\r\n public partial class WebForm1 : System.Web.UI.Page\r\n {\r\n protected void Page_Load(object sender, EventArgs e)\r\n {\r\n KategorileriGetir();\r\n }\r\n\r\n void KategorileriGetir()\r\n {\r\n SqlDataAdapter adp = new SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\");\r\n DataSet ds = new DataSet();\r\n adp.Fill(ds);\r\n rptKategori.DataSource = ds.Tables[0];\r\n rptKategori.DataBind();\r\n \r\n }\r\n }\r\n}
Vb.Net dilinde bir asp.net Repeater kullanımı örneği
Imports System.Data.SqlClient\r\n\r\nPublic Class WebForm1\r\n Inherits System.Web.UI.Page\r\n\r\n Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\r\n KategorileriGetir()\r\n End Sub\r\n\r\n Sub KategorileriGetir()\r\n Dim adp As New SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\")\r\n Dim ds As New DataSet\r\n adp.Fill(ds)\r\n rptKategori.DataSource = ds.Tables(0)\r\n rptKategori.DataBind()\r\n End Sub\r\nEnd Class
","url":"https://uzmanim.net/soru/asp-net-te-repeater-nasil-kullanilir-repeater-a-nasil-veri-baglanir/1623#a1624","author":{"@type":"Person","name":"alattin"},"comment":[],"commentCount":0,"dateCreated":"2013-12-08T23:33:36.64+02:00","dateModified":"2013-12-08T23:33:36.64+02:00","text":"
C# dilinde bir asp.net Repeater kullanımı örneği (veri kaynağı olarak MS SQL tanımlanmıştır):
ASPX kodu:
<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"WebForm1.aspx.cs\" Inherits=\"WebApplication12.WebForm1\" %>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head runat=\"server\">\r\n <title></title>\r\n</head>\r\n<body>\r\n <form id=\"form1\" runat=\"server\">\r\n <div>\r\n <ul>\r\n <!-- Repeater oluşturma -->\r\n <asp:Repeater ID=\"rptKategori\" runat=\"server\">\r\n <ItemTemplate>\r\n <li> <%#Eval(\"Ad\") %></li>\r\n </ItemTemplate>\r\n </asp:Repeater>\r\n </ul>\r\n </div>\r\n </form>\r\n</body>\r\n</html>
C# Codebehind (.aspx.cs)
using System;\r\nusing System.Data.SqlClient;\r\nusing System.Data;\r\nnamespace WebApplication12\r\n{\r\n public partial class WebForm1 : System.Web.UI.Page\r\n {\r\n protected void Page_Load(object sender, EventArgs e)\r\n {\r\n KategorileriGetir();\r\n }\r\n\r\n void KategorileriGetir()\r\n {\r\n SqlDataAdapter adp = new SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\");\r\n DataSet ds = new DataSet();\r\n adp.Fill(ds);\r\n rptKategori.DataSource = ds.Tables[0];\r\n rptKategori.DataBind();\r\n \r\n }\r\n }\r\n}
Vb.Net dilinde bir asp.net Repeater kullanımı örneği
Imports System.Data.SqlClient\r\n\r\nPublic Class WebForm1\r\n Inherits System.Web.UI.Page\r\n\r\n Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\r\n KategorileriGetir()\r\n End Sub\r\n\r\n Sub KategorileriGetir()\r\n Dim adp As New SqlDataAdapter(\"Select * from Kategori\", \"Server=.\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI\")\r\n Dim ds As New DataSet\r\n adp.Fill(ds)\r\n rptKategori.DataSource = ds.Tables(0)\r\n rptKategori.DataBind()\r\n End Sub\r\nEnd Class
","upvoteCount":0},"upvoteCount":0}}
Asp.Net C# ve Vb.net dilleri ile Repeater kontrolüne MS SQL veri kaynağından nasıl veri bağlanır?
Web Formlarında repeater nasıl kullanılır?
Toplam 1 cevap
C# dilinde bir asp.net Repeater kullanımı örneği (veri kaynağı olarak MS SQL tanımlanmıştır):
ASPX kodu:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication12.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <ul> <!-- Repeater oluşturma --> <asp:Repeater ID="rptKategori" runat="server"> <ItemTemplate> <li> <%#Eval("Ad") %></li> </ItemTemplate> </asp:Repeater> </ul> </div> </form> </body> </html>
C# Codebehind (.aspx.cs)
using System; using System.Data.SqlClient; using System.Data; namespace WebApplication12 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { KategorileriGetir(); } void KategorileriGetir() { SqlDataAdapter adp = new SqlDataAdapter("Select * from Kategori", "Server=.\\SQLEXPRESS;Database=BILET;Integrated Security=SSPI"); DataSet ds = new DataSet(); adp.Fill(ds); rptKategori.DataSource = ds.Tables[0]; rptKategori.DataBind(); } } }
Vb.Net dilinde bir asp.net Repeater kullanımı örneği
Imports System.Data.SqlClient Public Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load KategorileriGetir() End Sub Sub KategorileriGetir() Dim adp As New SqlDataAdapter("Select * from Kategori", "Server=.\SQLEXPRESS;Database=BILET;Integrated Security=SSPI") Dim ds As New DataSet adp.Fill(ds) rptKategori.DataSource = ds.Tables(0) rptKategori.DataBind() End Sub End Class