473,409 Members | 2,004 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,409 software developers and data experts.

Display BindData() not refreshed automaticly

Hi,

I have a strange problem here.
I use datagrid in my webform .aspx
and I put delete button in the itemtempalate.

So whenever delete button pressed, then I'm going to run the Item_Delete
Public sub Item_Delete(ByVal source as object, e as
DataGridCommandEventArgs)
dim stSql as string
stSql = "DELETE FROM tbParts WHERE ID = " &
mydataGrid.DataKeys(e.Item.ItemIndex)
ExecuteQuery(stSql)
try
MyDataGrid.EditItemIndex = -1
BindGrid(true)
catch ex as system.exception
end try
end sub

the funny thing is when I'm going back to the main display of the datagrid
it show the record still there (not deleted). But the reality was deleted.
If I refresh the page then it won't show the deleted record.

then I used Visual studio to trace it, when I trace everything run
perfectly, it displayed the page with the data deleted not there anymore.

But when I get back again to the browser and run it again, it show the
deleted data again till I refresh the page.

Anybody know what's going on in here ?

Thanks

Nov 19 '05 #1
1 925
Hi,

try like this...

after executing the delete command... refresh the datasource ...and then
re-bind it with your grid.

Cheers,

Jerome. M

"RSusanto" wrote:
Hi,

I have a strange problem here.
I use datagrid in my webform .aspx
and I put delete button in the itemtempalate.

So whenever delete button pressed, then I'm going to run the Item_Delete
Public sub Item_Delete(ByVal source as object, e as
DataGridCommandEventArgs)
dim stSql as string
stSql = "DELETE FROM tbParts WHERE ID = " &
mydataGrid.DataKeys(e.Item.ItemIndex)
ExecuteQuery(stSql)
try
MyDataGrid.EditItemIndex = -1
BindGrid(true)
catch ex as system.exception
end try
end sub

the funny thing is when I'm going back to the main display of the datagrid
it show the record still there (not deleted). But the reality was deleted.
If I refresh the page then it won't show the deleted record.

then I used Visual studio to trace it, when I trace everything run
perfectly, it displayed the page with the data deleted not there anymore.

But when I get back again to the browser and run it again, it show the
deleted data again till I refresh the page.

Anybody know what's going on in here ?

Thanks

Nov 19 '05 #2

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

Similar topics

1
by: abdul bari | last post by:
Hi I have a standard html form which is generated by an XSL sheet. The form data is submitted to the server and is passed on to file.aspx for processing. However file.aspx is refreshed every 5...
4
by: SSS | last post by:
Hello there, My problem is that I have a page which is displaying 4 real time data values which are being refreshed every one minute. On the same page I have other text boxes where user enters...
1
by: 308 | last post by:
I'm hopping one of you may be able to help me, I have a list of user names and password like this: "0000000-0","00000000000" "0000000-0","00000000000" "0000000-00","0000000000"...
0
by: arunprabu | last post by:
Hi, I have a problecm with the AJAX request in my webpage. I have some filters on top of the page. I have a submit button and an empty div below the filters. Some of the filters have ajax...
3
by: Rudi Hausmann | last post by:
Hi! When is BindData() usually called? Is it OK to call it within Page_Load() so that I have the content of the bound controls? Thanks Rudi
1
by: geeteshss | last post by:
First i would like to thank those persons who helped me out in solving my earlier problems the present problem is that i am unable to display data in datagrid....... but the data is visible in...
1
by: tuman | last post by:
I am making a project which is related to classified web site. I have used a gridview control. In which put some sqltable data. And i want to show a image which is store in my project folder,...
3
by: Mythilisg | last post by:
hi, i'm working in asp.net with c#. i hav one dropdownlist with some options which is similar to Security Questions in yahoo mail. I hav one option called "If Others". When the user selects this...
10
tjc0ol
by: tjc0ol | last post by:
Hi guys, I'm an .NET newbie, I need help. Why is it that when I preview my aspx page it won't show up anything except this line: <p>The data will be refreshed 10 seconds from now: <%=...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
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,...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.