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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Delete record from XML File

Delete record from XML File

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptcssasp-nettools
1 Posts 1 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.
  • C Offline
    C Offline
    codingrocks
    wrote on last edited by
    #1

    I am doing a .NET web application in which i am using data from XML file to bind to grid. I have an Add and Delete button also near the GridView. Each row in grid has a check box also. On Checking and Click Delete button, it has to delete the record from XML file. I am new to XML so, any help will be appreciated.. The piece of code i used was as follows On click on Delete Button try { string strFileName = HttpContext.Current.Request.PhysicalApplicationPath + "XMLFiles\\UserList.xml"; XmlDocument doc = new XmlDocument(); doc.Load(strFileName); doc.Save(strFileName); string strScript = "<script language=\"JavaScript\"> window.dialogArguments.window.location=window.dialogArguments.window.location; window.close();</script>"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", strScript); } catch (Exception ex) { string strException = ex.Message.ToString(); string strError = "User.aspx" + "~" + "btnDelete_Click" + "~" + strException; Session.Add("ExceptionError", strError); Response.Redirect("Errorpage.aspx", false); }

    SAJAN A PILLAI ASP.NET,C#.NET Programmer BANGALORE "Winners don't do different things. They do things differently. ...

    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