J
Jonathan Wood
Okay, I've spent considerable time trying to figure out why I get random
problems when browsing the images in the Personal Website Starter Kit.
(Note: I found a number of these sites on the Web, and all their photos
browse just fine. Something is screwy even after recreating the database.)
Although a few things are going on, one is that the navigation buttons stop
working at some random point. When I click them, the page appears to refresh
but it then shows the same image.
The navigation buttons are part of a FormView's ItemTemplate and look like
this:
<div class="buttonbar">
<a href="Albums.aspx"><asp:image ID="Image2" runat="Server"
skinid="gallery" /></a>
<asp:ImageButton ID="ImageButton1" Runat="server" CommandName="Page"
CommandArgument="First" skinid="first"/>
<asp:ImageButton ID="ImageButton2" Runat="server" CommandName="Page"
CommandArgument="Prev" skinid="prev"/>
<asp:ImageButton ID="ImageButton3" Runat="server" CommandName="Page"
CommandArgument="Next" skinid="next"/>
<asp:ImageButton ID="ImageButton4" Runat="server" CommandName="Page"
CommandArgument="Last" skinid="last"/>
</div>
So I wrote an event handler like this:
protected void FormView1_ItemCommand(object sender,
FormViewCommandEventArgs e)
{
litComment.Text = String.Format("{0}: {1}/{2}",
DateTime.Now, e.CommandName, e.CommandArgument);
}
Initially, this creates a comment that is as expected each time I click a
navigation button. But at some point, this event is no longer called! Again,
when I click a navigation button, the page appears to refresh but the time
string is exactly the same (as are the command name and argument). What on
Earth could cause the event to stop being called?
I've searched the Web and not seen a description of anything like this.
Could it be related to running older code on ASP.NET 3.5?
If anyone has a suggestion on what I might try next, I would love to hear
it.
Thanks.
problems when browsing the images in the Personal Website Starter Kit.
(Note: I found a number of these sites on the Web, and all their photos
browse just fine. Something is screwy even after recreating the database.)
Although a few things are going on, one is that the navigation buttons stop
working at some random point. When I click them, the page appears to refresh
but it then shows the same image.
The navigation buttons are part of a FormView's ItemTemplate and look like
this:
<div class="buttonbar">
<a href="Albums.aspx"><asp:image ID="Image2" runat="Server"
skinid="gallery" /></a>
<asp:ImageButton ID="ImageButton1" Runat="server" CommandName="Page"
CommandArgument="First" skinid="first"/>
<asp:ImageButton ID="ImageButton2" Runat="server" CommandName="Page"
CommandArgument="Prev" skinid="prev"/>
<asp:ImageButton ID="ImageButton3" Runat="server" CommandName="Page"
CommandArgument="Next" skinid="next"/>
<asp:ImageButton ID="ImageButton4" Runat="server" CommandName="Page"
CommandArgument="Last" skinid="last"/>
</div>
So I wrote an event handler like this:
protected void FormView1_ItemCommand(object sender,
FormViewCommandEventArgs e)
{
litComment.Text = String.Format("{0}: {1}/{2}",
DateTime.Now, e.CommandName, e.CommandArgument);
}
Initially, this creates a comment that is as expected each time I click a
navigation button. But at some point, this event is no longer called! Again,
when I click a navigation button, the page appears to refresh but the time
string is exactly the same (as are the command name and argument). What on
Earth could cause the event to stop being called?
I've searched the Web and not seen a description of anything like this.
Could it be related to running older code on ASP.NET 3.5?
If anyone has a suggestion on what I might try next, I would love to hear
it.
Thanks.