.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

How do I modify the link of a Hyperlink column ?

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net
 



OK , I'm a bit new to this game. I'm trying to build a web page that simply scans a directory in the server and creates a web page with links to the files in that directory - sounds simple and should be easy to do !

So I have a bit of code that reads the myDocuments folder in my web site and then populates a grid view hyperlink column with the filenames in the folder - wow it works !

The only thing I am struggling with now is getting the hyperlink correct within the GridView so that the user goes to the actual document.

So my code behind is;


Dim dirInfo As New System.IO.DirectoryInfo(Server.MapPath("~/MyDocuments"))  
       articleList.DataSource = dirInfo.GetFiles()  
       articleList.DataBind()  

which reads the file info in the directory myDocuments and binds the info to a datasource.

So now I'm using that datasource to display the filenames in a gridview so that the user can click on a name and open the file.


 

View Complete Post


More Related Resource Links

Creating a custom column with a link to document (other than the name field) in document library

  

Hello!

I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!

T


How to remove underline from Hyperlink and change the color of the link

  
How to remove underline from Hyperlink and change the color of the link

Need to link multiple External Content List items to a single document metadata column

  
I have an external content list - for my purposes, the data isn't any fancier than a list of terms provided by a web service (read only - I don't need update/delete functionality). I want to be able to link any subset of those terms to a single document metadata column (in other words, I need it to work like a normal content list that is defined to allow multiple values in a column) but SharePoint doesn't let me do that on an ECL. I need the content list to be externally driven since more values are going to be added to an outside system over time, but I think it's possible that I may not need a full-fledged ECL list to make this work this way in SharePoint. Just to clarify: I don't need the metadata values in my documents to maintain a PERSISTENT link to the web service (if someone changes an underlying value in the web service DB, it doesn't need to be updated in the document table too). I just want SharePoint to offer up an updated set of source values from the web service if somebody goes in and edits the document metadata. Any ideas for how I can make this work?

How to Change the Color of Link Label which is a Datagridview Column on a Row Selection?

  
Hi All I have a Link label as one of the column of Datagridview & also my SelectionBackColor set to Blue. Is there any way that i can change the link label color on a particular row selection as now my selectionbackcolor & link label color is matching...I am unable to the contents of that link label column. Should i do this on design level or in code level? Pls Help

convert column into hyperlink in gridview

  
hi how can i convert column in grid view into hyperlink  thanks

Calculated column and hyperlink field type

  
Hi I have customer who is asking me if this is possible to provide filter based on the HyperLink field, where he could easly limit results to only those items where link field is filled. As filtering on hyperlink column type is not supported I was thinking to buld some calculated field based on it to return YES (if link is provided) or NO (if link is not provided). The problem is that hyperlink field type is not avialiable on the list of field to be used on calculated field. is there some workaround for that ? thanks for help   Mariusz Gorzoch Blog : http://mariusz.gorzoch.pl Twitter : http://twitter.com/MariuszGorzoch Facebook: http://www.facebook.com/mariusz.gorzoch

Adding a column from another List to a Dataview? Must I link sources or can I just add a new data so

  
Using Designer, I added a dataview to a webpart page and dragged in a single list source. It works as expected. I now want a column from another list in my view. Must I link in another datasource, or can i just insert the data source for the second list into my datasources? The new datasource is there in the code and I see the caml select for it. but my XSL still does not find data: <xsl:value-of select="/dsQueryResponse/Master/Rows/Row[@ID = current()/@Key]/@Lastname" /> I noticed my new columns are not in the <datafields> tag, I tried adding them but it did not help. If Master is my lookup list , @Key is the dataview I will match with and @ID is the column in Master, and @Lastname column I want to return, is the above syntax correct? Many Thanks.    

How can I switch the "Linked to document" link from the 'name' column to another column e.g. title

  
In SP2010 it is not possible to click on the icon to open a document in a list web part. Therefore I want to move the 'linked to document' feature from the name colum to the title column (as I do not show the name colum on the site). How can I do it or how can I make sure that clicking on the document icon leads me to the document and not to the edit menu?

How to link Title to it's associated page in list view without URL path column visible -bug?

  
I don't know if this is a bug or if I'm an idiot (or perhaps both, I'm open minded).   My site I'm developing is a site with publishing features activated where all my news stories are pages. What I want to have is a sortable list (the type hypothetically achieved using the XsltListView Web Part) the lists these pages with 3 columns visible: The Date created, the title (not the page name), and the author. The tricky part is that I would like the title, when clicked on, to take the person to the page. I'm actually almost there. I've created a new view with these specifications except for one issue. To make the title linked to the page, I have to have the column "URL Path" in my list view. When I remove this column, the titles instead all link to the root of the directory I'm in (ex: if I'm in Pages/Forms/My_List.aspx it will link to Pages/Forms/) Is this a bug, or is the URL Path required for the link to work? Is there a way to hide the column? Thanks.

How to convert the datagrid bound column item itself link to another detail page without using hyper

  
Dear experts, I would like to make the datagrid bound column to redirecting to the details page . For example , when my mouse over certain row of bound column in datagrid , it will change the colour to blue . Also , I can click anywhere of the row and the will redirect to the detail page . Can any expert help me on that ? Notes : I do not want to use hyperlink column and do not want to fix the text for every row. I want to use datafield, CommandName and CommandArguement. Thanks & Rgds

Hyperlink to add, modify and delete?

  

On the home page of my SP2010 site (http://blahblah.com/Dev/default.aspx ) I have a few icons.  On the left is the usual SP Libraries and Lists.  In one of the lists is a fairly elaborate InfoPath based add/remove/delete screens (http://blahblah/Dev/Lists/CMDB/AllItems.aspx ).  I'd like to make the icons on the home page hyperlinked to allow the user to jump directly into the 'Add new Item' to a list, 'Edit' a list item, or 'Modify' a list item ... all in modal dialog format.

If I go to the list I want to have this work for and hover over the Add New Item in the List I get this:

http://blahblah.com/Dev/_layouts/listform.aspx?PageType=8&ListId={AD9712E6-CC28-4ACD-9192-C1ECCEDA96C7}&RootFolder=

Is there a way to easily provide a hyperlink to this?

Thanks.


disable foreign key link depending on column value in the current row using Attributes

  

Hi ,

I want to disable  some foreign key links depending on column value in the current row

I am trying to have attribute like this :


[Disablelink("True","OrderDate","==","null"] 

 public partial class Order
    {

        internal sealed class OrderMetadata
        {
          
            [Disablelink("True","OrderDate","==","null"]
            public EntityCollection<Order_Detail> Order_Details { get; set; }

            public Nullable<DateTime> OrderDate { get; set; }

          

         }
        }
    }


I had a look at Mr. Steve code for row highlighting , Conditional UIHint

http://csharpbits.notaclue.net/2010/07/conditional-row-highlighting-in-

Cannot modify a column type in a table in SQL Serv 2008 Ent

  
I used ot be able to do it when the same tables were part of Sql Express: to change the column type in SSMS but now I get an error. I have never seen it before. I created a large number of table in one DB and for some reason I cannot recall, some of them ended up with int type for volume column, others bigInt. They all appear to have been created from .NET C# code not manually. Now I am getting exceptions because my code expects Int64 across the board.

This is the message that pops up when I try to save the change:

Saving Changes is not permitted. The changes you have made require the following tables to be dropped and recreated. You have either made changes toi a table that can't be recreated or enabled the option prevents saving changes that require the table to be re-created.

Apparently some option is set up wrongly in the Properties=>Options. the question is which one? I checked all Alter options and still cannot save the change.


Thanks.
AlexB

Aboslute path needed for hyperlink column

  

Hi,

I am working on data datagrid and getting 1 column as Hyper Column 

 

the Hyperlink Column is declared as 

 

<asp:HyperLinkColumn DataNavigateUrlField="Path" DataTextField="SongName" 

                    HeaderText="Songs" Target="_self" DataNavigateUrlFormatString="/{0}"></asp:HyperLinkColumn>

where SongName and Path are coming from database

 

 

now the values of Path is in the format "http://abc.html"

however when I click on the grid it gives me something like this http://localhost:XXXX/http://abc.html

 

Please tell me how to convert this relative path to absolute path.


Can't modify Top Link Bar on Site Collection

  

Hi everyone,

I have been trying to modify the top link bar of a site collection, however, I've been running into problems.  I have tried two approaches so far.  I tried doing it programatically by creating a custom feature that make the modification upon activation (and would then undo the modification upon deactivation), however, when activating it an exception is thrown stating, "the top link bar can only be edited for a Web site with unique navigation." 

I've found references to to a link for the Top Link Bar under the Look and Feel section of the Site Setting, however I can't seem to see it anywhere.  I see the Navigation link but that only modifies the quick launch menu. 

I'm just wondering if anyone has any experience with this and knows of a solution or can point out anything that I'm missing.

Thanks!


Calculated Column with Embedded Link

  
MOSS 2007 - I'd like to create a calculated column in a List that presents itself as a link (<a> tag) similar to how the Title column has version for Edit and View links (rather than simple text).  Is is possible top mimic this OOTB behavior?

Need to link multiple External Content List items to a single document metadata column

  

I have an external content list - for my purposes, the data isn't any fancier than a list of terms provided by a web service (read only - I don't need update/delete functionality). I want to be able to link any subset of those terms to a single document metadata column (in other words, I need it to work like a normal content list that is defined to allow multiple values in a column) but SharePoint doesn't let me do that on an ECL. I need the content list to be externally driven since more values are going to be added to an outside system over time, but I think it's possible that I may not need a full-fledged ECL list to make this work this way in SharePoint.

Just to clarify: I don't need the metadata values in my documents to maintain a PERSISTENT link to the web service (if someone changes an underlying value in the web service DB, it doesn't need to be updated in the document table too). I just want SharePoint to offer up an updated set of source values from the web service if somebody goes in and edits the document metadata.

Any ideas for how I can make this work?


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend