Results 1 to 4 of 4

Thread: help with insert record please

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Posts
    169

    help with insert record please

    in a typical insert new record web page coded using asp.net...
    If user click "refresh" button in the web browser too bar, then it automatically insert a new record.

    I don't like this, How can I only add new record when user click insert button on my web form?

    thanks

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: help with insert record please

    Quote Originally Posted by redshirtme
    in a typical insert new record web page coded using asp.net...
    If user click "refresh" button in the web browser too bar, then it automatically insert a new record.

    I don't like this, How can I only add new record when user click insert button on my web form?

    thanks
    Check for the IsPostBack property in the Page_Load event
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Posts
    169

    Re: help with insert record please

    I found the solution through asp.net forums.
    response.redirect to the same page will do the trick!

  4. #4
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: help with insert record please

    Quote Originally Posted by redshirtme
    I found the solution through asp.net forums.
    response.redirect to the same page will do the trick!
    Yep that should do it too, but best practice and safe thing to do is only add rows if there has been a PostBack.

    Glad you found the solution.

    Good luck, happy coding..
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width