<system.web.services.webmethod()> Public Shared Function GetItems() As String If System.IO.File.Exists(filePath) Then input = File.ReadAllText(filePath) End If Dim da As New DSGardlecTableAdapters.PartnersTableAdapter Dim dt As New DSGardlec.PartnersDataTable Dim dr As DSGardlec.PartnersRow dt = da.GetActivePartnersListSorted dr = dt.Rows(3) output = input.Replace("<%a%>", "/DynamicImages/Partners/thumbnails/" & dr.Partner_Image) output = output.Replace("<%Partener_Name%>", dr.Partener_Name) output = output.Replace("<%Partener_Link%>", dr.Partener_Link) Return output.ToString End Function
input
output
GetItems()
Public Shared myFilepath As String = HttpContext.Current.Server.MapPath("~/folder/filename")
HttpContext.Current
Nothing
NullReferenceException
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)