I have a Control: Image
And I'm adding the image in a foreach, in my divContainer.
The Problem is, that there are about 100 Images. Now the website loads and at the end
when all Images were been loaded, it shows me the result!
But I want an asynchron view/result, so that I don't have to wait, till every image has been loaded, it should add the Images in front of my eyes - one after the other.
Thats the Code, which adds the Image to the Div: myDiv.Controls.Add(image);
How can I achieve this?
ASP.NET works by building up the HTML then outputting it to the browser, it won't send them one by one.
Does building the html to output really take up that much time anyway?
If its getting to the browser then the browser doesn't show all the images until each one is loaded then its the browser doing this. The browser can finish the layout of the page and start showing images if you make sure you have the height and width set on each image tag when it goes out.
Related
We're all familiar with the "button" on a webpage. You click a button and it triggers something.
I'm wondering if it's possible to do something similar with slices of a pie, where each pie slice represents a button, and pressing the button would be the same thing as pressing an #Html.ActionLink().
I could imagine doing an image map over a flat image, and I can go that route if I have no other options, but it would be more visually appealing if the pie slices can actually be pressed in the same way that a button can.
Is such a thing possible on an MVC webpage?
you can use ImageMapster a perfect plugin for similar approaches.
here is its repository
ImageMapster is a jQuery plugin that lets you activate HTML image maps without using Flash. It works just about everywhere that Javascript does, including modern browsers, Internet Explorer 6, and mobile devices like iPads, iPhones and Androids
To do what you want you could combine an image map with a separate image for each state of the "pie". You are showing a default state. You would need to create an image for each depressed state (one for each slice of the pie). The each image would show the whole pie with one or no item depressed.
Then, the best look would probably be to put them into a single image and use CSS sprites to switch the image position (which will control which image is in the viewport) based on which image map section is clicked.
I have a page that in this page i have one image and at run time i add 3 buttons but these button come to front of image. how can i send these button to back. i use Panel.SetZindex but not works. thank you.
Have you also used Panel.SetZindex for image control? I think you would have used it just for buttons not for image thats why buttons are still coming in front of image control.
You should set z-index of buttons to least possible value and the z-index of image to highest possible value so that image would comes in front.
Use following code:
Panel.SetZindex(button1,0);
Panel.SetZindex(button2,1);
Panel.SetZindex(button3,2);
Panel.SetZindex(image,3);
Set buttons z-index property to lowest possible number and then add it at run time.
I used three DetailReports and a PageFooter. Less number of data only available in my 1st page, but when I preview or run the program it show two pages why ? Already my first page fill less content only. Whats wrong in my code ?
This problem appears if some report elements (labels, tables) exceed the page's width and overlap onto the right page margin. XtraReports renders the right part of such elements on a new page. You should either decrease the right margin of your report or resize the report elements so that they all fit into the width of a single page. There is no programmatic solution for this problem.
Moreover on closer inspection of a less complex report, you may notice the red "page" icon indicating that.
I have 3 pages in my application.
First page: 5 Buttons, each navigates to different page (currently, only the first button works).
Second page: Back Button and ListView, the ListViewItems are UserControlItems with Button, Image and TextBlock. When you click on the Button (of the UserControlItem) it Navigates to the third page, which is Media Player Page with alot of controls.
Third page: Media Player page with alot of controls such as MediaElement, Slider, Buttons and more
When I navigate from Third Page to Second Page using the Back Button, sometimes the screen stays black (the color of the theme) and sometimes it loads too much time. In addition, the ListView has visible vertical scrollbar (always) which is not shown unless you move your mouse on the ListView.
How to fix these problems?
EDIT 1:
link to my project - put some .wmv/.mp3/.mp4 files in the Videos Library folder.
EDIT 2:
I investigated the black page issue abit more and I found that the MediaElement is the cause.
The MediaElement stores the stream and it slows the computer.
In order to resolve to problem, when you click on the GoBack Button, it first set the source of the MediaElement to null, and only when the MediaElementState == Closed, I go back - seems to solve my problem (since I applied the solution I didnt experience more black screens).
About the scrollbar - I think I'll be able to solve it if I simulate MouseOver over the ListView - no idea how to do it
Ok Ill List out the issue one by one.
List View Scroll Bar : Since we are developing for a potential touch surface so scrollbars are not meant to be visible every time.
Blank Page : When you press the back button then Big page Ie third page gets stored in the forward navigation property of the history element. Additionally all the resources that were being used in the third page is disposed. So the time taken to go to second page becomes huge.
Please try havig a fourth page which will have less controls. And see if any Black background issue is occuring or not. It will give a better and clear picture.
--- Update Code for permanent visibility of scroll bar---
Please download the code for listview styling from
Listview styles
add your code to the project
and replace all FadeOutAnimation By FadeInAnimation.
This was the quickest I could do for a solution. For a Better one you can always play with the styles.
Ohh one more thing please add
Style="{StaticResource ListViewStyle1}"
To your list view. please try and let me know.
i am working on a project in which i have to make a webpage of photographs. In this page i have to show multiple image. User need is that when he click on any image it will zoom but that time it alsoback webpage as background.
You could change the image width and height by javascript, change its z-index so that it comes top of everything when user clicks the image. When user clicks the image second time, change its width and height to normal.
Have a look at this post.
Hope I answer youe question.
try to put invisible Div on your web page (with z-index: 1; display: none;). After Click just put zoomed image on div and make div visible.
You can use a jQuery plugin like #Abdul said. Considering the fact that is a webpage of photographs, and design is important, you should use NivoZoom or my personal favorite fancybox .