show loading image during button click..

Posted by Gopal_nivas under ASP.NET on 12/20/2010 | Points: 10 | Views : 92209 | Status : [Member] | Replies : 5
hi..

i want to show loading image if i clicked the button.


after sometime i want to display text message and not to display the loading image..

how to do this..

give some examples..

need ur suggestions

regards
gopal.s




Responses

Posted by: Lalji_mer on: 12/20/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,

using Ajax (Display a Loading Image when button click action is in progress ) show here link

http://forums.asp.net/t/1441449.aspx
http://www.ezzylearning.com/tutorial.aspx?tid=8964873

LP MER

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

try this below code, this uses modal popup with ajax and its shows the loading process image

In css class:

.divModalBackground
{
filter: alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;
width:100%;
background-color: #999988;
position: absolute;
top: 0px;
left: 0px;
z-index: 800;
}

In aspx page:
<asp:Panel ID="Panel1" runat="server" Height="900px" Width="100%" CssClass="divModalBackground" Visible="true" >
<asp:Image runat="Server" ID="ImageLoader" CssClass="LoadingProgress" ImageUrl="../../App_Themes/Black/images/ajax-loader.gif" />
</asp:Panel>


In aspx.cs page I put the code like this:
//to show modal popup at page startup
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Panel1.Visible = true;
}

In aspx page place this
// to clear the modal background when page load complete, place this code at the end of your page just before the end of the form tag
<script type="text/javascript" >
function init()
{
var objdiv=document.getElementById('<%=Panel1.ClientID%>')
if(objdiv)
{
objdiv.style.visibility = 'hidden';
}
}

init();
</script>



http://aspboss.blogspot.com/2010/03/how-to-show-page-loading-progress-with.html

Thanks
Karthik
www.f5Debug.net

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suresh.mekkattil on: 1/9/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

You can use the Ajax Updatepanel with Ajax update Progress to solve this problem.

Step1:
Put your button in an update panel

Step2:
Drop an UpdateProgress to your webform and associate this with your updatepanel

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="UpdatePanel1">
</asp:UpdateProgress>

Step3:
Create a template for your "Loading" text to be shown when you click the button and put that inside the updateprogress's <ProgressTemplate> tag

<ProgressTemplate>
<div>loading</div>
</ProgressTemplate>

you can add the some style like position absolute, etc to the template inorder to see this is in stylish, I leave that up to you

Step4:
Finish

-----
Suresh M

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Suresh.mekkattil on: 1/9/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

You can use the Ajax Updatepanel with Ajax update Progress to solve this problem.

Step1:
Put your button in an update panel

Step2:
Drop an UpdateProgress to your webform and associate this with your updatepanel

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="UpdatePanel1">
</asp:UpdateProgress>

Step3:
Create a template for your "Loading" text to be shown when you click the button and put that inside the updateprogress's <ProgressTemplate> tag

<ProgressTemplate>
<div>loading</div>
</ProgressTemplate>

you can add the some style like position absolute, etc to the template inorder to see this is in stylish, I leave that up to you

Step4:
Finish



-----
Suresh M

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Camillem on: 5/23/2013 [Member] Starter | Points: 25

Up
0
Down
    public static void LoadImageFromFileDemo()

{
string fileName = "c:/Sample.png";

REImage reImage = REFile.OpenImageFile(fileName);

}

http://www.rasteredge.com/how-to/csharp-imaging/load-from-file/
Glad to find your codes.it must be benefical for me to load image with .NET

look for help

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response