AJAX performance with loading images - c#

I need some advice on what route to go with.
I'm using the jquery plugin galleriffic (image gallery), and I want to add a few galleries for a number of subjects that the user can choose from using AJAX.
My questions:
Should I make one gallery and change the list content?
Or just put all the lists on the page and just "show" them when the subject is pressed by the user?
If changing the content of a list is the better way, should I use javascript to do that or use ASP.NET (c#)?
I should add that the content of a list holds a lot of images for each subject.
Any advice will be great -- I'm pretty much a beginner.

I'd go with multiple galleries that you can toggle using Javascript. You may want to have each of these inside an IFRAME in case gallerific cant handle multiple instances of itself. Then toggle the IFRAME on and off using buttons on the main page.
This is probably the quickest way to get you up and running with most re-usability, you'll get a chance to learn Javascript by the simple fact you'll be implementing gallerific with a .NET backend and have to custom-build the navigation, but wont have to go into the 'deep end' by trying to clean up and re-use the same gallery.
Basically, you load each gallery as the user clicks on it on the main page. Each IFRAME contains 1 gallery with all images for that gallery (unless you have hundreds in which case you want to use paging with 100 thumbnail images per page), all IFRAMES are running concurrently but only 1 is displayed.
Try getting 1 gallery up and running connected to your .NET backend first, then do the navigation later by passing a parameter into the IFRAME src as like this: mygallery.aspx?name=travel_pics.

Related

Recommended strategy for having a page (already made from a master) dynamically load content within it?

I am trying to build an Admin page that already uses the same Master the rest of my site does. Within this Admin page, I have a sidebar with links for different things that an Admin user needs to do. I want those links to load HTML/Razor content in the center of the page but I want to not make separate Admin pages for each bit of functionality.
What strategy or process would work best for this situation? Every search result I'm finding seems to be just learning about how to make a simple Master, but I don't want to make multiple Masters for my site.
(I'm very new to all this, but I learn fast from examples and references.)
There are many ways to solve this problem from dynamically change the UI by fetching from server through Ajax calls to Simple tabs.
As you said you are new to this you can use tabs

Iframe, MasterPage C#

I am creating a web application C# asp.net . I have a simple menu but I do no know if using
iframes to show different options according to the menu is better than using a masterpage.
I am pretty new at this. I read that iframes are not being used anymore.
Is there any other option that I can use?
Thanks
Yeah, I wouldn't use iframes in that context. At one point they were used to give the impression of something akin to Ajax, but you'll really only find them used these days for embedding videos, audio, etc. from other sites (e.g. YouTube, Soundcloud). Master pages should suffice - you'll have a master page with the menu itself, and any menu selection will load an entirely different page, albeit with the same menu provided by the master page. If you're looking to provide navigation without an entire page refresh, then you're getting into the realm of SPAs (single page applications), which will require the use of Ajax.

Looping through aspx pages

For a tournament application, i have to output group standings and a knockout schedule. They have to alternate on one big LED TV. I managed to do that using an IFrame that spanned 100% of the page and using javascript to set the iframe source to another aspx page every 10 seconds.
This works but i creates an enormous memory leak. each time a page is loaded in the iframe, the Internet Explorer process grows with about 6mb. this results in a IE process of 1,5Gb and a crash of the window after about 1 hour.
Is there a better way to create something similar? do the cycling all in codebehind?
Thanx,
Cypress
Why the need for the iframe? You could just have the page reload every 10secs with an onload script.
A more clever approach, might be to use AJAX to download only the data you need to display & update the page with that. You could then take a stage further & use something like SignalR to only update the screen when the data changes.

Interacting with web pages in C#

There is a website that was created using ColdFusion (not sure if this matters or not). I need to interact with this web site. The main things I need to do are navigate to different pages and click buttons.
I have come up with two ideas on how to do this. The first is to use the WebBrowser control. With this, I could certainly navigate pages, and click buttons (According to This).
The other way is to interact with the html directly. Not sure exactly how to do this, but I am assuming I could click buttons or use HTML requests to interact with the page.
Does anyone have a recommendation on which way is better? Is there a better way that I haven't thought of?
I'd use Html AgilityPack to parse the html and then do POSTs and GETs appropriately with HttpWebRequest.
While it may be possible to use the WebBrowser control to simulate clicks and navigation you get more control with Html AgilityPack and HttpWebRequest regarding what gets sent
Did you consider Selenium? The WebDriver API is quite good, and permits a lot of things in terms of Website automation.
why not submit directly the url? that's what the button click will do.
using WebRequest.Create you can submit directly to the url. no need to load, parse and "click" the button.
HtmlAguilityPack is useful for pulling the web elements and finding tags easily. If you need to remotely "steer" a web session, though, I prefer to use WatiN. It bills itself as a web unit testing framework, but it's very useful anytime you need to fake a browser section. Further, it can remote control different browsers well enough for most tasks you'll need (like finding a button and pushing it, or a text field and filling in text if you need a login).

WPF Navigation - Random Access - Go to directed page not just forward or back

I am using WPF Page navigation in a c# windows based application. There are a series of pages that I am creating like this
Page TargetPage = new myPage01();
TargetFrame.Navigate(TargetPage);
The first-time page creation and navigation are working fine, and because I am passing by object the pages are kept alive for me to reference at a later point.
When the user hits the last page (all different views of the same data) and clicks the next button I want the UI to "loop" around to the first page. I am trying to figure out how I can redirect the frame to that first page. I do not want to rely on the built-in journal history within the GUI itself. How can I reference the first page previously created or for that matter any of the previously created pages by referring to it in the code. All the page navigation examples I have come accross are always creating the page as new or using the back or next to navigate to other pages.
Thanks
I do not want to rely on the built-in journal history within the GUI itself.
If you do not want to do that you need to keep track of everything yourself, which i would not recommend unless there is something wrong with the build-in functionality. You can probably find the first page to be the last item of the BackStack.

Categories

Resources