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.