Re: asp.net 2.0 data access driving a novice nuts... inputs are more than welcome

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




trond@xxxxxxxxxxxx wrote:
> Hello all,
> Before I start I'd like to point out that I am a complete novice when
> it comes to asp.net - My background is in network and operating
> systems, and although I have been doing a bit of hobby programming in
> vb.net and web programming in asp/vbscript in the past, I am pretty
> much a beginner at asp.net.
>
> What I'm trying to do, is to take the "PersonalHomePage" starter kit
> that MS supplies with VS2005 and tweak it a bit, to make it suitable
> for my own homepage. The PersonalHomePage starter kit stores all the
> photos for its photo album inside a SQL Database, and I'm gonna use a
> regular file/folder approach instead, using an Access database to hold
> to relationship between albums and photos. So to the problem:
>
> The albums.aspx page shows all my albums, with a link for each of them.
> Also, the page shows one photo for each album, so that the visitor can
> see an example of photos the particular album holds.
>
> To list the albums is easy enough - I use a DataList and an
> AccessDataSource that queries all my albums. The DataList automatically
> repeats itself the number of records in the DB, and I can use the <%
> #Eval("AlbumName") %> tag to display the Name and ID of each album, as
> well as generate a link for taking the visitor to the selected album
> (something like albums.aspx?id=<%# Eval("AlbumID") %> or thereabouts)
>
> Here's the tricky one: I'd like to have a second AccessDataSource which
> accepts AlbumID as a parameter and generates the URL for the photo. In
> my "Photos" table I already have a field for ImageURL, so displaying
> photo for each of the albums should simply be a matter of getting this
> ImageURL into the "img src=" part of the code.
>
> However:
> -I am not allowed to have more than one AccessDatasources for a
> DataList, so I can't do an "Eval" on more than one datasource per
> DataList.
>
> -I could create the datasource for the image in the code-behind file
> inside a function which accepts AlbumID as a parameter and return a
> ImageURL to the aspx page. However, this would give me the code
> (assuming that the function is named GetImageUrl):
>
> img src=<%GetImageUrl( <%# Eval ("AlbumID") %> ) %>
>
> which of course is not allowed, as it is two "nested" scripts.
>
> I know I could do this by constructing a second page called
> imagehandler.aspx or whatever, that would take the album as a parameter
> and return the image as a stream, but I was hoping to avoid using
> advanced stuff like streams here (small steps etc..).
>
> The things that are driving me nuts are:
> 1.I know how to do this with Dreamweaver version ca 2001 using regular
> asp, here I was able to parameterize pretty much whatever I wanted
> without using server controls, which I guess in a way was more of a
> hassle, but at least I had full control over the entire page.
>
> 2. When looking at documentation (both in msdn and in books24x7.com,
> whenever I look for "asp.net 2.0 data access" all I get are the "Build
> data-driven pages witout a single line of code!". I gotta say, I'm more
> interested in solid examples than making software without coding :-)
>
> Of course, I know that this is beta stuff, and as such, not fully
> documented. And when posting this, one of you asp.net experts are
> probable going to make me eat my words by showing me how I can achieve
> what I want here with only two lines of code, but still: I can't help
> but feel that anything that requires me to "pop the hood" and go beyond
> the wizard-driven stuff is getting harder and harder - not easier and
> easier...
>
> Any comments or helpful hints are deeply appreciated. Sorry for making
> you read all this :-)
>
> kind regards,
> Trond Hindenes
> Novice asp.net programmer
> Norway

.



Relevant Pages

  • Re: Disappointing
    ... to go in an album. ... Yes, I realise he has to make a living - however, photographer we used ... for our wedding agreed to take X amount of photos (which he exceeded cos ...
    (uk.people.silversurfers)
  • Re: Recommendations - online photo albums
    ... What are peoples experiences with the various online photo album ... A one year subscription to FotoShare costs only $23.95 and includes 1GB of storage space. ... manage and upload your photos using our FREE FotoAlbum Subscriber Edition software. ... You can restrict viewing privileges, choose album colors, etc. I've been a happy user for several years. ...
    (rec.photo.digital)
  • asp.net 2.0 data access driving a novice nuts... inputs are more than welcome
    ... to relationship between albums and photos. ... Also, the page shows one photo for each album, so that the visitor can ... ImageURL into the "img src=" part of the code. ... Novice asp.net programmer ...
    (microsoft.public.dotnet.framework.aspnet)
  • Dangerous Photo Albums
    ... the engraved album is valuable to your aunt and we have to respect that. ... But as an archivist I have to recommend against using it to store irreplaceable photographs. ... Scanning and printing is an option, or you could place multiple photos on a color photocopier and print an 11x17 sheet. ... In the archives biz we have a special word for unidentified historical photographs: ...
    (soc.genealogy.misc)