inserting to details view

Last post 03-07-2008 3:20 PM by irbanjit. 2 replies.

Sort Posts:

  • inserting to details view

    03-05-2008, 4:15 PM
    • Loading...
    • irbanjit
    • Joined on 09-11-2002, 7:38 AM
    • Posts 18

    I have a details view on my page which is linked to linq datasource.  there is foreign key field in my table which I am not showing in the details view. I would like set that foreign key to value x when inserting a new record.  how can do this.

  • Re: inserting to details view

    03-07-2008, 4:57 AM
    Answer

    Hi:
      You can modify the value in Inserting event handler

         protected void DetailsView2_ItemInserting(object sender, DetailsViewInsertEventArgs e)
            {
                //e.Values["field_name"]
            }

     

    Regards

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: inserting to details view

    03-07-2008, 3:20 PM
    • Loading...
    • irbanjit
    • Joined on 09-11-2002, 7:38 AM
    • Posts 18

    Thank you Allen.  it  works perfectly.  I didn't think the Values would be all fields... but thanks.

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter