0

hi ,
this is asha bhatt. i have one radiobuttonlist and checkboxlist and i want to do the validation for these in asp.net ,the validation part i know that
plz see my code

protected void SubmitButton_Click(object sender, EventArgs e)
    {
        bool flage = false;
        bool valid = false;
        try
        {
           if (Convert.ToInt32(dt.Rows[count][6]) == 1)
            {
                for (int j = 0; j < Rdboxlist.Items.Count; j++)
                {
                    if (Rdboxlist.Items[j].Selected)
                    {
                        nextquestion();
                        valid = true;
                    }
                }
                if (!valid)
                {

                   

                    Response.Write("<script> confirm('You have not selected any answer.')</script>");
                    // Response.Write("<script> prompt('You have not selected any answer.')</script>");
                    nextquestion();
                }
            }
           else if (Convert.ToInt32(dt.Rows[count][6]) > 1)
            {
                for (int i = 0; i < Chkboxlist.Items.Count; i++)
                {
                    if (Chkboxlist.Items[i].Selected)
                    {
                        nextquestion();
                        flage = true;
                    }
                }

                if (!flage)
                {
                    Response.Write("<script> confirm('You have not selected any answer.')</script>");
                    nextquestion();
                }
            }
            
        }
        catch (IndexOutOfRangeException ex)
        {
            Response.Write(ex.Message);
        }
    }

if my falge is not valid then i want to show message box with yes and no button in asp.net
plz help me...............................

Edited by __avd: For easy readability, always wrap programming code within posts in [code] (code blocks)

3
Contributors
2
Replies
12
Views
7 Years
Discussion Span
Last Post by rajesh0223
0

Hi..

I want to develop a form same as this, when i enter some text and submit text should be displayed in the same form above with same gap between each user text and date should be generated by default on the date user submits and when i receive it should display the date to user automatically. what are the best tools develop and code to be used and one more important thing is user/any one should be able to download the file as pdf file which he is submited please help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.