Click here to Skip to main content
16,016,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone as I am new in asp.net C# I need some help from seniors

There is a table with following columns:

SQL
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.NET
<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

C#
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
Posted
Updated 26-Oct-13 1:08am
v3
Comments
Ashwini Thakare 4-Jun-14 4:44am    
what is this world_rep

1 solution

 
Share this answer
 
Comments
Member 10361501 26-Oct-13 8:36am    
Sir thank you for your reply but its not the answer what I asked for help, it explains how to pass multiple values but my question is "I want to display the records associated with the Title"

it is like when we click on a headline of news in a news website, it opens in new page with all details about that news. i am developing a comments page what I want is when a visitor click on comment title it navigate to the next page which is details.aspx and display the rest of information against that comment.

Thank you, will feel happy if you will help me in this regard :)
Member 10361501 26-Oct-13 12:08pm    
ANYONE PLZ???????????????????//

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900