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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:19:01+00:00 2026-05-22T21:19:01+00:00

I am retrieving data from a Stored Procedure and using it to populate a

  • 0

I am retrieving data from a Stored Procedure and using it to populate a list of Questions using the ASP.Net Repeater like shown below.
It works great when all the questions are of the same type. But I now would like to have two different type of questions that won’t be known until runtime.
For example one will just have Yes or No Radio boxes while another will have a 5 Radio Boxes that allow the end user to rate something from 1 -5.
There will be a field in the data returned from the Store Procedure that will identify which type of Question it is and I would like to read that value at runtime and then display the appropriate HTML.
It looks like I should be using the ItemDataBound Event of the Repeater but I can’t figure out how to do what I want?

                <asp:Panel ID="pnlQuestions" runat="server">
                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="DBDataSource" 
                    onitemdatabound="Repeater1_ItemDataBound">
                    <ItemTemplate>
                        <div class="Question">
                         /*The HTML that is written here should depend on the value
                         in one of the fields returned from the Stored Procedure*/
                        </div>
                    </ItemTemplate>
                    <FooterTemplate>
                        <div id="Footer">
                            <label for="AdditionalCommentsText" class="AdditionalCommentsLabel">Are there any additional comments or referrals you can provide at this time?</label>
                            <textarea id=""AdditionalCommentsText" class="AdditionalCommentsText" cols="80" rows="3" name="Q<%# DataBinder.Eval(Container.DataItem, "ID") %>AddtlComments"></textarea>
                            <asp:Button class="SubmitButton" runat="server" Text="Submit" />
                        </div>
                    </FooterTemplate>
                </asp:Repeater> 
                <asp:SqlDataSource ID="DBDataSource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:connString %>" 
                    SelectCommand="usp_GetActiveQuestions" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>
            </asp:Panel>
  • 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-22T21:19:01+00:00Added an answer on May 22, 2026 at 9:19 pm
    <ItemTemplate>
        <div class="Question">
            <asp:RadioButtonList runat="server" Visible='<%# Eval("QuestionType").ToString() == "YesNo" %>' >
                <asp:ListItem Value="True" Text="Yes" />
                <asp:ListItem Value="False" Text="No" />
            </asp:RadioButtonList>
            <asp:RadioButtonList runat="server" Visible='<%# Eval("QuestionType").ToString() != "YesNo" %>' >
                    <asp:ListItem Value="1" Text="1" />
                    <asp:ListItem Value="2" Text="2" />
                    <asp:ListItem Value="3" Text="3" />
                    <asp:ListItem Value="4" Text="4" />
                    <asp:ListItem Value="5" Text="5" />
            </asp:RadioButtonList>
        </div>
    </ItemTemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Traditionally when using a DbCommand when retrieving data from a sproc, something like the
I have written this query for retrieving data from mysql as below select FeedbackCode,EMailID,FeedbackDetail,
I have developed a VB.Net code for retrieving data from excel file .I load
I'd like a generic method for retrieving the data from a vector. I have
I am having problems retrieving accurate data values with my stored proc query below:
I am retrieving some data from a table in mysql. The values are stored
I'm having trouble retrieving data from my database using Spring Jdbc. Here's my issue:
I am retrieving data from an Oracle database and binding the same to a
For some reason I'm having a problem retrieving data from my database. It leaves
I have created an n-tier solution where I am retrieving related data from 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.