Solved

Datalist and e.commandName

Posted on 2010-09-15
1
618 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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