hi guys,
i m displaying news titles & it's contents using repeater control.
pictorial representation:

news Title 1
news Title 2
news Title 3
news Title 4

now, when i click on news Title 1,it's content should appear from my database in between news title 1 and news title 2.same thing like accordin pane.when i click news title 2 then it's content should appear between news title and news title 3.

i m using asp.net2.0

Recommended Answers

All 5 Replies

itemTemplate :)

hi guys,
i m displaying news titles & it's contents using repeater control.
pictorial representation:

news Title 1
news Title 2
news Title 3
news Title 4

now, when i click on news Title 1,it's content should appear from my database in between news title 1 and news title 2.same thing like accordin pane.when i click news title 2 then it's content should appear between news title and news title 3.

i m using asp.net2.0

you need to set the CommandName property of your link button(news title 1 and so on) showing in repeater control. Then you need to handle the ItemCommand event of Repeater control and then pass the commandName in your select query or whatever you are using to show the content of news title in accordin panel.

you need to set the CommandName property of your link button(news title 1 and so on) showing in repeater control. Then you need to handle the ItemCommand event of Repeater control and then pass the commandName in your select query or whatever you are using to show the content of news title in accordin panel.

thanks for the sauggestion i have used repeater control and then take headertempalte n itemtemplate,in itemtemplate

       <ItemTemplate>
            <table>
            <tr>

                <td><asp:HyperLink ID="HyperLink1" navigateurl='<%# String.Format("Default.aspx?News_Id={0}", Eval("News_Id")) %>' runat="server"><%#DataBinder.EvalContainer.DataItem,"News_Title") %></asp:HyperLink></td>
            </tr>
            </table>

        </ItemTemplate>

now i got the links on the news titles.

NEXT PROBLEM:

i want to show news title and news content on other page as i have passed news_id by session shown in upper side code in itemtemplate.now how can i show records with and wthout using any data control on another web form?

thanks for the sauggestion i have used repeater control and then take headertempalte n itemtemplate,in itemtemplate
<ItemTemplate>
<table>
<tr>

<td><asp:HyperLink ID="HyperLink1" navigateurl='<%# String.Format("Default.aspx?News_Id={0}", Eval("News_Id")) %>' runat="server"><%#DataBinder.EvalContainer.DataItem,"News_Title") %></asp:HyperLink></td>
</tr>
</table>

</ItemTemplate>

now i got the links on the news titles.

NEXT PROBLEM:

i want to show news title and news content on other page as i have passed news_id by session shown in upper side code in itemtemplate.now how can i show records with and wthout using any data control on another web form?

It will be placed in Header Control. You cannot fire the header control like grid view so you have to write it by yourself.

See here for understand more.

[snipped]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.