Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4030288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:27:08+00:00 2026-05-20T11:27:08+00:00

I have a page in which one chooses from a selection of dynamically generated

  • 0

I have a page in which one chooses from a selection of dynamically generated buttons. The ASPX code is as follows:

<div>
<asp:Repeater ID="rptrHalls" runat="server" OnItemCommand="Choose_Hall">
    <ItemTemplate>
        <asp:Button ID="btnChooseHall" runat="server"
        CommandName="<%# Container.DataItem %>" Text="<%# Container.DataItem %>"
         />
    </ItemTemplate>
</asp:Repeater>
</div>

When the page is loaded the following code is used to generate the buttons:

        ' Show which halls they are eligible for.
    Dim dbHalls As New pbu_housingDataContext
    'Dim gender As String = Session("gender").ToString
    Dim selectedHalls = (From sh In dbHalls.Rooms _
                         Where sh.gender = Session("gender").ToString _
                         Where sh.current_occupancy < sh.max_occupancy _
                         Where sh.is_available = True _
                         Select sh.building_name).Distinct()
    rptrHalls.DataSource = selectedHalls
    rptrHalls.DataBind()

When the user clicks on a dynamically generated button the following code is triggered:

    Public Sub Choose_Hall(ByVal Sender As Object, ByVal e As RepeaterCommandEventArgs)
    Session("Hall") = e.CommandName.ToString
    Response.Redirect("select_room.aspx")
    End Sub

When I first tried running the code I received an error message of “Invalid postback/callback argument”. I set the ASPX page to have a enableEventValidation=”false” property and tried running it again. It generates the page fine but when I click on a dynamically generated button it acts as if it is loading something and then just brings me back to select_hall.aspx (the page all this code is one), when (as you can see above) it should take me to select_room.aspx.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:27:09+00:00Added an answer on May 20, 2026 at 11:27 am

    So, it appears I figured out the issue. In the Page_Load section of select_hall.aspx I had a call to the database. Every time I called the page it was reloading these values – and I think they were not matching up to the previously cached properties in some way (e.g. underlying ASP.NET auto-naming), this was causing the issue. I added a If Not Page.IsPostBack Then clause inside which I placed the data binding code and now it appears to work correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I have a page on my ASP.NET MVC web app for users to
I have seen a few posts regarding this issue but not one specific to
I've got an asp.net page containing a Textbox with an Autocomplete extender on it.
I have a large set of classic ASP pages to convert. I will be
I want to stay way from GET params. Don't want to use POST and
I wrote some PHP code that will allow me to create an html dropdown
Hopefully, this fictitious example will illustrate my problem: Suppose you are writing a system
I've been tasked with implementing a Date/Time selector for several areas of our web
We use a DHTML calendar picker that only allows you to change the date,
I'm working on an installer project that consists of an MSI file and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.