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. Update panel and button [modified]

Update panel and button [modified]

Scheduled Pinned Locked Moved ASP.NET
questionannouncement
7 Posts 4 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.
  • S Offline
    S Offline
    Soumini Ramakrishnan
    wrote on last edited by
    #1

    I have two Buttons(Edit and Delete) inside UpdatePanel. Edit is worhing properly. When I first click on the Delete button it is not woring. But if I click on it for the second time,it is working. Why?

    modified on Thursday, March 27, 2008 3:57 AM

    C S S 3 Replies Last reply
    0
    • S Soumini Ramakrishnan

      I have two Buttons(Edit and Delete) inside UpdatePanel. Edit is worhing properly. When I first click on the Delete button it is not woring. But if I click on it for the second time,it is working. Why?

      modified on Thursday, March 27, 2008 3:57 AM

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If I could see your code, I'd try to comment on it.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      E 1 Reply Last reply
      0
      • C Christian Graus

        If I could see your code, I'd try to comment on it.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        E Offline
        E Offline
        eyeseetee
        wrote on last edited by
        #3

        It could be that you need to set the focus on the delete button although like the post above i think you will need to show your code for us to help you further

        1 Reply Last reply
        0
        • S Soumini Ramakrishnan

          I have two Buttons(Edit and Delete) inside UpdatePanel. Edit is worhing properly. When I first click on the Delete button it is not woring. But if I click on it for the second time,it is working. Why?

          modified on Thursday, March 27, 2008 3:57 AM

          S Offline
          S Offline
          Sandeep Akhare
          wrote on last edited by
          #4

          Might be you are populating any data sorce which is not again bind again you need to bind that data again check it or show your code

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          1 Reply Last reply
          0
          • S Soumini Ramakrishnan

            I have two Buttons(Edit and Delete) inside UpdatePanel. Edit is worhing properly. When I first click on the Delete button it is not woring. But if I click on it for the second time,it is working. Why?

            modified on Thursday, March 27, 2008 3:57 AM

            S Offline
            S Offline
            Soumini Ramakrishnan
            wrote on last edited by
            #5

            <#databinder.eval(container.dataitem, )%="">'/>
            ]]>' Font-Names ="Verdana" Font-Size ="8pt" > ]]>' > The above is the aspx page. And in code behind page protected void MyDataList_ItemCommand(object source, DataListCommandEventArgs e) { string id = e.CommandName.ToString (); if (e.CommandName == "Delete") { DBLibrary ob = new DBLibrary(); ob.path1 = Server.MapPath("Database/BlogSiteData.mdb"); string uid = Session["user"].ToString(); string photoid = MyDataList.DataKeys[(int)(e.Item.ItemIndex)].ToString(); System.IO.File.Delete(Server.MapPath("Albums/" + uid + "/" + photoid + ".jpg")); string sqldel = "Delete from Albums where Userid='"+uid+"' and Photoid=" + int.Parse(photoid) + " "; ob.ExecuteNonQuery(sqldel); BuildGrid(); } }

            E S 2 Replies Last reply
            0
            • S Soumini Ramakrishnan

              <#databinder.eval(container.dataitem, )%="">'/>
              ]]>' Font-Names ="Verdana" Font-Size ="8pt" > ]]>' > The above is the aspx page. And in code behind page protected void MyDataList_ItemCommand(object source, DataListCommandEventArgs e) { string id = e.CommandName.ToString (); if (e.CommandName == "Delete") { DBLibrary ob = new DBLibrary(); ob.path1 = Server.MapPath("Database/BlogSiteData.mdb"); string uid = Session["user"].ToString(); string photoid = MyDataList.DataKeys[(int)(e.Item.ItemIndex)].ToString(); System.IO.File.Delete(Server.MapPath("Albums/" + uid + "/" + photoid + ".jpg")); string sqldel = "Delete from Albums where Userid='"+uid+"' and Photoid=" + int.Parse(photoid) + " "; ob.ExecuteNonQuery(sqldel); BuildGrid(); } }

              E Offline
              E Offline
              eyeseetee
              wrote on last edited by
              #6

              try putting a simple bit of code in the command for delete so you can check that is working and then you can go through the exisiting code and see which part of that is causing the problem

              1 Reply Last reply
              0
              • S Soumini Ramakrishnan

                <#databinder.eval(container.dataitem, )%="">'/>
                ]]>' Font-Names ="Verdana" Font-Size ="8pt" > ]]>' > The above is the aspx page. And in code behind page protected void MyDataList_ItemCommand(object source, DataListCommandEventArgs e) { string id = e.CommandName.ToString (); if (e.CommandName == "Delete") { DBLibrary ob = new DBLibrary(); ob.path1 = Server.MapPath("Database/BlogSiteData.mdb"); string uid = Session["user"].ToString(); string photoid = MyDataList.DataKeys[(int)(e.Item.ItemIndex)].ToString(); System.IO.File.Delete(Server.MapPath("Albums/" + uid + "/" + photoid + ".jpg")); string sqldel = "Delete from Albums where Userid='"+uid+"' and Photoid=" + int.Parse(photoid) + " "; ob.ExecuteNonQuery(sqldel); BuildGrid(); } }

                S Offline
                S Offline
                Sandeep Akhare
                wrote on last edited by
                #7

                Just rebind your datalist MyDataList.datasource=Sorceid MyDataList.databind(); Might help you

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                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