ASP.NET - how to create a page like below diagram.

Asked By aman on 10-Nov-11 09:35 AM
hi all,

i want to create a page for Question and their respective options but finding it to do so...

please help me with some good example.

dipa ahuja replied to aman on 10-Nov-11 09:45 AM
Untitled document
1. Do You have cell phone?<br />
     <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged">
2. Do you have LandLine Phone?<br />
     <asp:RadioButtonList ID="RadioButtonList2" runat="server">
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Submit" />
    <asp:Label ID="lblResult" runat="server" Text="Label"></asp:Label>
protected void Button1_Click(object sender, EventArgs e)
  lblResult.Text = "";
  lblResult.Text ="Your First Ans :" + RadioButtonList1.SelectedItem.ToString();
  lblResult.Text = lblResult.Text + "Your Second Answer " +      RadioButtonList2.SelectedItem.ToString();

protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
   Response.Write("you have selected " + RadioButtonList1.SelectedItem.Text.ToString());
kalpana aparnathi replied to aman on 10-Nov-11 12:52 PM
Try this code:
private void Form1_Load(object sender, EventArgs e)
     public static string path = @"yourfile.xlsx";
     string connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;";


          System.Data.OleDb.OleDbConnection MyConnection;

          System.Data.DataSet DtSet;

          System.Data.OleDb.OleDbDataAdapter MyCommand;

          MyConnection = new System.Data.OleDb.OleDbConnection(connStr);

          MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection);

          MyCommand.TableMappings.Add("Table", "TestTable");

          DtSet = new System.Data.DataSet();




        catch (Exception ex)



Design code:


<form runat="server">
<asp:Repeater id="qdata" runat="server">

<table border="1" width="100%">