ObjectDataSource Update / Delete Parameters from GridView

<asp:ObjectDataSource ID="MMBRSODS" runat="server" 
OldValuesParameterFormatString="original_{0}" 
TypeName="Flow_WEB_Nemerle.SQLModule"
SelectMethod="GetMembers"
UpdateMethod="UpdateMember"
 DeleteMethod="DeleteMember"> 
 <UpdateParameters>
    <asp:Parameter Name="UserName" Type="String" />
 </UpdateParameters>
<DeleteParameters>
    <asp:Parameter Name="UserName" Type="String" />
</DeleteParameters>
</asp:ObjectDataSource>

Selecting a method returns an array of strings. But how do I need to display the selected node for editing removal methods to get this line (username)?

for methods such as:

[DataObjectMethod(DataObjectMethodType.Delete, true)]
static public DeleteMember(...
+3
source share
1 answer

What do you associate the source list with? Say you are linking a list; You can always perform the following operations:

MMBRSODS.UpdateParameters["UserName"].DefaultValue = list.SelectedValue;
MMBRSODS.Update();

Thus, when delivering the default value, you can use the update, the parameter relies on this default value and passes it to the backend ... which control do you use to display the data?

NTN.

+2
source

Source: https://habr.com/ru/post/1742267/


All Articles