473,799 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Photo Gallery with next and previous buttons

Hi All,

My client has following request. I am not sure how to do it.

Dynamically from database, we are getting set of images names. Now we want
to display them with next and previous buttons.
I am able to pull all the information from database and put it in javascript
array. Now using two functions for next and previous button, I am able to
browse through the images.

The problem is, when I click on next and previous, it's not hitting the
server (as the information is available at the client). But we want it to
connect it to the server so that the page gets refreshed with new paid ads.

Is it possible to acheive that without hitting the database. Please help me.
It's very urgent.
Thanks,
Anil
Nov 19 '05 #1
4 3602
OK, you have got a few options here,

Postback to the server with each click of next or previous, the image
names and text can be stored in the session, or viewstate for better
scalability.

or, do as you are doing now with it all client side, but use an
javascript asynchronous event to reload (or replace) the adverts, the
ajax framework would be a good place to start,

A .Net wrapper for ajax has been release (not open source as yet),

http://ajax.schwarz-interactive.de/c...e/default.aspx

Nov 19 '05 #2
If you just want to get the ad from the server and not all the stuff on the
page then I'd place the ad in an iframe (If I can force the users to use IE)
and reload the iframe location on button click.

"msnews" wrote:
Hi All,

My client has following request. I am not sure how to do it.

Dynamically from database, we are getting set of images names. Now we want
to display them with next and previous buttons.
I am able to pull all the information from database and put it in javascript
array. Now using two functions for next and previous button, I am able to
browse through the images.

The problem is, when I click on next and previous, it's not hitting the
server (as the information is available at the client). But we want it to
connect it to the server so that the page gets refreshed with new paid ads.

Is it possible to acheive that without hitting the database. Please help me.
It's very urgent.
Thanks,
Anil

Nov 19 '05 #3
Hello Sir,
I tried with viewstate (using arraylist) and it worked. Thanks for that.
But I seem to have some problem. Problem is, even though I am using
viewstate, for every click on next or previous button, it's still trying to
get the data from database. I am using asp:hyperlink for that.

Basically my url for the photo album is as follows
photo.aspx?albu mid=20&photoid= 6

And my database call and population of viewstate is within
if (!Page.IsPostBa ck)

Actually, what we are looking for is, whenever the albumid changes then only
refresh the viewstate (get data from database). If only photoid is changing
then use the existing viewstate to link the next, previous links.

Please help me, let me know what mistake i am doing.

Thanks,
Anil.

<ga**********@g mail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
OK, you have got a few options here,

Postback to the server with each click of next or previous, the image
names and text can be stored in the session, or viewstate for better
scalability.

or, do as you are doing now with it all client side, but use an
javascript asynchronous event to reload (or replace) the adverts, the
ajax framework would be a good place to start,

A .Net wrapper for ajax has been release (not open source as yet),

http://ajax.schwarz-interactive.de/c...e/default.aspx

Nov 19 '05 #4
The problem that you using an asp:hyperlink, this control does not
cause a post back,

If the page is not a post back (i.e normal load) then load the data
from the DB into an array and store it in the ViewState, then call a
function in the code behind class that renders the appropriate picture,
pass an argument of 0 (zero) to the function, indicating to display the
first picture,

use asp:LinkButton instead of hyperlink, this will cause post back,

create an event handler for each of the LinkButtons (next and
previous), do this by double clicking on the linkbutton, add the
following code (sorry its in c#)

private void NextButton_Clic k(object sender, System.EventArg s e)
{
int index = (int)ViewState["index"];
index = index + 1;
ViewState["index"] = i;
RenderPicture(i ndex);
}

(where RenderPicture is your function that acts on the viewstate)

also in the RenderPicture function you can disable the next or previous
linkbutton depending if you are at the start or the end of the array,

if you still have trouble zip the code up and mail it to me and I'll
sort it out

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3058
by: Marcel | last post by:
Hello, I'm working on a search application for my website. The website contains a lot of pictures, and a search should return clickable thumbnails. No problems there. My problem started when I wanted to build in NEXT and PREVIOUS buttons, so that you only get 5 or 10 or 20 (I haven't made up my mind yet) thumbnails at a time. I use a SQL LIMIT statement to achieve that. After displaying the first 5 pictures I would like to see the next 5,...
9
6754
by: Karl Roes | last post by:
Hi All, I would like some advice on Next / Previous record buttons. I have a main form for the client, and a continuous subform listing client transactions. If I open one of these transactions ( dblclick ) in say 'frmtransaction', I would like to scroll forward and backward through the transactions as they appear on the continuous subform without actually having to close 'frmtransaction' and go back to the subform.
1
3220
by: msnews | last post by:
Hi All, My client has following request. I am not sure how to do it. Dynamically from database, we are getting set of images names. Now we want to display them with next and previous buttons. I am able to pull all the information from database and put it in javascript array. Now using two functions for next and previous button, I am able to browse through the images.
1
2503
by: David | last post by:
What I envision is this. The user gets a set of records in a data grid Then the user gets to select one of the rows to view the detail information about the record. Then instead of backing out to the datagrid, press Next or Previous to view the next or previous record respectively. How would you implement it in ASP.NET?
0
1464
by: Roger23 | last post by:
I am trying to use a wizard for a mulit-process step where i have to navigate to different screens. The user can see that in two modes, read-only and update. when its read-only i want to hide the navigation buttons so that they can navigate by clicking the side bar. when in update mode, i would force them through a sequence of steps. this is what i have for the template: <StartNavigationTemplate> <asp:Panel ID="pnlStart" ...
1
2575
by: shapper | last post by:
Hello, Is it possible to use images as Next / Previous buttons on an Asp.Net 2.0 GridView? Thanks, Miguel
1
505
by: Jes | last post by:
Hi I would like to have a photo gallery with images loaded from a a database. Instead of creating a page for each image, I would like to load all 'image names'' into an array, display the first one and place a 'Next' / 'Previous' buttons for navigation. Any help / link on the sourcecode please ? Regards
8
10845
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
1
3470
by: mfaisalwarraich | last post by:
hi everybody, im trying to make next and previous buttons. im displaying record based on a search. when any image on the search results is clicked then dat image opened in a new page with details about dat imgae on a seperate page. lets say this image as a coupon. now im trying to navigate to next and previous records without going back. while($resultSet = mysql_fetch_assoc($que)){ $np = $rs; } $_SESSION= $np;
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.