Asp.Net (vb) Force Postback encoded

I need a way to force a page to reload or reload in codebehind. I tried using some kind of javascript, but did not get it to work. Browse the network. I see the first question: β€œwhy?”

The circumstances are that I have a drop-down list for autostart, and the gridview datasource selector is from the selected value of this drop-down list. Thus, the page works fine and the content is refreshed whenever the selected item is changed. But some links and buttons distract the client from the page, so they link later.

The idea is to save the last selection in the session and check the first page.load event if the session parameter is different from the default. Now I can change the selected index of the drop-down list based on this, but apparently the data source starts faster than page.load, so if I can not force the reload, it will not help.

Any ideas? A full postback / reload page is not the only option, of course, just forcing gridview / datasource to be updated quite well. I just don’t know how to do this other than reloading the whole page.

Thanks.

+5
source share
6 answers

ajax-, , , OnTick, , , , , .

GridView , . - .

  • ( )
  • GridView
    • DropDownList
    • .DataBind() GridView/DataSource, .
+9

? PreRenderComplete? , . PreRenderComplete - , . Page_Load - .

.

Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete
    Session("Value") = ddlList.SelectedValue
End Sub

, , , .

+2

GridView DataBinding ? dropdownlist, .

. , SelectCommand Datasource. ControlParameter. , () .

, Eoin ( GridView).

+1

. , . , .

<SelectParameters>
   <%--<asp:Parameter Name="timevalue" Type="String" DefaultValue="now" />--%>
   <asp:ControlParameter ControlID="timevalueDropDownList" PropertyName="SelectedValue" Name="timevalue" DefaultValue="now" />
</SelectParameters>

, . pageload timevalueDropDownList, . SelectedIndexChanged ..

, , , . , , , , .;)

0

... Kezzer .

:

Chart1.databind()

PreRenderComplete .

PreRender , , "" , , "" , .

. Country, State, City downdowns. " ", "", "", , "", , , reset .

Adding auto-repeat to PreRenderComplete made the "get: its values ​​after automatically cutting out drop-down lists ... awesome!"

0
source

Another way if you are still looking for a message to do response.redirect("~/ImOnThisPageAlready");on the same page.
pretty simple, not sure how busy your site is, but it works really fast for my small application.

0
source

All Articles