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. 3 1078
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.
Here the code, is a very simple code....
Private Sub DataGrid_Delete (ByVal source As System.Object, ByVal e
As System.Web.UI.W ebControls.Data GridCommandEven tArgs) Handles
Mydatagrid.Dele teCommand
DeleteNode(e)
End Sub
Private Sub DeleteNode(ByVa l e As
System.Web.UI.W ebControls.Data GridCommandEven tArgs)
Dim ds As New DataSet
'fill DataSet with xml data
'xmlfile is a reference to a xml file in my server
ds.ReadXml(xmlf ile)
ds.Tables(0).Ro ws(e.Item.DataS etIndex).Delete ()
ds.Tables(0).Ac ceptChanges()
ds.WriteXml(xml file)
BindGrid()
End Sub
Private Sub BindGrid()
Dim ds As New DataSet
ds.ReadXml(xmlF ileName)
dgMail.DataSour ce = ds
dgMail.DataBind ()
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
If Not (Page.IsPostBac k) 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.
.....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.W ebControls.Data GridCommandEven tArgs) Handles Mydatagrid.Dele teCommand DeleteNode(e) End Sub Private Sub DeleteNode(ByVa l e As System.Web.UI.W ebControls.Data GridCommandEven tArgs) Dim ds As New DataSet 'fill DataSet with xml data 'xmlfile is a reference to a xml file in my server ds.ReadXml(xmlf ile) ds.Tables(0).Ro ws(e.Item.DataS etIndex).Delete () ds.Tables(0).Ac ceptChanges() ds.WriteXml(xml file) BindGrid() End Sub Private Sub BindGrid() Dim ds As New DataSet ds.ReadXml(xmlF ileName) dgMail.DataSour ce = ds dgMail.DataBind () End Sub Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load If Not (Page.IsPostBac k) 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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 witch keeps Field value, etc.
The question is: how DataGrid may be binded to Collection of such objects.
Any Help will be appreciated.
Thanks.
|
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 from a broadband connection, it
loads just fine. But when i try to access the page from a dialup 56 kbps,
it says the page cannot be accessed error -1 and doesn't load the page at
all.
|
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 numbers, they are not changing due
to the foreach loop I have in this code. When I comment out the foreach loop,
the numbers refresh fine (but the text boxs ovbiously no longer get created).
I have placed this code in the OnItemDataBind method,...
|
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
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
|
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 Browser", the
following error appears.
Login failed for user 'myComputer\ASPNET'
Selected failing code is:
SqlDataAdapter1.Fill(AuthorsDS1)
| |
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 to define path so do I create virtual directory for
aspnet_client in local project is not the asp net application still looking
for full path
I need help, how does anyone live with WSS and validation for aspnet
applications? how do I defined...
|
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 test page is being denied access.
|
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 form with a SQL Server
table, an application error concerned with the null user name showed up.
Then I opened up my Northwind database, trying to create a login/user:
computername/ASPNET, for the database and Employee table. An error msg
popped...
|
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, while
the SQL Server database is at another PC. The dataset and DataGrid were
created successfully. However, when trying to run a Web Form with a table, a
server error msg: Login failed for user '(null)'. Reason: Not associated
with a trusted...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |