views:

265

answers:

1
<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>

Select method returns array of strings . But How I need to appear selected node for edit delete methods get this string (userName) ?

for methods like :

[DataObjectMethod(DataObjectMethodType.Delete, true)]
static public DeleteMember(...
+1  A: 

Hey,

What are you binding the original list against? Let's say you are binding a list; you can always do the following to do that type of operation:

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

So supplying the default value allows you to still use the update, the param relies on this default and supplies it to the backend... what control are you using to show the data?

HTH.

Brian
GridView there...
nCdy
OK, so for gridview, tap into updating event, cancel it (because you are handling the update manually), pass in the user name to the default value, and invoke update. Do something similar with delete.
Brian