Solved

Building a web app with a dynamic image layout

Posted on 2013-01-03
9
385 Views
Last Modified: 2013-01-07
This may sound a bit vague, but...

I'm tasked with developing a web app centred around this basic functionality:

1. A user inputs a workcell and model type on a webpage.
2. The web app queries a SQL database and returns a sequence of build steps based on the workcell and model type. This sequence can be of varying length, let's say between 1 and 20 steps for argument's sake.
3. For each step, the query also returns a filepath and filename of ONE picture (assume a .jpg) PER step.
4. Based on the workcell, a query returns the total number of pictures (steps), height and width in pixels of all pics, and number of pics per row to display.

My question: since the number of images (and their placement on the page) is dynamic... could be 1 row of 4 or 3 rows of 3... what is the best development tool to achieve this type of layout?

I was going to use ASP.Net 2010 Web Forms, but the designer is terrible for controlling the placement of controls on the page.

I'm comfortable handling the user input, and querying SQL, it's just the layout issue. I'm pretty comfortable in HTML, and know a wee bit about CSS.
Thanks.
0
Comment
Question by:jdallen75
  • 5
  • 4
9 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
When designing web pages, it is preferable to use HTML and CSS to control the layout rather than relying on designer.

You can use controls like Repeater, DataList, GridView etc for repeating items.
0
 

Author Comment

by:jdallen75
Comment Utility
@CodeCruiser: I've added a DataList control, and inside its Item Template added an image object. I've set the DataList.RepeatColumns property to control the row/column layout. At runtime, I have the full image filepaths, heights, widths, and tooltips collected.

My current problem is I can't seem to properly specify these image parameters (such as ImageURL) into the DataList? I can't even add just the first image. Can you help? (I'm assuming I can set all of these at runtime, based on SQL datasets.)
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
What have you tried? You have to specify the image URL not path.
0
 

Author Comment

by:jdallen75
Comment Utility
Yes, that is one of the things on my to-do list: rather than specifying file paths, load the images into a virtual IIS directory (I believe).

Even without that step, this is the closest scenario I've found so far:
http://www.aspdotnet-suresh.com/2011/05/how-to-bind-images-from-folder-to.html

The key here is to create BindDataList, and call it from Page_Load. However, in this case, I'm not simply referencing a file directory - as mentioned earlier, the user has to enter some input, retrieve data from SQL, and THEN populate ListItems (and bind the data).

Is it a true statement that by using "if (!IsPostBack)" on the Page_Load, that the retrieved data will be available for binding at this point in time?

Apologies for any ambiguity - appreciate the help.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
>Is it a true statement that by using "if (!IsPostBack)" on the Page_Load, that the retrieved data will be available for binding at this point in time?

Depends on how you bind. Are you using SQLDataSource?
0
 

Author Comment

by:jdallen75
Comment Utility
Not as one: during the query process, data is returned through multiple queries.. So in the end, the data I need resides in 3 different datagrids. (Height, width in one; filenames in a second; filepath in a third from a system config table)
0
 

Author Comment

by:jdallen75
Comment Utility
Does it help to revise these 3 calls into 1, for a single dataset to bind to?
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Is the path static and then file name different? If so, you can use the RowDataBound event of the filepath grid to set image URLs.
0
 

Author Closing Comment

by:jdallen75
Comment Utility
DataList worked with a virtual IIS directory.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now