Hello everyone as I am new in asp.net C# I need some help from seniors
There is a table with following columns:
ID int unique not null
Title varchar(250) not null
Username varchar(100) not null
Datetime datetime not null
Shortviews varchar(500) not null
Fullviews varchar(1000) not null
Photo image not null
I have successfully coded the page for inserting data in this table Now I want to display it on the page, I used repeater data control to display its Title only and put it in attribute the code is below
<asp:Repeater ID="article_rep" runat="server"
onitemcommand="article_rep_ItemCommand">
<itemtemplate>
<ul class="list1">
<li><a href="#"><%# Eval("Title")%></a></li>
</ul>
</itemtemplate>
</asp:Repeater>
Behind the code I selected Data with following code
protected void Page_Load(object sender, EventArgs e)
{
string strConnString = ConfigurationManager.ConnectionStrings["LgnConnectionString"].ConnectionString;
string str;
SqlCommand com;
SqlConnection con = new SqlConnection(strConnString);
con.Open();
str = "select top 5 Title from table ORDER BY Datetime DESC";
com = new SqlCommand(str, con);
SqlDataReader reader;
reader = com.ExecuteReader();
world_rep.DataSource = reader;
world_rep.DataBind();
con.Close();
}
it display the table records for last five rows, I want that when I click on any title it display the rest of columns information associated with that Title, which I clicked, on another page that will be Details.aspx
I know it is simple and easy for seniors but I get struck on it please help me, thanks in advance. What I will have to code on Details.aspx and what will I have to code on Details.aspx.cs