ASP.net strange object error

Discussion in 'MCSE' started by Do, Nov 26, 2003.

  1. Do

    Do Guest

    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(strFolder &
    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 &gt;&gt;</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
    Do, Nov 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c2FuanU=?=

    information about asp ,oracle,asp.net certification?

    =?Utf-8?B?c2FuanU=?=, May 18, 2005, in forum: Microsoft Certification
    Replies:
    1
    Views:
    542
    Bob Christian
    May 18, 2005
  2. Zabron Muyambo

    Easy Moving from ASP to ASP.NET???

    Zabron Muyambo, Oct 26, 2004, in forum: MCSD
    Replies:
    7
    Views:
    500
    Zabron Muyambo
    Oct 27, 2004
  3. thehobbit
    Replies:
    0
    Views:
    3,743
    thehobbit
    Nov 22, 2006
  4. fluoronator

    COM object in asp.net

    fluoronator, Mar 4, 2008, in forum: Software
    Replies:
    1
    Views:
    1,082
    fluoronator
    Mar 4, 2008
  5. london1919
    Replies:
    1
    Views:
    2,925
    Lawrence Garvin \(MVP\)
    Dec 8, 2008
Loading...

Share This Page