Update panel and button [modified]
-
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
-
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
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 )
-
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 )
-
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
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... "
-
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
<#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(); } } -
<#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(); } } -
<#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(); } }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... "