473,387 Members | 1,766 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,387 software developers and data experts.

how to refresh screen after delete a record

J
Hi, all
I have a simple question but have no clue how to do this:
I have a datagrid in a web form which presents each user's info, after admin
selected a user, then click 'delete' button, that user will removed from backend
database. Now, how can I have screen refresh to display updated data?

Thanks in advance.
Nov 18 '05 #1
2 2211
When the button is clicked, and the codebehind event fires, let's call it
"MyGrid_OnItemCommand", you need to rebind your datagrid..since you didn't
give us your existing code, this will hopefully give you an idea:
sub page_load
if not Page.IsPostBack then
BindUserGrid()
end if
end sub

private sub MyGrid_OnItemCommand(s as object, e as DataGridCommandEventArg)
select e.CommandName.ToUpper()
case "DELETE"
UserUtility.DeleteUser(Convert.ToInt32(e.CommandAr gument)) 'delete
the user from the backend database
BindUserGrid(); //rebinds the grid
end select
end sub

private sub BindUserGrid()
MyGrid.DataSource = UserUtility.GetAllUsers() //gets the user
MyGrid.DataBind()
end sub
If GetAllUsers was returning a cached result, you'd need to invalidate the
cache. the best place to do this, in the above code anyways, is in the
UserUtility.DeleteUser function

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"J" <j@NoSpam.org> wrote in message
news:gv********************************@4ax.com...
Hi, all
I have a simple question but have no clue how to do this:
I have a datagrid in a web form which presents each user's info, after admin selected a user, then click 'delete' button, that user will removed from backend database. Now, how can I have screen refresh to display updated data?

Thanks in advance.

Nov 18 '05 #2
WJ
Or you can use the MS/DAAB, which is much better. It takes care of
everything for you:
http://support.microsoft.com/default...b;en-us;829028

John
Nov 18 '05 #3

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

Similar topics

9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
0
by: Symphony | last post by:
Hi,all: our web application using vb.net and xp. we have a web form using a datagrid, when load that page, it will list all our cutomer info. to the datagrid. The first column of the datagrid is...
10
by: Bo Rasmussen | last post by:
Hi, I have a problem : I have a form with some buttons. When one of these buttons is pressed a new URL with some parameters to e.g. delete something from a database. The problem is that when the...
5
by: Andrew Chanter | last post by:
I have a situation where I am using an unbound dialog form to update data in an Access 2002 split back end / front end scenario. The data update is done via an ADO call (direct to the back end...
5
by: Scott Lyon | last post by:
I am having a strange problem. The program is a bit complex, but I'll try to simplify what I can. I apologize if this is complicated, but I think this would still be simpler than posting a bunch of...
1
by: J055 | last post by:
Hi I have a GridView which includes the ability to delete rows. This works fine accept for when a naughty user decides to refresh the browser thereby posting the same delete command instruction....
6
by: Chris Larmer | last post by:
I have two subforms in my main form. In the main form I want the user to select a customer, class, and date range. The 2 subforms are similar. One is the history records in the recent past and the...
5
by: Harsha | last post by:
Hi... Could anyone please tell me how to store contents on the screen to the memory and subsequently access them in graphics mode.....to elaborate a bit, i need to store a portion of the screen...
1
by: zoukli | last post by:
Hi guys, I'm experiencing the FRM-92100 error when running one of my screens in web. I use forms 6i with oracle DB 8i. My form is called by another form. And the problem occurs exactly when i try...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.