Solved

Datalist and e.commandName

Posted on 2010-09-15
1
616 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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