Totally confused

Discussion in 'ASP .Net' started by Lloyd Sheen, Mar 6, 2008.

  1. Lloyd Sheen

    Lloyd Sheen Guest

    Ok I have a web control which is used to input search terms. It works
    really well on one page.

    Now I need nearly the same functionallity on another page and I take the
    pieces and move them to the new page (no web control). I have a button with
    a click function which populates a repeater. On the first click of the
    button it goes to the click handler and all is well. On the second click it
    goes directly to the ItemCreated handler. Since the DataSource has not been
    created of course this does not work.

    Of course in the call stack there is nothing I can identify as to the reason
    for the repeater to attempt the ItemCreated since it did not go thru my code
    to get a new datasource.

    I have tried all sorts of combinations of AutoEventWireup on the @Page
    directive but nothing works on the second occurence.

    Any ideas? If you want I can post code as well.

    Lloyd Sheen
     
    Lloyd Sheen, Mar 6, 2008
    #1
    1. Advertising

  2. Lloyd Sheen

    Lloyd Sheen Guest

    "Lloyd Sheen" <> wrote in message
    news:OhK%...
    > Ok I have a web control which is used to input search terms. It works
    > really well on one page.
    >
    > Now I need nearly the same functionallity on another page and I take the
    > pieces and move them to the new page (no web control). I have a button
    > with a click function which populates a repeater. On the first click of
    > the button it goes to the click handler and all is well. On the second
    > click it goes directly to the ItemCreated handler. Since the DataSource
    > has not been created of course this does not work.
    >
    > Of course in the call stack there is nothing I can identify as to the
    > reason for the repeater to attempt the ItemCreated since it did not go
    > thru my code to get a new datasource.
    >
    > I have tried all sorts of combinations of AutoEventWireup on the @Page
    > directive but nothing works on the second occurence.
    >
    > Any ideas? If you want I can post code as well.
    >
    > Lloyd Sheen


    Other detail:

    Code in button click is:

    Dim d As New DAL
    Dim artistName As String
    artistName = ArtistSearchText.Text

    Me.Repeater3.DataSourceID = Nothing
    Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    Me.Repeater3.DataBind()

    ResultsUpdatePanel.Update()


    If I comment out the DataBind on all subsequent button clicks it will go to
    the click handler. Put the databind in and it no longer goes to the
    handler.

    Very confusing???

    Lloyd Sheen
     
    Lloyd Sheen, Mar 6, 2008
    #2
    1. Advertising

  3. Lloyd Sheen

    Lloyd Sheen Guest

    "Lloyd Sheen" <> wrote in message
    news:%...
    >
    > "Lloyd Sheen" <> wrote in message
    > news:OhK%...
    >> Ok I have a web control which is used to input search terms. It works
    >> really well on one page.
    >>
    >> Now I need nearly the same functionallity on another page and I take the
    >> pieces and move them to the new page (no web control). I have a button
    >> with a click function which populates a repeater. On the first click of
    >> the button it goes to the click handler and all is well. On the second
    >> click it goes directly to the ItemCreated handler. Since the DataSource
    >> has not been created of course this does not work.
    >>
    >> Of course in the call stack there is nothing I can identify as to the
    >> reason for the repeater to attempt the ItemCreated since it did not go
    >> thru my code to get a new datasource.
    >>
    >> I have tried all sorts of combinations of AutoEventWireup on the @Page
    >> directive but nothing works on the second occurence.
    >>
    >> Any ideas? If you want I can post code as well.
    >>
    >> Lloyd Sheen

    >
    > Other detail:
    >
    > Code in button click is:
    >
    > Dim d As New DAL
    > Dim artistName As String
    > artistName = ArtistSearchText.Text
    >
    > Me.Repeater3.DataSourceID = Nothing
    > Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    > Me.Repeater3.DataBind()
    >
    > ResultsUpdatePanel.Update()
    >
    >
    > If I comment out the DataBind on all subsequent button clicks it will go
    > to the click handler. Put the databind in and it no longer goes to the
    > handler.
    >
    > Very confusing???
    >
    > Lloyd Sheen


    And still more:

    I added a page load handler (does nothing). On load of app it is called.
    On first click it is called. After that who knows what is happening??

    Certainly not me and certainly not ASP.NET.

    Lloyd Sheen
     
    Lloyd Sheen, Mar 6, 2008
    #3
  4. Lloyd Sheen

    Lloyd Sheen Guest

    "Lloyd Sheen" <> wrote in message
    news:...
    >
    > "Lloyd Sheen" <> wrote in message
    > news:%...
    >>
    >> "Lloyd Sheen" <> wrote in message
    >> news:OhK%...
    >>> Ok I have a web control which is used to input search terms. It works
    >>> really well on one page.
    >>>
    >>> Now I need nearly the same functionallity on another page and I take the
    >>> pieces and move them to the new page (no web control). I have a button
    >>> with a click function which populates a repeater. On the first click of
    >>> the button it goes to the click handler and all is well. On the second
    >>> click it goes directly to the ItemCreated handler. Since the DataSource
    >>> has not been created of course this does not work.
    >>>
    >>> Of course in the call stack there is nothing I can identify as to the
    >>> reason for the repeater to attempt the ItemCreated since it did not go
    >>> thru my code to get a new datasource.
    >>>
    >>> I have tried all sorts of combinations of AutoEventWireup on the @Page
    >>> directive but nothing works on the second occurence.
    >>>
    >>> Any ideas? If you want I can post code as well.
    >>>
    >>> Lloyd Sheen

    >>
    >> Other detail:
    >>
    >> Code in button click is:
    >>
    >> Dim d As New DAL
    >> Dim artistName As String
    >> artistName = ArtistSearchText.Text
    >>
    >> Me.Repeater3.DataSourceID = Nothing
    >> Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    >> Me.Repeater3.DataBind()
    >>
    >> ResultsUpdatePanel.Update()
    >>
    >>
    >> If I comment out the DataBind on all subsequent button clicks it will go
    >> to the click handler. Put the databind in and it no longer goes to the
    >> handler.
    >>
    >> Very confusing???
    >>
    >> Lloyd Sheen

    >
    > And still more:
    >
    > I added a page load handler (does nothing). On load of app it is called.
    > On first click it is called. After that who knows what is happening??
    >
    > Certainly not me and certainly not ASP.NET.
    >
    > Lloyd Sheen


    Ok I have taken out all Ajax (toolkit) code and I now have a button which
    when clicked will only work once.

    Here is full code:

    ASPX:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ShowSongs.aspx.vb"
    Inherits="ShowSongs" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <br />
    <table width="100%">
    <tr>
    <td >
    <table>
    <tr>
    <td id="ArtistTD" >
    <asp:Label ID="Label2" runat="server"
    CssClass="SearchTitles" Text="Artist :"></asp:Label>
    <asp:TextBox ID="ArtistSearchText" runat="server"
    BackColor="#C0FFFF"></asp:TextBox>
    <asp:ImageButton ID="SearchByArtist" runat="server"
    ImageAlign="Middle"
    ImageUrl="~/Images/find.ico"
    OnClick="SearchByArtist_Click"
    Width="32px" />
    </td>
    </tr>
    </table>

    </td>
    <td style="width: 100px">
    </td>
    </tr>
    <tr>
    <td colspan="2">
    &nbsp;<asp:Repeater ID="Repeater3" runat="server">
    <HeaderTemplate>
    <asp:Label ID="ArtistLabel" runat="server"
    Text="Label"></asp:Label>
    <br />
    </HeaderTemplate>
    <ItemTemplate>
    <asp:ImageButton ID="ImageButton1" Height="24px"
    Width="24px"
    runat="server" />
    <asp:Label ID="CDTitle" runat="server"
    Text="Label"></asp:Label>
    <br />
    </ItemTemplate>
    </asp:Repeater>
    </td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </html>


    ..VB codebehind

    Option Strict On
    Option Explicit On

    Imports System.IO
    Imports MusicSiteControls
    Imports System.Collections.Generic

    Partial Class ShowSongs
    Inherits System.Web.UI.Page

    Protected Sub SearchByArtist_Click(ByVal sender As Object, ByVal e As
    System.Web.UI.ImageClickEventArgs)
    Dim d As New DAL
    Dim artistName As String
    artistName = ArtistSearchText.Text
    Me.Repeater3.DataSourceID = Nothing
    Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    Me.Repeater3.DataBind()
    End Sub

    Protected Sub Repeater3_ItemCreated(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
    Repeater3.ItemCreated
    Dim ArtistLabel As Label
    Dim CDTit As Label
    Dim ib As ImageButton
    Dim ds As CD
    Select Case e.Item.ItemType
    Case ListItemType.Header
    ArtistLabel = CType(e.Item.FindControl("ArtistLabel"),
    Label)
    ArtistLabel.Text = ArtistSearchText.Text
    Case ListItemType.AlternatingItem, ListItemType.Item
    ds = CType(e.Item.DataItem, CD)
    ib = DirectCast(e.Item.FindControl("ImageButton1"),
    ImageButton)
    CDTit = CType(e.Item.FindControl("CDTitle"), Label)
    CDTit.Text = ds.Name
    Dim url As String
    url = "~\DynamicImage.aspx?ImageFolder=" +
    ds.FolderNumber.ToString + "&ImageText=" + "1"
    ib.ImageUrl = url
    End Select
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Me.Load
    Dim i As Integer = 1
    End Sub
    End Class


    HELP PLEASE!

    This is just a page with a button and a repeater. How can this possibly go
    so wrong??

    Lloyd Sheen
     
    Lloyd Sheen, Mar 6, 2008
    #4
  5. Lloyd Sheen

    John Kotuby Guest

    Hi Lloyd,
    I'm assuming you found an answer to your problem already and just didn't
    bother to post the solution, which I would be very interested in seeing.

    My first thought on reading your posts was that the problems were deriving
    from the use of an UpdatePanel. I've had some strange things happen with
    UpdatePanels when the templates weren't defined such that they each contain
    an entire Table (instead of just rows within a table).

    Also the Page_Load should Not fire after the inital load of the page,
    because the actual page persists in the browser during an asynch callback.

    Also I was wondering if you were including the Button (actually an
    ImageButton) as a child control in the update panel or at least defining it
    as a Trigger for the panel.

    But all those ideas went south when you said that you removed the "AJAX"
    stuff.

    I'm guessing you eventually re-wrote the page from scratch and got it to
    finally work.

    Cheers...

    "Lloyd Sheen" <> wrote in message
    news:...
    >
    > "Lloyd Sheen" <> wrote in message
    > news:...
    >>
    >> "Lloyd Sheen" <> wrote in message
    >> news:%...
    >>>
    >>> "Lloyd Sheen" <> wrote in message
    >>> news:OhK%...
    >>>> Ok I have a web control which is used to input search terms. It works
    >>>> really well on one page.
    >>>>
    >>>> Now I need nearly the same functionallity on another page and I take
    >>>> the pieces and move them to the new page (no web control). I have a
    >>>> button with a click function which populates a repeater. On the first
    >>>> click of the button it goes to the click handler and all is well. On
    >>>> the second click it goes directly to the ItemCreated handler. Since
    >>>> the DataSource has not been created of course this does not work.
    >>>>
    >>>> Of course in the call stack there is nothing I can identify as to the
    >>>> reason for the repeater to attempt the ItemCreated since it did not go
    >>>> thru my code to get a new datasource.
    >>>>
    >>>> I have tried all sorts of combinations of AutoEventWireup on the @Page
    >>>> directive but nothing works on the second occurence.
    >>>>
    >>>> Any ideas? If you want I can post code as well.
    >>>>
    >>>> Lloyd Sheen
    >>>
    >>> Other detail:
    >>>
    >>> Code in button click is:
    >>>
    >>> Dim d As New DAL
    >>> Dim artistName As String
    >>> artistName = ArtistSearchText.Text
    >>>
    >>> Me.Repeater3.DataSourceID = Nothing
    >>> Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    >>> Me.Repeater3.DataBind()
    >>>
    >>> ResultsUpdatePanel.Update()
    >>>
    >>>
    >>> If I comment out the DataBind on all subsequent button clicks it will go
    >>> to the click handler. Put the databind in and it no longer goes to the
    >>> handler.
    >>>
    >>> Very confusing???
    >>>
    >>> Lloyd Sheen

    >>
    >> And still more:
    >>
    >> I added a page load handler (does nothing). On load of app it is called.
    >> On first click it is called. After that who knows what is happening??
    >>
    >> Certainly not me and certainly not ASP.NET.
    >>
    >> Lloyd Sheen

    >
    > Ok I have taken out all Ajax (toolkit) code and I now have a button which
    > when clicked will only work once.
    >
    > Here is full code:
    >
    > ASPX:
    >
    > <%@ Page Language="VB" AutoEventWireup="false"
    > CodeFile="ShowSongs.aspx.vb" Inherits="ShowSongs" %>
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head runat="server">
    > <title>Untitled Page</title>
    > <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > <br />
    > <table width="100%">
    > <tr>
    > <td >
    > <table>
    > <tr>
    > <td id="ArtistTD" >
    > <asp:Label ID="Label2" runat="server"
    > CssClass="SearchTitles" Text="Artist :"></asp:Label>
    > <asp:TextBox ID="ArtistSearchText" runat="server"
    > BackColor="#C0FFFF"></asp:TextBox>
    > <asp:ImageButton ID="SearchByArtist" runat="server"
    > ImageAlign="Middle"
    > ImageUrl="~/Images/find.ico"
    > OnClick="SearchByArtist_Click"
    > Width="32px" />
    > </td>
    > </tr>
    > </table>
    >
    > </td>
    > <td style="width: 100px">
    > </td>
    > </tr>
    > <tr>
    > <td colspan="2">
    > &nbsp;<asp:Repeater ID="Repeater3" runat="server">
    > <HeaderTemplate>
    > <asp:Label ID="ArtistLabel" runat="server"
    > Text="Label"></asp:Label>
    > <br />
    > </HeaderTemplate>
    > <ItemTemplate>
    > <asp:ImageButton ID="ImageButton1" Height="24px"
    > Width="24px"
    > runat="server" />
    > <asp:Label ID="CDTitle" runat="server"
    > Text="Label"></asp:Label>
    > <br />
    > </ItemTemplate>
    > </asp:Repeater>
    > </td>
    > </tr>
    > </table>
    > </div>
    > </form>
    > </body>
    > </html>
    >
    >
    > .VB codebehind
    >
    > Option Strict On
    > Option Explicit On
    >
    > Imports System.IO
    > Imports MusicSiteControls
    > Imports System.Collections.Generic
    >
    > Partial Class ShowSongs
    > Inherits System.Web.UI.Page
    >
    > Protected Sub SearchByArtist_Click(ByVal sender As Object, ByVal e As
    > System.Web.UI.ImageClickEventArgs)
    > Dim d As New DAL
    > Dim artistName As String
    > artistName = ArtistSearchText.Text
    > Me.Repeater3.DataSourceID = Nothing
    > Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    > Me.Repeater3.DataBind()
    > End Sub
    >
    > Protected Sub Repeater3_ItemCreated(ByVal sender As Object, ByVal e As
    > System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
    > Repeater3.ItemCreated
    > Dim ArtistLabel As Label
    > Dim CDTit As Label
    > Dim ib As ImageButton
    > Dim ds As CD
    > Select Case e.Item.ItemType
    > Case ListItemType.Header
    > ArtistLabel = CType(e.Item.FindControl("ArtistLabel"),
    > Label)
    > ArtistLabel.Text = ArtistSearchText.Text
    > Case ListItemType.AlternatingItem, ListItemType.Item
    > ds = CType(e.Item.DataItem, CD)
    > ib = DirectCast(e.Item.FindControl("ImageButton1"),
    > ImageButton)
    > CDTit = CType(e.Item.FindControl("CDTitle"), Label)
    > CDTit.Text = ds.Name
    > Dim url As String
    > url = "~\DynamicImage.aspx?ImageFolder=" +
    > ds.FolderNumber.ToString + "&ImageText=" + "1"
    > ib.ImageUrl = url
    > End Select
    > End Sub
    >
    > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles Me.Load
    > Dim i As Integer = 1
    > End Sub
    > End Class
    >
    >
    > HELP PLEASE!
    >
    > This is just a page with a button and a repeater. How can this possibly
    > go so wrong??
    >
    > Lloyd Sheen
     
    John Kotuby, Mar 28, 2008
    #5
  6. Lloyd Sheen

    Lloyd Sheen Guest

    "John Kotuby" <> wrote in message
    news:...
    > Hi Lloyd,
    > I'm assuming you found an answer to your problem already and just didn't
    > bother to post the solution, which I would be very interested in seeing.
    >
    > My first thought on reading your posts was that the problems were deriving
    > from the use of an UpdatePanel. I've had some strange things happen with
    > UpdatePanels when the templates weren't defined such that they each
    > contain an entire Table (instead of just rows within a table).
    >
    > Also the Page_Load should Not fire after the inital load of the page,
    > because the actual page persists in the browser during an asynch callback.
    >
    > Also I was wondering if you were including the Button (actually an
    > ImageButton) as a child control in the update panel or at least defining
    > it as a Trigger for the panel.
    >
    > But all those ideas went south when you said that you removed the "AJAX"
    > stuff.
    >
    > I'm guessing you eventually re-wrote the page from scratch and got it to
    > finally work.
    >
    > Cheers...
    >
    > "Lloyd Sheen" <> wrote in message
    > news:...
    >>
    >> "Lloyd Sheen" <> wrote in message
    >> news:...
    >>>
    >>> "Lloyd Sheen" <> wrote in message
    >>> news:%...
    >>>>
    >>>> "Lloyd Sheen" <> wrote in message
    >>>> news:OhK%...
    >>>>> Ok I have a web control which is used to input search terms. It works
    >>>>> really well on one page.
    >>>>>
    >>>>> Now I need nearly the same functionallity on another page and I take
    >>>>> the pieces and move them to the new page (no web control). I have a
    >>>>> button with a click function which populates a repeater. On the first
    >>>>> click of the button it goes to the click handler and all is well. On
    >>>>> the second click it goes directly to the ItemCreated handler. Since
    >>>>> the DataSource has not been created of course this does not work.
    >>>>>
    >>>>> Of course in the call stack there is nothing I can identify as to the
    >>>>> reason for the repeater to attempt the ItemCreated since it did not go
    >>>>> thru my code to get a new datasource.
    >>>>>
    >>>>> I have tried all sorts of combinations of AutoEventWireup on the @Page
    >>>>> directive but nothing works on the second occurence.
    >>>>>
    >>>>> Any ideas? If you want I can post code as well.
    >>>>>
    >>>>> Lloyd Sheen
    >>>>
    >>>> Other detail:
    >>>>
    >>>> Code in button click is:
    >>>>
    >>>> Dim d As New DAL
    >>>> Dim artistName As String
    >>>> artistName = ArtistSearchText.Text
    >>>>
    >>>> Me.Repeater3.DataSourceID = Nothing
    >>>> Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    >>>> Me.Repeater3.DataBind()
    >>>>
    >>>> ResultsUpdatePanel.Update()
    >>>>
    >>>>
    >>>> If I comment out the DataBind on all subsequent button clicks it will
    >>>> go to the click handler. Put the databind in and it no longer goes to
    >>>> the handler.
    >>>>
    >>>> Very confusing???
    >>>>
    >>>> Lloyd Sheen
    >>>
    >>> And still more:
    >>>
    >>> I added a page load handler (does nothing). On load of app it is
    >>> called. On first click it is called. After that who knows what is
    >>> happening??
    >>>
    >>> Certainly not me and certainly not ASP.NET.
    >>>
    >>> Lloyd Sheen

    >>
    >> Ok I have taken out all Ajax (toolkit) code and I now have a button which
    >> when clicked will only work once.
    >>
    >> Here is full code:
    >>
    >> ASPX:
    >>
    >> <%@ Page Language="VB" AutoEventWireup="false"
    >> CodeFile="ShowSongs.aspx.vb" Inherits="ShowSongs" %>
    >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    >>
    >> <html xmlns="http://www.w3.org/1999/xhtml" >
    >> <head runat="server">
    >> <title>Untitled Page</title>
    >> <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    >> </head>
    >> <body>
    >> <form id="form1" runat="server">
    >> <div>
    >> <br />
    >> <table width="100%">
    >> <tr>
    >> <td >
    >> <table>
    >> <tr>
    >> <td id="ArtistTD" >
    >> <asp:Label ID="Label2" runat="server"
    >> CssClass="SearchTitles" Text="Artist :"></asp:Label>
    >> <asp:TextBox ID="ArtistSearchText" runat="server"
    >> BackColor="#C0FFFF"></asp:TextBox>
    >> <asp:ImageButton ID="SearchByArtist" runat="server"
    >> ImageAlign="Middle"
    >> ImageUrl="~/Images/find.ico"
    >> OnClick="SearchByArtist_Click"
    >> Width="32px" />
    >> </td>
    >> </tr>
    >> </table>
    >>
    >> </td>
    >> <td style="width: 100px">
    >> </td>
    >> </tr>
    >> <tr>
    >> <td colspan="2">
    >> &nbsp;<asp:Repeater ID="Repeater3" runat="server">
    >> <HeaderTemplate>
    >> <asp:Label ID="ArtistLabel" runat="server"
    >> Text="Label"></asp:Label>
    >> <br />
    >> </HeaderTemplate>
    >> <ItemTemplate>
    >> <asp:ImageButton ID="ImageButton1" Height="24px"
    >> Width="24px"
    >> runat="server" />
    >> <asp:Label ID="CDTitle" runat="server"
    >> Text="Label"></asp:Label>
    >> <br />
    >> </ItemTemplate>
    >> </asp:Repeater>
    >> </td>
    >> </tr>
    >> </table>
    >> </div>
    >> </form>
    >> </body>
    >> </html>
    >>
    >>
    >> .VB codebehind
    >>
    >> Option Strict On
    >> Option Explicit On
    >>
    >> Imports System.IO
    >> Imports MusicSiteControls
    >> Imports System.Collections.Generic
    >>
    >> Partial Class ShowSongs
    >> Inherits System.Web.UI.Page
    >>
    >> Protected Sub SearchByArtist_Click(ByVal sender As Object, ByVal e As
    >> System.Web.UI.ImageClickEventArgs)
    >> Dim d As New DAL
    >> Dim artistName As String
    >> artistName = ArtistSearchText.Text
    >> Me.Repeater3.DataSourceID = Nothing
    >> Me.Repeater3.DataSource = d.GetAlbumList(artistName)
    >> Me.Repeater3.DataBind()
    >> End Sub
    >>
    >> Protected Sub Repeater3_ItemCreated(ByVal sender As Object, ByVal e As
    >> System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
    >> Repeater3.ItemCreated
    >> Dim ArtistLabel As Label
    >> Dim CDTit As Label
    >> Dim ib As ImageButton
    >> Dim ds As CD
    >> Select Case e.Item.ItemType
    >> Case ListItemType.Header
    >> ArtistLabel = CType(e.Item.FindControl("ArtistLabel"),
    >> Label)
    >> ArtistLabel.Text = ArtistSearchText.Text
    >> Case ListItemType.AlternatingItem, ListItemType.Item
    >> ds = CType(e.Item.DataItem, CD)
    >> ib = DirectCast(e.Item.FindControl("ImageButton1"),
    >> ImageButton)
    >> CDTit = CType(e.Item.FindControl("CDTitle"), Label)
    >> CDTit.Text = ds.Name
    >> Dim url As String
    >> url = "~\DynamicImage.aspx?ImageFolder=" +
    >> ds.FolderNumber.ToString + "&ImageText=" + "1"
    >> ib.ImageUrl = url
    >> End Select
    >> End Sub
    >>
    >> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    >> System.EventArgs) Handles Me.Load
    >> Dim i As Integer = 1
    >> End Sub
    >> End Class
    >>
    >>
    >> HELP PLEASE!
    >>
    >> This is just a page with a button and a repeater. How can this possibly
    >> go so wrong??
    >>
    >> Lloyd Sheen

    >
    >


    I did post it. But what was wrong ended up being that I was handling the
    ItemCreated rather than the ItemDataBound. I was creating the page by copy
    pasting code but creating the events with IDE.

    Still a very strange happening when something was wrong.

    LS
     
    Lloyd Sheen, Mar 28, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    10
    Views:
    576
    Steve
    Jan 13, 2004
  2. James Gregory

    Size of a struct - totally confused

    James Gregory, Jan 30, 2004, in forum: C++
    Replies:
    11
    Views:
    3,226
    EventHelix.com
    Jan 31, 2004
  3. stef mientki

    LEGB rule, totally confused ...

    stef mientki, Aug 14, 2007, in forum: Python
    Replies:
    6
    Views:
    690
    Diez B. Roggisch
    Aug 15, 2007
  4. Giampaolo Rodola'
    Replies:
    17
    Views:
    1,088
    John Machin
    Jan 18, 2009
  5. eBob.com

    Newbie Totally Confused

    eBob.com, Feb 3, 2008, in forum: Javascript
    Replies:
    2
    Views:
    107
Loading...

Share This Page