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. iam reading web.config Appsetting value of add atrribute in asp but iam facing the error of object required

iam reading web.config Appsetting value of add atrribute in asp but iam facing the error of object required

Scheduled Pinned Locked Moved ASP.NET
helpsysadmin
2 Posts 2 Posters 0 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.
  • G Offline
    G Offline
    googlejumbo
    wrote on last edited by
    #1

    hii iam using the below code in my asp file Dim LinkUrl Dim strEnabledSessionCheck set xmlDoc=server.CreateObject("Microsoft.XMLDOM") set xmlappSettings=server.CreateObject("Microsoft.XMLDOM") set xmladd=server.CreateObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load(server.MapPath ("../web.config") ) set xmlappSettings = xmldoc.GetElementsByTagName("appSettings").item(0) ''response.Write (1) set xmladd = xmlappSettings.GetElementsByTagName("add") 'response.Write(1) for each x in xmladd 'Check for the Atrribute Value If x.getAttribute("key") ="EnabledSessionCheck" then 'Response.write(x.getAttribute("value")) strEnabledSessionCheck = x.getAttribute("value") ' response.Write (strEnabledSessionCheck) but in the code line: set xmladd = xmlappSettings.GetElementsByTagName("add") iam getting the following error: Error Type: Microsoft VBScript runtime (0x800A01A8) Object required kindly help me out

    S 1 Reply Last reply
    0
    • G googlejumbo

      hii iam using the below code in my asp file Dim LinkUrl Dim strEnabledSessionCheck set xmlDoc=server.CreateObject("Microsoft.XMLDOM") set xmlappSettings=server.CreateObject("Microsoft.XMLDOM") set xmladd=server.CreateObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load(server.MapPath ("../web.config") ) set xmlappSettings = xmldoc.GetElementsByTagName("appSettings").item(0) ''response.Write (1) set xmladd = xmlappSettings.GetElementsByTagName("add") 'response.Write(1) for each x in xmladd 'Check for the Atrribute Value If x.getAttribute("key") ="EnabledSessionCheck" then 'Response.write(x.getAttribute("value")) strEnabledSessionCheck = x.getAttribute("value") ' response.Write (strEnabledSessionCheck) but in the code line: set xmladd = xmlappSettings.GetElementsByTagName("add") iam getting the following error: Error Type: Microsoft VBScript runtime (0x800A01A8) Object required kindly help me out

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, I think the stmt before: set xmlappSettings = xmldoc.GetElementsByTagName("appSettings").item(0) doesn't return a value (null). Did you checked the result of xmldoc.GetElementsByTagName("appSettings") ? Regards Sebastian

      It's not a bug, it's a feature! Me in Softwareland.

      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