Simple DataList Update on PostBack

Discussion in 'ASP .Net Web Controls' started by newGuy, Jul 26, 2007.

  1. newGuy

    newGuy Guest

    Hi,

    I have a DataList that displays a column of text boxes that the user can
    edit. Instead of having a button with a CommandName within the
    <asp:DataList> to submit the page, I have just a regular HTML submit button
    elsewhere on the page.

    How can I call the DataList's UpdateCommand event on postback in the code
    behind when just a regular submit button was clicked?

    Thanks,

    newGuy
     
    newGuy, Jul 26, 2007
    #1
    1. Advertising

  2. newGuy

    newGuy Guest

    For anyone having this same problem, I came up with an easy
    workaround--albeit not as elegant as if it were using the built-in members.

    I just added code similar to this in the Page_Load event:

    if IsPostBack
    methodToIterateThroughDataList()




    "newGuy" wrote:

    > Hi,
    >
    > I have a DataList that displays a column of text boxes that the user can
    > edit. Instead of having a button with a CommandName within the
    > <asp:DataList> to submit the page, I have just a regular HTML submit button
    > elsewhere on the page.
    >
    > How can I call the DataList's UpdateCommand event on postback in the code
    > behind when just a regular submit button was clicked?
    >
    > Thanks,
    >
    > newGuy
     
    newGuy, Jul 30, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN

    Datalist in Datalist How?

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    424
    Gönen EREN
    Aug 22, 2003
  2. Ray Valenti

    Simple form postback to update a database

    Ray Valenti, Oct 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    429
    Esteban Felipe
    Oct 27, 2003
  3. Hartmut Schroth
    Replies:
    3
    Views:
    3,539
    Hartmut Schroth
    Dec 1, 2003
  4. Nevyn Twyll
    Replies:
    8
    Views:
    1,963
  5. Evan M.
    Replies:
    1
    Views:
    1,238
    Evan M.
    Apr 18, 2007
Loading...

Share This Page