I am using VS 2010 for develop a web application.After the ‘Admin’ give approval for a company, the messagebox have to display with the message that “Vendor ID:lblPage2ID modified as “Approved” (or “Not Approved” or “Pending”) upon the radio button selected by the ‘Admin’.How to do it ? Please refer the inline code below and tell me how to place the radio buttons in straight line.
protected void rblTest_SelectedIndexChanged(object sender,EventArgs e)
{
_DAL.ExecuteSQL("UPDATE Company_Info SET
Approval_Status='"+rblTest.SelectedValue+"' WHERE Vendor_ID= '" +lblPage2ID.Text +"'");
ClientScript.RegisterStartupScript(this.GetType(),"callfunction",
"alert('Approval Status modified in database');", true);
// Page.ClientScript.RegisterClientScriptBlock (typeof(Page),"SCRIPT",
string.Format("alert(Approval Status modified as '" +rblTest.SelectedValue+"')"), true);
// HttpContext.Current.Response.Write("<script>alert (Approval Status modified as
'" + rblTest.SelectedValue +"');</script>");
// ClientScript.RegisterStartupScript (this.GetType ), "callfunction",
"alert('Approval Status modified as '"+rblTest.SelectedValue+"');",true);
}
<asp:RadioButtonList ID="rblTest" align = "center" runat="server" AutoPostBack="true" Width="152px" onselectedindexchanged="rblTest_SelectedIndexChanged" style="margin-left: 0px">
<asp:ListItem Text="Approved" Value="YES"></asp:ListItem>
<asp:ListItem Text="Not Approved" Value="NO"></asp:ListItem>
<asp:ListItem Text="Pending" Value="PEN"></asp:ListItem>
</asp:RadioButtonList>

1 Answer