Greetings,
I have a GridView control. For a couple of reasons, I ended up with a
TemplateField to contain my Edit and Delete links, something like this:
<asp:TemplateFi eld ShowHeader="Fal se">
<EditItemTempla te>
<asp:LinkButt on ID="LinkButton1 " runat="server" CausesValidatio n="True"
CommandName="Up date" Text="Update"></asp:LinkButton>
<asp:Link Button ID="LinkButton2 " runat="server"
CausesValidatio n="False"
CommandName="Ca ncel" Text="Cancel"></asp:LinkButton>
</EditItemTemplat e>
<ItemTemplate >
<asp:LinkButt on ID="LinkButton1 " runat="server"
CausesValidatio n="False"
CommandName="Ed it" Text="Edit"></asp:LinkButton>
<asp:Link Button ID="lnkDelete" runat="server"
CausesValidatio n="false"
CommandName="De lete" Text="Delete"
OnClientClick=" return confirm('Are you sure you want to delete this
record?');" />
</ItemTemplate>
In addition, the GridView control is bound to an ObjectDataSourc e object
that contains the following:
<asp:ObjectData Source ID="ObjectDataS ource1" runat="server"
DeleteMethod="D eleteActivity" InsertMethod="I nsertActivity"
SelectMethod="G etActivities" TypeName="SoftC ircuits.MediCor p.Activities"
UpdateMethod="U pdateActivity">
<DeleteParamete rs>
<asp:Paramete r Name="activityI d" Type="Int32" />
</DeleteParameter s>
<UpdateParamete rs>
...
</UpdateParameter s>
<SelectParamete rs>
...
</SelectParameter s>
<InsertParamete rs>
...
</InsertParameter s>
</asp:ObjectDataS ource>
I'm trying to understand how some of this information hooks up. When I click
the delete link (and click OK in the confirmation), the DeleteActivity
method of SoftCircuits.Me diCorp.Activiti es does in fact get called. However,
the activityId argument is always 0.
Can anyone help me understand where the ObjectDataSourc e should be getting
this argument value from such that it would represent the id of the record
on the row for which the Delete link was clicked?
The activityId represents the primary key of the table being displayed.
Thanks.
--
Jonathan Wood
SoftCircuits Programming
I have a GridView control. For a couple of reasons, I ended up with a
TemplateField to contain my Edit and Delete links, something like this:
<asp:TemplateFi eld ShowHeader="Fal se">
<EditItemTempla te>
<asp:LinkButt on ID="LinkButton1 " runat="server" CausesValidatio n="True"
CommandName="Up date" Text="Update"></asp:LinkButton>
<asp:Link Button ID="LinkButton2 " runat="server"
CausesValidatio n="False"
CommandName="Ca ncel" Text="Cancel"></asp:LinkButton>
</EditItemTemplat e>
<ItemTemplate >
<asp:LinkButt on ID="LinkButton1 " runat="server"
CausesValidatio n="False"
CommandName="Ed it" Text="Edit"></asp:LinkButton>
<asp:Link Button ID="lnkDelete" runat="server"
CausesValidatio n="false"
CommandName="De lete" Text="Delete"
OnClientClick=" return confirm('Are you sure you want to delete this
record?');" />
</ItemTemplate>
In addition, the GridView control is bound to an ObjectDataSourc e object
that contains the following:
<asp:ObjectData Source ID="ObjectDataS ource1" runat="server"
DeleteMethod="D eleteActivity" InsertMethod="I nsertActivity"
SelectMethod="G etActivities" TypeName="SoftC ircuits.MediCor p.Activities"
UpdateMethod="U pdateActivity">
<DeleteParamete rs>
<asp:Paramete r Name="activityI d" Type="Int32" />
</DeleteParameter s>
<UpdateParamete rs>
...
</UpdateParameter s>
<SelectParamete rs>
...
</SelectParameter s>
<InsertParamete rs>
...
</InsertParameter s>
</asp:ObjectDataS ource>
I'm trying to understand how some of this information hooks up. When I click
the delete link (and click OK in the confirmation), the DeleteActivity
method of SoftCircuits.Me diCorp.Activiti es does in fact get called. However,
the activityId argument is always 0.
Can anyone help me understand where the ObjectDataSourc e should be getting
this argument value from such that it would represent the id of the record
on the row for which the Delete link was clicked?
The activityId represents the primary key of the table being displayed.
Thanks.
--
Jonathan Wood
SoftCircuits Programming
Comment