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.