Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. aspnet core use TempData error!

aspnet core use TempData error!

Scheduled Pinned Locked Moved ASP.NET
asp-netquestionsysadminxmlhelp
3 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 9357511
    wrote on last edited by
    #1

    Hi, I write a page and use TempData to transfer information to other view. the code like this TempData["TP"]=tpDoc; //tpDoc is a xml file In another view, I use System.Xml.XmlDocument tpDoc = TempData["TP"] as System.Xml.XmlDocument; above code is working in VS2019. But after I deploy to website, there is error:

    Error.
    An error occurred while processing your request.

    so what is wrong in the code? Why it works in VS2019 and failed on Server?

    Richard DeemingR M 2 Replies Last reply
    0
    • U User 9357511

      Hi, I write a page and use TempData to transfer information to other view. the code like this TempData["TP"]=tpDoc; //tpDoc is a xml file In another view, I use System.Xml.XmlDocument tpDoc = TempData["TP"] as System.Xml.XmlDocument; above code is working in VS2019. But after I deploy to website, there is error:

      Error.
      An error occurred while processing your request.

      so what is wrong in the code? Why it works in VS2019 and failed on Server?

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You need to find out what the actual error is. Trying to diagnose a problem based solely on "an error occurred" is never going to work.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • U User 9357511

        Hi, I write a page and use TempData to transfer information to other view. the code like this TempData["TP"]=tpDoc; //tpDoc is a xml file In another view, I use System.Xml.XmlDocument tpDoc = TempData["TP"] as System.Xml.XmlDocument; above code is working in VS2019. But after I deploy to website, there is error:

        Error.
        An error occurred while processing your request.

        so what is wrong in the code? Why it works in VS2019 and failed on Server?

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        The most common problem is that the file that loads into tpDoc is not where you think it is on the server or you do not have permissions to access is.

        Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups