formview DeleteParameters is always 0 asp.net
-
hi all, ok so I have a formview. Insert and Edit work just fine. But for delete, it gets called but the parameter is always 0. Here's the code, what am I missing? I put a stop in my delete method, public static DataSet Delete(int objectiveentryid) and the parameter is always 0. Where should the delete function pick the paramter from? I have this as the formview templates:
Entry ID:
<%# Eval("objectiveentryID") %>
Objective:
<%# Eval("objective") %>
etc.
Check here for errors
-
hi all, ok so I have a formview. Insert and Edit work just fine. But for delete, it gets called but the parameter is always 0. Here's the code, what am I missing? I put a stop in my delete method, public static DataSet Delete(int objectiveentryid) and the parameter is always 0. Where should the delete function pick the paramter from? I have this as the formview templates:
Entry ID:
<%# Eval("objectiveentryID") %>
Objective:
<%# Eval("objective") %>
etc.
Check here for errors
-
Couldn't see the markup of the FormView and datasource controls. How do you specify the DataKey/DataKeyNames of the FormView? How do you define the Delete parameter?
I dont know why the markup didnt show. ok so, deleteparameters is like this: asp:Parameter Name="objectiveentryid" Type="Int32" / Im not defining datakey/datakeynames anywhere. My formview is coming from an objectdatasource, which in turn hits up a static class. The edit & insert works fine, the delete doesnt. where is it picking up the delete param? email me at moazzam at irw.org if you like and we can by-pass having to write here. I could even email you my code. thanks a bunch man -- modified at 3:24 Friday 2nd June, 2006
-
I dont know why the markup didnt show. ok so, deleteparameters is like this: asp:Parameter Name="objectiveentryid" Type="Int32" / Im not defining datakey/datakeynames anywhere. My formview is coming from an objectdatasource, which in turn hits up a static class. The edit & insert works fine, the delete doesnt. where is it picking up the delete param? email me at moazzam at irw.org if you like and we can by-pass having to write here. I could even email you my code. thanks a bunch man -- modified at 3:24 Friday 2nd June, 2006
You either encrypt the markup by replacing the >, < with the >, < or select the check box "Ignore the Html tags ..." when posting a message. Anyway, you can see the sample code in MSDN which uses the DetailsView control, but I think you can easily replace it with the FormView http://msdn2.microsoft.com/en-us/library/ms178538(VS.80).aspx[^] In the example, you will see that they simply specify the key (id) in the
DataKeyNames
and no need to use the Delete parameter.