views:

86

answers:

1

How need I to refresh my page after SqlDataSource1.DataBind(); for my GridView appears this new data.

+1  A: 

A grid view has a DataBound event to which you can subscribe to and achieve the desired behaviour by calling Response.Redirect(Request.RawURL) or via javascript window.location.reload()

James
Update that to Response.Redirect(Request.RawUrl);
Dejan.S
since you seem to be living in victorian with the way your question is written...:PNo ... that's my Russian accent >___<
nCdy
By the way ... nothing happens.Making protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { SqlDataSource1.SelectParameters[2].DefaultValue = "1"; SqlDataSource1.DataBind(); Response.Redirect(Request.RawUrl);T_T
nCdy
It might be that you have not put AutoPostBack="true" on the dropdown, cause the response.redirect() will redirect you.
Dejan.S
@Dejan updated to use Request.RawURL @nCdy...apologies then, however, I have noticed your other questions see to be written fine :P
James
AutoPostBack="true" helps me :) Thank you very much ^_^take a look to my other questions without answers here :P
nCdy
@nCdy, my apologies then I actually thought you wrote it deliberatly that way! I have updated.
James