Refresh a button
protected void Button1_Click(object sender, EventArgs e)
{
}
My application contains a update button. when I click the button the browser must automatically refresh the page.
Is there any code behind code for button?开发者_如何学编程
there is none. Doing so will create a postback on your page, and so will "refresh" your page, at least everything that was done in the page load event and in the prerender event.
In a updatePanel in ajax, it will create a callback. So that only the updatePanel will undergo the postback on the client side, whereas the whole page cycle will be run on the server side.
with server-side button control - you cant.
not sure what are you trying to achieve, but here's a JS workaround for the issue (using JS location.reload()
to reload the page):
<input type="button" value="refresh" onclick="javascript:location.reload()" />
Here is one way to do it
精彩评论