NavigateUrl on Repeater ASP.net

vyclarks

I have a table in DB:

NOTICE(NUM,TITLE,CONTENT)

I use Repeater Control in ASP to show all the notices in DB, like:

+----------+------------+|
|title1        (readmore)|
|
|title2        (readmore)|
|
|title3        (readmore)|
......
+------------------------+

All I want is: I read a "title" then I clicked on (readmore), the new page will be opened ( show detail's notice) with the "content" of that notice. How can I assign the num of notice without display it to define the notice in next page?

I just assign the title to property Text of a Label ID="TITLE" because I want to show the title of each notice.

All information I want to show in the this page is: title and the readmore( link to the next page). So that I don't know how to assign the num

My asp page: notice.asp

<asp:Repeater ID="RepDetails" runat="server" >
<HeaderTemplate>
<table style="  width:565px" cellpadding="0" class="borber">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="Title" runat="server" Text='<%#Eval("TITLE") %>'  /> 
</td>
<td>
    <asp:HyperLink ID="HyperLink1" runat="server" > (readmord)</asp:HyperLink>
</td>
</tr>    
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater> 

My C# code:notice.asp.cs

 private void BindRepeaterData()
    {
        string sql = "select num,title from NOTICE";
        DataTable ds = l.EXECUTEQUERYSQL(sql);
        RepDetails.DataSource = ds;
        RepDetails.DataBind();

    }

And the next page: detailnotice.asp.cs

private void GetNotice()
    {
        string sql = "select * from NOTICE where num=" ;// num= the num of notice I choose in notice.asp page.
    }

How can I assign a num in Label without display it? What property of Label Control or I should use a other Control ?

Hope you understand what I say. If you don't, please ask?

Sain Pradeep

hi you can ues anchor tag in place of hyper link button. you can pass num in the query string to the detail page.

<a href='detailpage.aspx?id=<%#Eval("NUM") %>'> (readmord)</a>

On details page you can get query string value and fetch details from database.

   int myKey = 0;
    if (!string.IsNullOrEmpty(Request.QueryString["id"]))
    {
        myKey = int.Parse(Request.QueryString["id"]);
        // Use myKey to retrieve record from database
    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

NavigateUrl on Repeater ASP.net

From Dev

ASP.NET C# - NavigateURL with RecordID combine

From Dev

Set an ASP.NET HyperLink NavigateUrl to a relative path?

From Dev

ASP.NET C# - NavigateURL with RecordID combine

From Dev

How to pass argument in hyperLink navigateUrl inside a repeater

From Dev

ASP.NET Repeater - Eval() for bool?

From Dev

Convert Bootstrap Carousel to ASP.Net Repeater

From Dev

ASP .NET Using a Repeater inside of UpdatePanel with UpdateProgress

From Dev

asp.net repeater for each row

From Dev

repeater item command in asp.net

From Dev

to disable a label of repeater on some condition in asp .net

From Dev

Using Bootstrap tabs with ASP NET repeater

From Dev

asp.net repeater use template in javascript

From Dev

To bind images in repeater using asp.net

From Dev

asp.net repeater merge columns dynamically

From Dev

Fix header row in repeater in ASP.NET

From Dev

ASP.NET Converting repeater item to the textbox

From Dev

Repeater asp.net tag not working

From Dev

asp.net repeater merge columns dynamically

From Dev

Convert Bootstrap Carousel to ASP.Net Repeater

From Dev

Conditional statement for Repeater Controll in ASP.NET

From Dev

Fix header row in repeater in ASP.NET

From Dev

trying Image Button in repeater Asp.net

From Dev

asp net dropdown selectedvalue/selectedindex not updating in repeater

From Dev

ASP.Net - Issues with Repeater / DataBinding

From Dev

Repeater in asp.net from DB with DropDownList

From Dev

Adding Header to the repeater in asp.net

From Dev

Right syntax of asp MenuItem NavigateUrl

From Dev

ASP.NET Repeater Control - Getting Hiddenfield value inside the repeater control

Related Related

HotTag

Archive