[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/14/2007 at 04:47PM PDT, ID: 22763055
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

procedure to bind existing photo/sortedList- with categories and details in an access database.

Asked by eggonbeagle in Programming for ASP.NET, Miscellaneous Web Development

Tags: morffy, dave, margin

http://www.epocasf.com/showroom/fete.aspx
This is an asp page that uses a DataList to generate the thumbnails and clickthrough.
I want to add events and have them contained in this same shell. Using an events / categories table to drive the selection of an image gallery.  New galleries could be chosen as a default with the selected index.
Sample code to bind the list is as follows:
   Sub Page_Load(sender As Object, e As EventArgs)
            Dim mySortedList          As SortedList
            Dim intSelectedPhotoIndex As Integer
            Dim strPhotoId            As String
            Dim strPhotoTitle         As String

            mySortedList = New SortedList()
        mySortedList.Add("001", "Fete - working the other corner<br />June 28th 2007 celebration of epoca's new corner.  Photo: Dave Morffy.")
        mySortedList.Add("002", "Fete - working the other corner<br />June 28th 2007 celebration of epoca's new corner.  Photo: Dave Morffy.")
        mySortedList.Add("003", "Fete - working the other corner<br />June 28th 2007 celebration of epoca's new corner.  Photo: Dave Morffy.")
        mySortedList.Add("004", "Fete - working the other corner<br />June 28th 2007 celebration of epoca's new corner.  Photo: Dave Morffy.")
 ...ecetera.. ecetera....
How do I convert this into that format?

I had some success with
http://www.epocasf.com/showroom/fete2.aspx

I created a table of events/categories I call: tblpromotype
that ties into a table of each photo called tblSR
I bind the dataList like this:
   Sub BindDataList()
        Dim conGCA As OleDbConnection
        Dim cmdSelect As OleDbCommand
        Dim dtrCategories As OleDbDataReader

        conGCA = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=D:\WWWROOT\epocasfcom\Database\epocav3.mdb")
        cmdSelect = New OleDbCommand("Select tblSRid, tblSRPromotype, tblSRImg,tblSRcaption,tblSRphotographer,tblSRimgwidth, tblSRimgheight, tblSRDatecreated, tblSRthumbwidth, tblSRthumbnailheight, tblSRinclude  From tblSR Order By tblSRDatecreated Desc", conGCA)
        conGCA.Open()
        dtrCategories = cmdSelect.ExecuteReader()

        PhotoDataList.DataSource = dtrCategories
        PhotoDataList.DataBind()

        dtrCategories.Close()
        conGCA.Close()
    End Sub

the datalist renders..
but. I 'm stuck on the click through aspect of it; the selected item...
how would I do that.?
I like the format here..its fine.. I just would like it to be more flexible..
any ideas?


the rest of the code is here:
I didn't elimiate the manual bind but its not being utilized.. but it is garbage on my page which, yes, i need to clean up.

   Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        If Not IsPostBack Then
            BindDataList()
        Else
           
        End If
       
        Dim mySortedList As SortedList
        Dim intSelectedPhotoIndex As Integer
        Dim strPhotoId As String
        Dim strPhotoTitle As String

        mySortedList = New SortedList()
        mySortedList.Add("1", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("2", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("3", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("4", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("5", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("6", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("7", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("8", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("9", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("10", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("11", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("12", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("13", "Los Angeles Antiques Show <br /> epoca booth 10")
        mySortedList.Add("14", "Los Angeles Antiques Show <br /> epoca booth 10")

        strPhotoId = Request.QueryString("photo")
        If strPhotoId = "" Then
            PhotoDetailPanel.Visible = False

            ' PhotoDataList.DataSource = mySortedList
            ' PhotoDataList.DataBind()
        Else
            'intSelectedPhotoIndex = mySortedList.IndexOfKey(strPhotoId)

            strPhotoTitle = mySortedList.GetByIndex(intSelectedPhotoIndex)

            litPhotoTitle.Text = strPhotoTitle

            imgPhoto.ImageUrl = "fete/images/" '& DataItem("tblSRImg") & " .jpg"
            imgPhoto.AlternateText = strPhotoTitle

            If intSelectedPhotoIndex = 0 Then
                linkPrev.Visible = False
            Else
                linkPrev.Visible = True
                linkPrev.NavigateUrl = "fete2.aspx?photo=" '& tblSRImg
            End If

            If intSelectedPhotoIndex = mySortedList.Count - 1 Then
                linkNext.Visible = False
            Else
                linkNext.Visible = True
                linkNext.NavigateUrl = "fete2.aspx?photo=" _
                 & mySortedList.GetKey(intSelectedPhotoIndex + 1)
            End If

            PhotoDetailPanel.Visible = True
        End If
    End Sub

</script>

in the body tags :
<form>
<asp:DataList id="PhotoDataList" runat="server"
      BorderWidth     = 10
      GridLines       = "None"
      RepeatColumns   = 6
      RepeatDirection = "Horizontal"
 BorderStyle="Solid" BackColor="#ffffff" Width="480" HorizontalAlign="Left" CssClass="gallery100" AlternatingItemStyle-BorderStyle="NotSet" BorderColor="#f9f9ef">
    <ItemTemplate>
            <a href="fete2.aspx?photo=<%# Container.DataItem( "tblSRImg" ) %>"><img src="fete/thumbnails/<%# Container.DataItem( "tblSRImg" ) %>.jpg" border="0" /></a>
    </ItemTemplate>
    <FooterTemplate>
   <table style="width:auto;margin-left:30px"><tr ><td style="width:183px;text-align:center;"><a class="siteindex" href="http://www.epocasf.com/" target="_top">search</a></td><td style="width:183px;text-align:center;"><a class="siteindex" href="http://www.epocasf.com/showroom/photos.aspx" target="_top">showroom</a></td><td style="width:183px;text-align:center;"><a class="siteindex" href="http://www.epocasf.com/" target="_top">contact</a></td></tr></table>
    </FooterTemplate>

</asp:DataList>
<asp:Panel id="PhotoDetailPanel" runat="server" HorizontalAlign="left" Width="480" BackColor="#8CD5EC">
   
<span style="background-color:#ffffff;padding: 10px 10px 25px 10px;border:solid thin white;float:left;margin-left:10px;">
      <span class="title" style="margin-left:15px;margin-right:20px;margin-bottom:20px;">
      <asp:HyperLink id="linkPrev" runat="server"      Text = "previous" CssClass="gallerylg" />
</span>      
<span class="title" style="margin-left:20px;margin-right:10px;margin-bottom:20px;">
      <asp:HyperLink id="linkNext" runat="server"      Text = "next" CssClass="gallerylg" />
</span>      
<br /><br />
    <asp:Image id="imgPhoto" runat="server" CssClass="width:auto;height:auto;background-color:#ffffff;padding: 10px 10px 25px 10px;border:solid thin ;" />
    <br />
      <span class="title"><asp:Literal id="litPhotoTitle" runat="server" /></span>
<br /><br />
    <span class="title" style="margin-top:16px;">
    <a class="gallerylg" href="fete2.aspx">back to all los angeles photos</a>
    </span >
   
   </span>
</asp:Panel>
</form

Is this all too nonsensical ?
thanks for looking at all of this..



[+][-]08/15/07 04:38 AM, ID: 19698554

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Miscellaneous Web Development
Tags: morffy, dave, margin
Sign Up Now!
Solution Provided By: DropZone
Participating Experts: 1
Solution Grade: B
 
 
[+][-]12/19/07 01:29 PM, ID: 20503103

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 / EE_QW_2_20070628