Sometimes we need to pull out links from the database and assign it to hyperlink control. If you write your link in the database like this:
LinkName: MSDN
URL: www.msdn.microsoft.com
To you it may seems right since the link is correct. But when you assign the link to a hyperlink control it will read as the virtual path link which will have the path of your application. If you click on the click it will take you to the url which should be present in your application directory.
In order to make it work correctly and go to the msdn website you need to insert links in your database with http://www.msdn.microsoft.com . The http keyword tells the asp.net compiler that this is an outside link and not found in the application directory.
No comments:
Post a Comment