Adding Link Column to ASP.NET GridView -


I want to produce a list of news that are clickable so far I have to print it a list of headlines Because I pulled the NewsHedline table in the VS 2010 in the Designer view. I think that should make the list elements clickable? I searched for a URL feature, but I did not see it. Do I have a & lt; An href?

  & lt; asp: gridview id = "gridview1" runat = "server" automatically generated columns = "false" Detasorsaidi = "Skyuelditassors 1" Khaleedeta text = "No data record to be displayed." & Gt; & Lt; Columns & gt; & Lt; ASP: BoundfieldDefined = "NewsHeadline" header text = "NewsHedline" sortExpress = "NewsHeadline" /> & Lt; / Column & gt; & Lt; / ASP: GridView & gt; & Lt; Asp: SqlDataSource id = "SqlDataSource1" runat = "server" connectionstring = "& lt;% $ connectionSettings: connectionServing1%>" Provider name = "& lt;%% connection accepted: connection estring 1. provider name% & gt;" SelectCommand = "SELECT [NewsHeadline] [Newstable]" & gt; & Lt; / Asp: SqlDataSource & gt; & Lt; / Form & gt;  

You have to change the column type from the boundcolm to the hyperlink column. P>

  & lt; ASP: Haiprlinkfild Hedertekst = "Nughhedlain" Detaatkstfild = "Nughhedlain" Detanvigiyrlafild = "News-url" Detanvijiayrelifarmstring = "http: // {0}" />  

In addition to this change, you it will need to make sure that you are choosing the URL or something that you can use to create links to news articles. In the above example, I am assuming that the URL is something you can get from your SQL sources. If it is an ID, just type it like the rest of the URL ... "~ / MyNewsPage.aspx? NewsID = {0}" ...


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -