473,738 Members | 5,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2231
When the button is clicked, and the codebehind event fires, let's call it
"MyGrid_OnItemC ommand", 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_OnItemCo mmand(s as object, e as DataGridCommand EventArg)
select e.CommandName.T oUpper()
case "DELETE"
UserUtility.Del eteUser(Convert .ToInt32(e.Comm andArgument)) 'delete
the user from the backend database
BindUserGrid(); //rebinds the grid
end select
end sub

private sub BindUserGrid()
MyGrid.DataSour ce = UserUtility.Get AllUsers() //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.Del eteUser function

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"J" <j@NoSpam.org > wrote in message
news:gv******** *************** *********@4ax.c om...
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
4922
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 == "") { include ("InsertRecord.inc"); // Insert new record }
0
1351
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 "delete button" which bind with CustomerID, when we click delete button the record will be delete properly. But I found that if we us IE refresh icon to refresh the page, we got IE pop up message: "The page cannot be refreshed without resending...
10
6946
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 user presses refresh that same URL is fired with the parameters to delete again - this sometimes gives strange behaviour. Is there any way that I can stip of parameters when reloading a page such that only the webpage is deleted e.g. ...
5
2495
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 db) when the user clicks the save button. The dialog then closes and the user should be able to see the result of their edit in a list view that now has focus. This is where I run into a problem. The list view wont refresh to pick up the data...
5
8272
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 source code. If you want me to post code, though, just say so. In a nutshell, I've got an ASP.NET application that has one main ASPX page. On that ASPX page, it has a user control (an ASCX) that displays the actual data and controls I need.
1
4133
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. The problem with this is that the refresh will either delete another record or generate an exception, something like this: An error has occurred because a control with id 'ctl00$Main$UserGrid$ctl11$ctl00' could not be located
6
3530
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 other is future records. The user has to input a passenger forecast for the customer for the selected class for each record in the date range. The subforms are populated by a query which is altered according to their selection. I wish to...
5
1893
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 on to the memory and then compare it with other strings......The gettext() method works only on text mode, and getimage() stores the image....PLEASE help me out..... Thank you...
1
5448
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 to refresh a block after saving (in the post-forms-commit trigger by using a non-repeated timer). The block doesn't contain more than 10 records and doesn't take time to be refreshed. When i save the first time by adding a first record in this block,...
0
8968
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, 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...
0
9334
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 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...
1
9259
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
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...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.