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 8422137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:21:22+00:00 2026-06-10T03:21:22+00:00

I have a Listview that pulls and displays some data. Field 1 is the

  • 0

I have a Listview that pulls and displays some data. Field 1 is the PK, Field 2 is a type identifier, and the rest are plain data. I have a button I’ve made that appears as the last field on every record. The button needs to be able to call the proper page based on Field 2, and pass it the value of Field 1.

How can I tell which record is being clicked, and grab the appropriate values for my logic?

|Field 1|Field 2|Button |
|      1|      2| Click |
|      2|      2| Click |
|      3|      1| Click |
  • 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-06-10T03:21:24+00:00Added an answer on June 10, 2026 at 3:21 am

    In the markup of your ListView where you define your button, do this:

    <asp:button id="yourButton" OnClientClick='<%#redirectToProperPage(Eval("Field1"),Eval("Field2"))%>' />
    

    Now, define a JS function like so:

    function redirectToProperPage(id1,id2)
     {
          if(id2==1)
          {
            if(id1==1)
               window.location='MyOtherpage.aspx';
            else 
              window.location='Different.aspx';
          }
          else ...
     }
    

    You get the idea… you don’t need code behind for this unless you want to do something more than simply redirecting to a different page.

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

Sidebar

Related Questions

I have a ListView that displays a link button. I need the link button
I have ListView that uses a GridView to display several columns of data. Two
I have a ListView that displays a shopping cart. It was working fine until
I have a ListView that has a FileUpload control and a button in each
I have ListView that shows data: <ListView android:id=@+android:id/list android:layout_width=fill_parent android:layout_height=wrap_content> </ListView> The headlines is
I have listview that binds from sqlite and groups by KEY_TITLE(field) so i need
I have a ListView that displays a bunch of homework assignments. The ListView items
I have a fragment which pulls down data from a webservice and displays this
I have an activity that pulls a String Array from xml and displays a
I have a ListView that populates data from a DB into a complex-ListView. 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.