I have set the requisite attributes in the Grid View tag.
(Note, in the gridview the Enable View State="False" - if I set it to True I get the standard "Failed to load viewstate. error) One strange thing that I've noticed that makes me think it's a View State problem is that if I change the Command Name of the Update button to "Edit" that postback event does get captured in the Row Command event...
This works as expected and I can put a breakpoint in the Row Command event handler to see the "Event" command name.
Rowupdating get data
However, I'd like to safely Html Encode text that is displayed as we do allow special characters in certain fields. NET parses the code and detects a Bind() statement, it splits the statement into two parts.
This is a cinch to do with standard Bound Fields, as I just set Html Encode to true. NET parses your file and sees you're using it generates some special code for it. The first part is the one-way databinding portion, which ends up being just a regular Eval() call.
I am using a Template Field to display my Edit, Update and Cancel 'buttons' in the first column of the Grid View within respective Item Template and Edit Item Template fields.
Within the Item Template I have an Image Buttong with a Command Name of "Edit".
One has it's Command Name = "Update" and the other "Cancel".
My problem lies in that the click on the Update Image Button posts back, but neither the Row Command nor Row Updating events get triggered.
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
I've got it supporting editing as well, which works just fine.
Thanks to your article I can go forward with my personal project, so I am very very grateful.
Is this compatible with copying data from excel and pasting it in the gridview you are providing us?
But automatic encoding is NOT the case for a label for instance.