Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. formview DeleteParameters is always 0 asp.net

formview DeleteParameters is always 0 asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netwpfquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moazzamahmed
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • M moazzamahmed

      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

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      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?

      M 1 Reply Last reply
      0
      • M minhpc_bk

        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?

        M Offline
        M Offline
        moazzamahmed
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • M moazzamahmed

          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

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups