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

  • Home
  • SEARCH
  • 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 34715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:07:19+00:00 2026-05-10T14:07:19+00:00

I have a Question class: class Question { public int QuestionNumber { get; set;

  • 0

I have a Question class:

class Question {     public int QuestionNumber { get; set; }     public string Question { get; set; }     public string Answer { get; set; } } 

Now I make an ICollection of these available through an ObjectDataSource, and display them using a Repeater bound to the DataSource. I use <%#Eval(‘Question’)%> to display the Question, and I use a TextBox and <%#Bind(‘Answer’)%> to accept an answer.

If my ObjectDataSource returns three Question objects, then my Repeater displays the three questions with a TextBox following each question for the user to provide an answer.

So far it works great.

Now I want to take the user’s response and put it back into the relevant Question classes, which I will then persist.

Surely the framework should take care of all of this for me? I’ve used the Bind method, I’ve specified a DataSourceID, I’ve specified an Update method in my ObjectDataSource class, but there seems no way to actually kickstart the whole thing.

I tried adding a Command button and in the code behind calling MyDataSource.Update(), but it attempts to call my Update method with no parameters, rather than the Question parameter it expects.

Surely there’s an easy way to achieve all of this with little or no codebehind?

It seems like all the bits are there, but there’s some glue missing to stick them all together.

Help!

Anthony

  • 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. 2026-05-10T14:07:20+00:00Added an answer on May 10, 2026 at 2:07 pm

    You have to handle the postback event (button click or whatever) then enumerate the repeater items like this:

    foreach(RepeaterItem item in rptQuestions.Items) {    //pull out question    var question = (Question)item.DataItem;    question.Answer = ((TextBox)item.FindControl('txtAnswer')).Text;     question.Save() ?  <--- not sure what you want to do with it } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 200k
  • Answers 200k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What version of IIS do you have? Try this link:… May 12, 2026 at 8:02 pm
  • Editorial Team
    Editorial Team added an answer If we consider x:{a,b,c} an element, the following would give… May 12, 2026 at 8:02 pm
  • Editorial Team
    Editorial Team added an answer Try this: <Window.Resources> <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD" /> <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888"… May 12, 2026 at 8:02 pm

Related Questions

I have a post class : class Post { public int ID; public int?
Public Class FooBar { private int _foo; public int Foo { get { return
I have a base class with the following (trimmed for brevity) declaration: public abstract
Yeah, sorry about asking a stupid n00b question. So I have a C# program.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.