WebGrid Community Server

Welcome to WebGrid Community Server Sign in | Join | Help
in Search

creating a new record inserts TWO new rows into database?

Last post 07-24-2008, 21:47 by stone. 2 replies.
Sort Posts: Previous Next
  •  07-24-2008, 2:00 676

    creating a new record inserts TWO new rows into database?

    Hi,

    hope someone can shed light on this problem I am having.

    This can be reproduced quite easily.

     

    I have a simple database table with two columns, say id (int, not null, identity PK) and name (varchar).

    Bind it up to a WebGrid and accept all defaults.

     

    On creating a new row (by clicking new row button, entering Edit mode and saving) seems to perform the insert twice, raising the OnInsertUpdate events twice.

     

    Is this a feature? If so, how is it avoided? Any help on this would be greating appreciated.

    I will upload debug/set up if required.

     

    Many thanks.

    Stone.

  •  07-24-2008, 2:13 677 in reply to 676

    Re: creating a new record inserts TWO new rows into database?

    Hi,

    This is not by design. I've been working on several projects here using the latest version of WebGrid and not experienced these kind of errors.

    Can you send a fully working project to olav@webgrid.com where the errors occours, so I can look into and help you.

    Olav Botterli, WebGrid Founding Developer
  •  07-24-2008, 21:47 681 in reply to 677

    Re: creating a new record inserts TWO new rows into database?

    Olav,

    I have tracked this to be caused by the (asp.net ajax) update panel.

    The project I am working on uses a master page with an update panel inside, containing the master pages' single contenttemplate.

    Inside any content placeholders inside any web content forms of this master therefore exist within the update panel and webgrids placed within that exhibit this behaviour.



    The same double-insert can be achieved by simply putting a webgrid inside an update panel in any normal aspx.

    I need to read up on update panels further to understand if it is how I am using them which is the problem but it appears that the wedgrid is not to fault as it's just responding to two post/callbacks??



    Congratulations on an outstanding achievement with this by the way. It's a great component, very subtle and it really does shred development time for. Template Columns in Grid Mode would be great!!


    Many thanks,

    David.


View as RSS news feed in XML
Powered by Community Server, by Telligent Systems