Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Please help...

 

I'm like basically all done with the website but this part is really getting to me.

 

 

I have a page that has a imagebutton linked to a category change function. When the user clicks the picture, it will change the picture and switch the display to show different data. when the user clicks the picture again, it will change the picture back to what it was, and the data will be switched to. Basically it's for switching between a couples and singles data list for a personals web site.

 

What happens is after the first switch, I cannot switch back!! After maybe 10 clicks, the program switches back. Is there a problem with buffer or something? or postback to the same webpage ?? It's like the button works once and then stops executing again.

Posted

Found how to format.. :D

 

   Private Sub ProfileBanner_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ProfileBanner.Click
       Session("SearchFilter") = "" ' Reset
       If Session("ViewWho") = "Single" Then
           ' Single change to Couple
           Session("SetView") = "Couple"
           Response.Redirect("personals.aspx")  ' Reload
       Else
           ' Couple Change to Single
           Session("SetView") = "Single"
           Response.Redirect("personals.aspx")  ' Reload
       End If
   End Sub

 

===== Below the page load of that personals.aspx =====

 

   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       'Put user code to initialize the page here
       Dim Pg As Integer = 1, temp As String
       Dim name As String = Page.Request.Item("usr")

       If Session("SearchFlag") = "ON" Then
           Session("SearchFlag") = ""
       Else
           If Not Page.IsPostBack Then
               ' First time page is clicked on
               Session("SearchFilter") = "" ' Reset
               Session("ViewWho") = "Single" ' Reset View back to Singles
           End If
       End If

       If Session("SetView") = "Couple" Then
           ' Couple Search
           Session("ViewWho") = "Couple"
       Else
           ' Single Search Visible
           Session("ViewWho") = "Single"
       End If
       Session("SetView") = ""

       If Session("ViewWho") = "Couple" Then
           ' Currently viewing couple section
           ProfileBanner.ImageUrl = "images/prof_Lbanner_s.jpg" ' show singles banner
           ProfileBanner.ToolTip = "View the Singles"
       Else
           ' Currently viewing singles section
           ProfileBanner.ImageUrl = "images/prof_Lbanner_c.jpg" ' show couples banner
           ProfileBanner.ToolTip = "View the Couples"
       End If

 

 

The picture changes once. Then it stops changing. If I click the

picture several times (10 times or such) it will finally change again.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...