Solved

Datalist and e.commandName

Posted on 2010-09-15
1
614 Views
Last Modified: 2012-06-22
Hello,

My datalist allows to edit, update and insert records.

After executing update command on my datalist, if I press F5 on web browser and load page again,  then function ItemCommand and method  Make_Update() are called again.

Is there any way to reset e.CommandName value, so if page is refreshed with F5, then method Make_Update() is not called?
Protected Sub Datalist_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList.ItemCommand

        If e.CommandName = "update" Then
          '' If page is refreshed with F5, then Make_Update() is called again
            Make_Update()
            DataList.EditItemIndex = -1
            Load_Data()
        End If

    End Sub

Open in new window

0
Comment
Question by:miyahira
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 400 total points
ID: 33686067
that is a PostBack issue. Check the discussion below and one solution provided is to Refresh the Page by redirecting to itself after your ItemCommand execution:

http://forums.asp.net/p/1184197/2140819.aspx
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question