Asp.net C#
in my database, i have 4 tables
i have to use RadioButtonList and select one of the items.
- annualleave
- emergencyleave
- medicalleave
- maternityleave
- specialleave
i need to show the table of the data in a link of another page.
please help, im out of ideas.
onselectedindexchanged="RDB_SelectedIndexChanged" Selected="True">

Abhishek KumarRank #510 · 4.8K reputationPosted Aug 26, 2014, 5:33 AM EDT
Please find the sample app attached for above requirement.
Abhishek
Ayu Marzuki3 reputationPosted Aug 26, 2014, 10:20 PM EDT
Karthik Raj14 reputationPosted Aug 26, 2014, 11:46 PM EDT
Try like this
step 1: In aspx design page for radiobutton list give the value of each button with its responsive table names and AutoPostBack="true"
ex:
Step2: In .cs file on "rbtn_SelectedIndexChanged" event call the page you required like this with parameters "Table name" and "Item Name"
if (rbtn.SelectedIndex > 0)
{
Response.Redirect("~/result.aspx?tblname=" + rbtn.SelectedValue.ToString() + "&&itemname=" + rbtn.SelectedItem.Text + "");
}
Step 3: In Result page or ur required page make a function to call your required database using the table name parameter
public void getTable(string tablename)
{
string Qry = "select * from "+tablename+"";
....
.....
....
}
step 4: In Result on load page
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["itemname"] != "" && Request.QueryString["tblname"] != "")
{
getTable(Request.QueryString["tblname"].ToString());
}
}
}
Try in this formate...