I need to display the spinner image in asp.net vie java script i want to show image while binding Data i kept the spinner image in parent form but when i am going to access the image i getting the image but it will now shows
i am getting parent image like parent.document.getElementnyId('divId').style.visibility = 'visible';
chetan shindePosted Mar 11, 2015, 1:24 AM
If i dnt hide the image at last then image will shown me when all data will be binding completed.
but i want to show image in between of data bind. is there any other solu for the same. Then please help
Suraj SahooPosted Mar 10, 2015, 9:05 PM
This is as simple as it can be. Just take the id and display and hide.
Then use the $("#spinID").show(); and hide wherever required.
This should work. Use the code mentioned above.
Thanks
chetan shindePosted Mar 10, 2015, 7:24 AM
I am Doing the same thing now as u says. Shows the div like $("#divId").show(); and $("#divId").hide();
but still image is not showing while data is binding. I m binding data through json.
there is no iframe included. i remove the parent class.and accessing the img from local page. but still its not showing.
Pradeep ShetPosted Mar 10, 2015, 6:51 AM
Why are you using parent?
Is there any Iframe involved? If no then dont use parent. Directly use document.getElementnyId('divId').style.visibility = 'visible';
But have a habit of using Jquery syntax as shown by sooraj
$("#divId").show(); & $("#divId").hide();
Suraj SahooPosted Mar 10, 2015, 6:49 AM
Directly you can add.
And you can minimize the code using the display property that would be handy. Like:
$("#divId").show();
and when want to hide
$("#divId").hide();
I am sure this will work.
As I have already implemented this way.
Accept if helps
Thanks.
chetan shindePosted Mar 10, 2015, 6:27 AM
i done the code like :
parent.document.getElementnyId('divId').style.visibility = 'visible';
and when want to hide
parent.document.getElementnyId('divId').style.visibility = 'hidden';
is there any wrong in this code...?
Suraj SahooPosted Mar 10, 2015, 6:10 AM
First of all adjust and add the image in the viewpage with display none and an id. The image should have styling so that it is visible in the center of the page or wherever you need the positioning.
Then wherever you need may it be an ajax call start just use the id and show like:
$("#spinID").show();
and in the success or wherever you need, hide it like:
$("#spinID").hide();
I hope this helps.
Accept if helps.
Post back queries if any
Thanks