PDA

View Full Version : Update and Delete for gridview row not working after publishing website


ASMJ
09-07-2006, 02:05 AM
Hello,

I have created a sample website, which has a gridview to view, update and delete data from the DB and a few data entry fields for insert and search operations on the data.

All these are working fine in my local system. I have published the website locally and copied it to the DASP server using FTP. I have also attached the database.

Insert and Search operations are working. (I have explicitly written the INSERT and SELECT statements in the codebehind)

But I am not able to EDIT or DELETE records in the gridview (I have used thecommand field option for editing and have put a seperateTemplate Fieldfor Delete)

When I click on Update link, it does not update and does not give any error msg. Same is with delete.

Could anyone help me in solving the problem? Is it because I have published it and the compiled code does not have the html source generated by the grid view and datasource??

Thanks
ASMJ

vvsharma
09-08-2006, 11:54 AM
You mean everything works fine locally?and Edit/Delete doesnt when you upload it to our server?Could you provide the part of the code where you have you Delete/Edit ?

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

wisemx
09-09-2006, 01:00 AM
It's a good practice to qualify cells and then fill any empty cells with either static data that represents no value exists or a simple  , this will also help make the tables look the same in other browsers.

vvsharma
09-09-2006, 10:50 AM
So ,the empty cell values are used by you to delete/update those specific rows at the back end?I guess filling them with any value wont help.Are you using TemplateField's EditItemTemplate field right?Refer the following Page for more Information on the same and examples.
Also,posting a code snippet would be helpful.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx03.asp

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

ASMJ
09-09-2006, 12:30 PM
Thanks for the reply.


I just figured out the cause of the problem. This is because there are empty cells in the rows which I try to delete or update.


So, I will have to figure out how to handle such inputs when using command fields of the grid view.


Any ideas how this is to be done?


Thanks


ASMJ

ASMJ
09-11-2006, 01:56 AM
Thanks for the replies, I will work on it and see if it solves the problem