This is a migrated thread and some comments may be shown as answers.

RadButton w/ UpdateProgress

3 Answers 169 Views
Button
This is a migrated thread and some comments may be shown as answers.
License
Top achievements
Rank 1
License asked on 31 Oct 2012, 06:37 PM
I am looking for a way to use the ASP Update Progress component with a RadButton with an image. I'd like to have a static image and then a loading gif when clicked to give the user an indication that data processing is being done. Is there any relatively simple way to intergrate the RadButton and the Update Progress control?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Nov 2012, 06:09 AM
Hi Robert,

Try the following code to achieve your scenario.

ASPX:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true"
                onclick="RadButton1_Click"></telerik:RadButton>
  </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
  <ProgressTemplate>
    <asp:Image ID="Image1" ImageUrl="url" runat="server" />
  </ProgressTemplate>
</asp:UpdateProgress>

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
  System.Threading.Thread.Sleep(3000);
  Label1.Text = "Page refreshed at " + DateTime.Now.ToString();    
}

Thanks,
Princy.
0
License
Top achievements
Rank 1
answered on 01 Nov 2012, 06:06 PM
Not exactly what I'm looking for. What I am actually trying to accomplish is replacing the image in the RadButton with a loading animated gif. I can add a dummy RadButton with the animated button, however if I use that method, I need a way to hide the actual button while it is updating.
0
Princy
Top achievements
Rank 2
answered on 02 Nov 2012, 06:17 AM
Hi Robert,

You can set the visibility of RadButton as follows to achieve your scenario.

ASPX:
<script type="text/javascript">
function OnClientClicked(sender, args)
{
 sender.set_visible(false);
}
</script>

C#:
protected void RadButton1_Click(object sender, EventArgs e)
{
 System.Threading.Thread.Sleep(3000);
 Label1.Text = "Page refreshed at " +
 DateTime.Now.ToString();
 RadButton1.Visible = true;
}

Hope this helps.

Thanks,
Princy.
Tags
Button
Asked by
License
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
License
Top achievements
Rank 1
Share this question
or