Prevent duplicate insert without session

im working on sharepoint 2010 (using visual webpart) is there any way to prevent duplicate

insert in a list when page is refreshed using F5, without using session

thx

--------------Solutions-------------

The sharepoint "way" is usually to redirect to the list view page after you have inserted a new item:

So the web part posts to some page, with a Source parameter:

http://somesite/Lists/TestList/NewForm.aspx?Source=http%3A%2F%2Fsomesite%2FLists%2FTestList%2FAllItems%2Easpx&RootFolder=&...

Then after the save event, redirect

SPUtility.Redirect(base.ListEditPageLayoutsRelativeUrl, SPRedirectFlags.RelativeToLayoutsPage, this.Context);

Take a look at the FormDigest control and see if that will do what you need.

Category:c# Time:2011-01-31 Views:1

Related post

  • How to use SqlBulkCopy to prevent duplicates insert? 2012-03-29

    I am going to use SqlBulkCopy, but I need to prevent duplicates insert. What is the best way to do it? Have I do check existence for each item before make execute WriteToServer command? --------------Solutions------------- Bring all the values form t

  • Rails: Prevent duplicate inserts due to pressing back button and save again 2011-01-11

    Think about a simple Rails scaffold application with a "new" action containing a form to add records to a database with a "save" button. After the "create" action the controller redirects to the "show" action, where the user can use the "edit" link t

  • Prevent duplicate inserts without using unique keys in Oracle 2011-11-08

    This is a use case in member enrollment via web application/web service. We have a complex algorithm for checking if a member is duplicate, by looking at multiple tables like phone,address etc. The algorithm varies based on member's country. So this

  • Preventing Duplicate Inserts Into SQL With PHP 2008-11-09

    I'm going to running thousands of queries into SQL and I need to prevent the duplication of field 'domain'. Never had to do this before and any help would be appreciated. --------------Solutions------------- You probably want to create a "UNIQUE" con

  • prevent duplicate insert by using updatepanel 2011-01-14

    i wrote a page which are several fields and there is gridview which keeps the data inserted bottom of the page and i added a updatepanel... when i click the insert double data inserting to grid how to prevent it... --------------Solutions------------

  • can isolation levels prevent duplicate insert? 2012-04-09

    i have a table like this UserPageId (Primary Key) int UserId (user Foreign Key) int PageId (page Foreign Key) int and the whole senario is to prevent user to add one page more than once,,according to each user can be use with several person and we mi

  • Preventing Duplicate Table Inserts 2011-06-17

    The database is SQL Server 2008. I have a query which extracts rows from one or more tables and then attempts to insert them into a table variable. I'd like an efficent way to prevent duplicate inserts, so what I came up with was: INSERT INTO @MyTabl

  • preventing duplicate table inserts using jdo in android connected appengine 2012-03-18

    I would like to know how to prevent duplicate inserts when doing an RPC call from an Android client connected to app engine. Below is my code and what I tried at the back-end but when I do this I get an "Internal Server Error". public void createenti

  • Prevent duplicate record insert on manual page refresh 2010-09-16

    I have a problem which has only just surfaced itself. I'm working in a MVC environment. The method names in my interface class match those of the request module and action i.e. ?module=test&action=action would result in a method called public fun

  • How to prevent duplicate rows in insert query using Oracle? 2009-10-31

    I have table A in Oracle that has a primary key (id). I need to insert data into this table. How do I prevent duplicate rows? --------------Solutions------------- If the id column is marked as the PK you will not be able to insert a duplicate key, th

  • How to prevent duplicate records being inserted with SqlBulkCopy when there is no primary key 2010-04-07

    I receive a daily XML file that contains thousands of records, each being a business transaction that I need to store in an internal database for use in reporting and billing. I was under the impression that each day's file contained only unique reco

  • How to prevent duplicate values from inserting mySQL considering two columns? 2011-10-20

    Here is my table: Table Name: UserLinks Link_ID User_1 User_2 1 234325 100982 2 116727 299011 3 399082 197983 4 664323 272351 Basically, in this table a duplicate value is: Link_ID User_1 User_2 1 232 109 2 109 232 I have looked around and found that

  • Insert Query (that prevents duplicates) 2014-09-07

    I saw a question similar to mine and I tried to modify the code but to no avail. I have a multiple-field index but it doesn't seem to be stopping duplicates from being imported or entered. I will post here the fields in the index as well as the code

  • Prevent Duplicate Entries and alert via a alert box if user insert duplicate entry 2010-07-09

    How i Prevent Duplicate Entries in database at the time of form submit and display an alert box and stop form submission if entry is duplicate. --------------Solutions------------- You can add a validates_uniqueness_of validation to your model: class

  • What's the best method to stop duplicate inserts into the database 2009-04-17

    I have a forum application using asp.net, c#, sql server and linq to sql. It suffers from multiple inserts, I think when the insert button is pressed but also maybe when the browser is refreshed or back is clicked. What's the most comprehensive way,

  • How to prevent multiple inserts when submitting a form in PHP? 2010-01-25

    Sometimes the user may press Enter twice, and the post is inserted twice. Is there a solution to prevent this other than check if there is already a post with the same title and content? --------------Solutions------------- Use a unique token with th

  • Preventing duplicate form submissions 2011-01-06

    I came up with a technique to prevent duplicate form submission by going back/forward or refreshing the page. And I thought about duscussing it here, I already tested a sample not in production environment, what is flaws that you can identify? Please

  • How to prevent duplicate form submission in ASP.NET MVC 3? 2011-06-01

    I have a razor view that renders a html form and it posts to the server. If the form values are right then it gets saved to database. After insertion, I redirect to another view where user can make further changes. Right now the user can hit browser

  • Preventing duplicate User Names with ASP.NET 2011-09-01

    I have a registration form.I want to prevent duplicate User Names with ASP.NET.Now,I can do to prevent duplicate User Names.But,I want to give a warning message to User.How can I do that? Code: try{ SqlCommand cmd = sqlConnection.command("If not exis

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.287 (s). 13 q(s)