473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASPNET - Datagrid

Hi all, i have a problem on a datagrid (webforms),
i don't know if is a problem on my code, if is a bug of DataGrid or simply
if is normal...
When i add a node on a datagrid or when i delete a node, all works fine, but
at this moment if you press F5 to refresh the page, my application continue
to add node(if i added a node) or to delete a node (if i deleted a node).
What's happens?
Thank you all , and scuse me for my bas english.
Dec 1 '05 #1
3 1065
Rodi send me the code part where you fill, add and delete from the grid, so I
can take a look at it.

--
adasilva
"Rodi Roberto" wrote:
Hi all, i have a problem on a datagrid (webforms),
i don't know if is a problem on my code, if is a bug of DataGrid or simply
if is normal...
When i add a node on a datagrid or when i delete a node, all works fine, but
at this moment if you press F5 to refresh the page, my application continue
to add node(if i added a node) or to delete a node (if i deleted a node).
What's happens?
Thank you all , and scuse me for my bas english.

Dec 1 '05 #2
Here the code, is a very simple code....
Private Sub DataGrid_Delete(ByVal source As System.Object, ByVal e
As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
Mydatagrid.DeleteCommand
DeleteNode(e)
End Sub
Private Sub DeleteNode(ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs )
Dim ds As New DataSet
'fill DataSet with xml data
'xmlfile is a reference to a xml file in my server
ds.ReadXml(xmlfile)
ds.Tables(0).Rows(e.Item.DataSetIndex).Delete()
ds.Tables(0).AcceptChanges()
ds.WriteXml(xmlfile)
BindGrid()
End Sub
Private Sub BindGrid()
Dim ds As New DataSet
ds.ReadXml(xmlFileName)
dgMail.DataSource = ds
dgMail.DataBind()
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not (Page.IsPostBack) Then
BindGrid()
End If
End Sub
"adasilva" wrote:
Rodi send me the code part where you fill, add and delete from the grid, so I
can take a look at it.

--
adasilva
"Rodi Roberto" wrote:
Hi all, i have a problem on a datagrid (webforms),
i don't know if is a problem on my code, if is a bug of DataGrid or simply
if is normal...
When i add a node on a datagrid or when i delete a node, all works fine, but
at this moment if you press F5 to refresh the page, my application continue
to add node(if i added a node) or to delete a node (if i deleted a node).
What's happens?
Thank you all , and scuse me for my bas english.

Dec 2 '05 #3
.....Is all here....
DataGrid_Delete calls DeleteNode(e) and DeleteNode() is defined just after
the Fill method id BindGrid which id defined after DeleteNode() ....

Maybe ,viewstate remains in delete mode?
Here the code, is a very simple code....
Private Sub DataGrid_Delete(ByVal source As System.Object, ByVal e
As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
Mydatagrid.DeleteCommand
DeleteNode(e)
End Sub
Private Sub DeleteNode(ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs )
Dim ds As New DataSet
'fill DataSet with xml data
'xmlfile is a reference to a xml file in my server
ds.ReadXml(xmlfile)
ds.Tables(0).Rows(e.Item.DataSetIndex).Delete()
ds.Tables(0).AcceptChanges()
ds.WriteXml(xmlfile)
BindGrid()
End Sub
Private Sub BindGrid()
Dim ds As New DataSet
ds.ReadXml(xmlFileName)
dgMail.DataSource = ds
dgMail.DataBind()
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not (Page.IsPostBack) Then
BindGrid()
End If
End Sub
"adasilva" wrote:
Rodi send me the code part where you fill, add and delete from the grid, so I
can take a look at it.

--
adasilva

Dec 7 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Anatoly | last post by:
For all projects we wrote base classes library. BObject is parent for all objects. It contains Fields Collection. Field is an object with Fields and Methods, for example Field has Value property...
3
by: Harry Simpson | last post by:
I've got an aspnet page that is primarily a datagrid within a DIV that loads a dataset from a SQLServer call on load. It returns about 187 records. The kicker is that when i access this page...
0
by: d pak | last post by:
Here is a snippit which replicates my issue. I have a datagrid which contains an input textbox on each row, binded on the serverside. However it seems that when I perform a postback to refresh teh...
2
by: daviddabwang | last post by:
Whenever use DataGrid to load database data to web form, I got the information. Any one can help to solve it? Thanks **********************************************************************...
4
by: trouling | last post by:
An aspx page I made with a DataGrid and SQLConnection to my local MS SQL server shows appropriate DB information when view from within the ..NET designer. However, when selecting: "View in...
1
by: cindy | last post by:
i posted this to dotnet.framework the answer was does file really exist. yes it does then WSS is in way In order to make the full path to the .js file defined as excluded I cannot use / character...
5
by: Harlan Messinger | last post by:
I installed the Northwind database in my SQL Server developer version, added to the server logins, and in OSQL ran use Northwind GO grant all to GO These executed without error. But my...
0
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
The VS.net 2002 and SQL Server client were at the same PC and the SQL Server database was at another PC. The dataset and DataGrid were created successfully. However, when trying to run a Web...
2
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
How to configure the IIS, ASPNET userID, Windows or SQL Authentiation, std or integrated security for SQLserver database? The VS.net 2002 web server and SQL Server client are at the same PC, ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.