Note that there are some explanatory texts on larger screens.

plurals
  1. PORedirect after refreshing update panel
    primarykey
    data
    text
    <p>Do you think it's possible to refresh an update panel and immediately after redirecting the response (for instance a download) ? </p> <p>I tried this: </p> <ul> <li><p>an invisible button -> as an asyncpostbacktrigger </p></li> <li><p>a download button -> when it is clicked the onclientclick clicks the invisible button </p></li> <li>the click event on the invisible button refreshes the update panel </li> <li>then the download button click event launches the download (normal postback which launches the download)</li> </ul> <p>However for some reason when the invisible button is clicked by the download button client script, it doesn't refresh the update panel..</p> <p>Do you have an idea why it doesn't work? Or do you have other and cleaner techniques?</p> <p>Here's how the elements are declared: </p> <p></p> <pre><code> &lt;asp:Button runat="server" ID="ButtonInvisible" Text="" Click="RefreshDisplay" /&gt; &lt;asp:Button runat="server" ID="ButtonDownload" Text="Download" OnClientClick="clickInvisible(this.id)" Click="Download" /&gt;&lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="ButtonInvisible" /&gt;&lt;/Triggers&gt; </code></pre> <p></p> <pre><code>//the javascript &lt;script type="text/javascript" language="javascript"&gt; function clickInvisible(idButton) { document.getElementById('ButtonInvisible').click(); }&lt;/script&gt; </code></pre> <p>'</p> <pre><code> //the methods Download(object source, EventArgs e){Response.Redirect("test.txt")} RefreshDisplay(object source, EventArgs e){ ButtonCancel.Enabled = false;} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload