|
| Hi,
I get this error, "Object reference not set to an instance of an object."
when I set the properties
to a label. However, when I response.write them all out, they work just
fine.
Any ideas?
Do
----------------------------------------------------------------------------
------------------
Try
'Display the repeater template with the link enabled
Dim objDoc As New document
dtgDocument.DataSource =
objDoc.getdocuments(Request.QueryString("filename"), , )
dtgDocument.DataBind()
objDoc = Nothing
Try
'Run document security check
Dim objDocUser As New user
Dim objFileProps As New PropertyReaderClass
Dim objPropReader As DocumentProperties
GC.Collect()
Dim strFolder As String
strFolder = Server.MapPath("../files/")
objPropReader = objFileProps. GetDocumentProperties(strFolde
r &
Request.QueryString("filename"))
'Setting
Response.Write(objPropReader.Title())
Response.Write(objPropReader.Subject())
Response.Write(objPropReader.Author())
Response.Write(objPropReader.Comments)
Response.Write(objPropReader.AppName)
Response.Write(objPropReader.Keywords())
Response.Write(objPropReader.Name())
Response.Write(objPropReader.Thumbnail())
Response.Write(objPropReader.ByteCount())
'lblTitle.Text = objPropReader.Title()
'lblSubject.Text = objPropReader.Subject()
'lblAuthor.Text = objPropReader.Author()
'lblComments.Text = objPropReader.Comments
'lblApplication.Text = objPropReader.AppName
'lblIcon.Text = objPropReader.Icon()
'lblKeywords.Text = objPropReader.Keywords()
'lblFilename.Text = objPropReader.Name()
'lblThumbnail.Text = objPropReader.Thumbnail()
'lblSize.Text = objPropReader.ByteCount()
'*********************
'Document security check should only be run against the forms authentication
ticket
'Remove the querystring, this is not for security
If objDocUser.isfoldermember(Request.QueryString("folderid"), objUser.Name)
Then
lblDownload.Text = "<a href='../files/" & Request.QueryString("filename") &
"'>Download Now >></a>"
Else
lblDownload.Text = "<B>You do not have rights to download this
document.</B>"
End If
objDocUser = Nothing
Catch ex As Exception
lblMessage.Text = ex.message
End Try
Catch ex As Exception
lblMessage.Text = ex.message
End Try
|
|