Click here to Skip to main content
15,902,276 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Radio Button in a Repeater Question... Pin
just3ala210-Oct-06 20:32
just3ala210-Oct-06 20:32 
GeneralRe: Radio Button in a Repeater Question... Pin
minhpc_bk10-Oct-06 21:53
minhpc_bk10-Oct-06 21:53 
GeneralRe: Radio Button in a Repeater Question... Pin
just3ala211-Oct-06 0:15
just3ala211-Oct-06 0:15 
GeneralRe: Radio Button in a Repeater Question... Pin
minhpc_bk11-Oct-06 2:00
minhpc_bk11-Oct-06 2:00 
GeneralRe: Radio Button in a Repeater Question... [modified] Pin
just3ala211-Oct-06 2:26
just3ala211-Oct-06 2:26 
GeneralRe: Radio Button in a Repeater Question... Pin
minhpc_bk11-Oct-06 2:46
minhpc_bk11-Oct-06 2:46 
GeneralRe: Radio Button in a Repeater Question... Pin
just3ala211-Oct-06 3:02
just3ala211-Oct-06 3:02 
GeneralRe: Radio Button in a Repeater Question... Pin
minhpc_bk11-Oct-06 16:56
minhpc_bk11-Oct-06 16:56 
Because the button is placed inside the Repeater control, so you can use the ItemCommand event of the control as the Command event of the button is bubbled up to the repeater:
protected void rptrPA_ItemCommand(object source, RepeaterCommandEventArgs e)
{
    if (e.CommandName == "Go")
    {
        foreach (RepeaterItem item in rptrPA.Items)
        {
            if(IsSelected(item, "rdNA"))
                continue;

            if (IsSelected(item, "rdBelow"))
                continue;

            if (IsSelected(item, "rdAverage"))
                continue;

            if (IsSelected(item, "rdAbove"))
                continue;

            if (IsSelected(item, "rdExceeds"))
                continue;
        }
    }
}

private bool IsSelected(RepeaterItem item, string radioButtonID)
{
    RadioButton radioButton = item.FindControl(radioButtonID) as RadioButton;
    if (radioButton.Checked)
    {
        Response.Write(string.Format("Anwser for the question number {0} is {1} <br>", item.ItemIndex + 1, radioButton.Text));
    }

    return radioButton.Checked;
}



GeneralRe: Radio Button in a Repeater Question... Pin
just3ala211-Oct-06 20:52
just3ala211-Oct-06 20:52 
GeneralRe: Radio Button in a Repeater Question... Pin
minhpc_bk12-Oct-06 0:51
minhpc_bk12-Oct-06 0:51 
GeneralRe: Radio Button in a Repeater Question... Pin
just3ala212-Oct-06 4:29
just3ala212-Oct-06 4:29 
GeneralRe: Radio Button in a Repeater Question... Pin
minhpc_bk12-Oct-06 15:11
minhpc_bk12-Oct-06 15:11 
GeneralRe: Radio Button in a Repeater Question... Pin
just3ala213-Oct-06 6:36
just3ala213-Oct-06 6:36 
QuestionEnum Problem Pin
shapper10-Oct-06 7:12
shapper10-Oct-06 7:12 
AnswerRe: Enum Problem Pin
minhpc_bk10-Oct-06 15:26
minhpc_bk10-Oct-06 15:26 
Questionhelp with simple regex expressions Pin
ThePlagueIsBack10-Oct-06 6:26
ThePlagueIsBack10-Oct-06 6:26 
AnswerRe: help with simple regex expressions Pin
minhpc_bk10-Oct-06 15:29
minhpc_bk10-Oct-06 15:29 
QuestionColour (color) picker selectors, is this doable? Pin
Member 9610-Oct-06 6:19
Member 9610-Oct-06 6:19 
AnswerRe: Colour (color) picker selectors, is this doable? Pin
Mike Ellison10-Oct-06 7:01
Mike Ellison10-Oct-06 7:01 
GeneralRe: Colour (color) picker selectors, is this doable? Pin
Member 9610-Oct-06 7:17
Member 9610-Oct-06 7:17 
QuestionProblems with SQL Pin
Britney S. Morales10-Oct-06 6:04
Britney S. Morales10-Oct-06 6:04 
AnswerRe: Problems with SQL Pin
Member 9610-Oct-06 7:19
Member 9610-Oct-06 7:19 
AnswerRe: Problems with SQL Pin
just3ala210-Oct-06 8:38
just3ala210-Oct-06 8:38 
AnswerRe: Problems with SQL Pin
ednrgc17-Oct-06 7:17
ednrgc17-Oct-06 7:17 
GeneralRe: Problems with SQL Pin
Britney S. Morales18-Oct-06 2:27
Britney S. Morales18-Oct-06 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.