I have a link called ClientDetails on the Main page, Once the user clicks on the Link then it should open a Display/pop up box. There will be a drop down box on the Display/pop up window, values in the drop down are retrieved from Stored procedure called
uspAccountType.
Once a value is selected by the user from the drop down and clicks on Submit button then it should return to the main page and it should display the value selected for the Account type on the main page Client.
So below is the task am looking for...
1. To bind the values from the stored procedure to drop down.
2. once the user selects a value from the drop down and clicks submit the pop up window must get closed and the value selected should be displayed on the main page.
I am using Subsonic method.
Could someone please help me with this request and thanks a lot for help.
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
string cons = ConfigurationManager.ConnectionStrings["con"].ToString();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getdata();
}
}
void getdata()
{
SqlConnection con = new SqlConnection(cons);
con.Open();
SqlCommand command = new SqlCommand("sp_Test", sqlConnection); //"sp_Test" is my stored procedure name
command.CommandType = CommandType.StoredProcedure;
ApplicationH...
0 Points
4 Posts
Drop Down Menu
Jun 21, 2012 02:45 AM|LINK
I have a link called ClientDetails on the Main page, Once the user clicks on the Link then it should open a Display/pop up box. There will be a drop down box on the Display/pop up window, values in the drop down are retrieved from Stored procedure called uspAccountType.
Once a value is selected by the user from the drop down and clicks on Submit button then it should return to the main page and it should display the value selected for the Account type on the main page Client.
So below is the task am looking for...
1. To bind the values from the stored procedure to drop down.
2. once the user selects a value from the drop down and clicks submit the pop up window must get closed and the value selected should be displayed on the main page.
I am using Subsonic method.
Could someone please help me with this request and thanks a lot for help.
sumitacc
Member
185 Points
53 Posts
Re: Drop Down Menu
Jun 21, 2012 04:59 AM|LINK
To bind values from stored procedure in dropdown
using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Configuration; using System.Data.SqlClient; public partial class _Default : System.Web.UI.Page { string cons = ConfigurationManager.ConnectionStrings["con"].ToString(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { getdata(); } } void getdata() { SqlConnection con = new SqlConnection(cons); con.Open(); SqlCommand command = new SqlCommand("sp_Test", sqlConnection); //"sp_Test" is my stored procedure name command.CommandType = CommandType.StoredProcedure;and for for 2nd question i would suggest u to
use javascript showmodaldialog popup
you can get more info on this link
http://javascript.gakaa.com/window-showmodaldialog-4-0-5-.aspx
Thanks
Software Developer
India