Passing Value

Posted by Sbadrian under ASP.NET on 6/11/2009 | Views : 1777 | Status : [Member] | Replies : 35
Hi,

I want to pass a selected value from a DropDownList that is on a aspx page from a master page , to an asp label that is on a pop up page . I used an article from an web site snippets and it works but it display the value into the current page the one with the ddl , how can i insert the value into that pop up page?

Language C#
Asp.net
SQL Server 2008

Thank you, Adrian




Responses

Posted by: Vuyiswamb on: 6/11/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Afternoon Sbadrian

Save the value in a Session variable like this

Session["My_Var"] = mydropdownlist.selectIem.Tostring();


and Bind your Label in your Popup like this

Label1.text =Session["My_Var"];


Thank you for Posting at Dotnetfunda


Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/11/2009 [Member] Starter

Up
0
Down
Thank you for the fast reply Vuyiswamb , i will try this tomorrow morning and i will post again an reply to notice you if it works.

Also the DropDownList is populated with sqldatasource taking values from the database.

Have a good day.

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/11/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Thank you again For Posting at Dotnetfunda.

i will be waiting for your reply

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/12/2009 [Member] Starter

Up
0
Down
Hello again,

So here is the code:

On the default.aspx in page_load : Session["Var"] = ddlDev.SelectedItem.ToString();

On the pop op aspx page_load : if (Session["Var"] != null)
{
AA.Text = (string)Session["Var"];
}
else
{
AA.Text = "Information not found.";
}

When compiling , after i select the value from the drop down list , into the label it display only the first value from the dropdownlist and not the selected one .

I wait for a reply

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/12/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Sbadrian

Yes it will Display the First item in the DropDownlist because you have put the code in the wrong place, when the page loads there is no selecting and the Session will be filled with the First item on the dropdownlist. You have to use the selectedindexchange event of the dropdownlist like this

Write the code you have added in the page load in the selectedindexchange event of the dropdownlist. if you have trouble finding the event please tell me

Session["Var"] = ddlDev.SelectedItem.ToString();


Thank you again for Posting at .NetFunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/12/2009 [Member] Starter

Up
0
Down
Good morning to you,

Here is the code for the SelectedIndexChanged :

protected void ddlDev_SelectedIndexChanged(object sender, EventArgs e)
{
string connStr = ConfigurationManager.ConnectionStrings["MetrologyConnectionString"].ToString();
string strQuery = "select [Name] from [Production.Devices] where" + " [Name] = [@Name] ";
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand();
cmd.Parameters.AddWithValue("@Name", ddlDev.SelectedItem.Value);
cmd.CommandType = CommandType.Text;
cmd.CommandText = strQuery;
cmd.Connection = conn;
try
{
conn.Open();
SqlDataReader sdr = cmd.ExecuteReader();
while (sdr.Read())
{
AA.Text = sdr["Name"].ToString();
}
}
catch (Exception ee)
{
AA.Text = ee.Message.ToString();
}
finally
{
conn.Close();
conn.Dispose();
}
}

And yes i have added the code for Session in the page_load event.
I have added Session["Var"] = ddlDev.SelectedItem.ToString(); into the SelectedIdexChanged event after the finally , and when i select a value from the DDL it executes AA.Text = "Session information not found.";

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/12/2009 [Member] Starter

Up
0
Down
In the pop up page :

protected void Page_Load(object sender, EventArgs e)
{
if (Session["Var"] != null)
{
AA.Text = (string)Session["Var"];

}
else
{
AA.Text = "Session information not found.";
}
}

I reverse them , in else it was AA.Text = (string)Session["Var"]; and when i select an item nothing was displayed

Vuyiswa Maseko , thank you for your replies , now i will take my weekend off, i hope you can help me solve this problem, i will come back on monday to check for replies and solve it. Again thank you and have a great weekend.

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/12/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Sbadrian

You are going about this very wrong and i see there are some practices that are bad in your code, you code is screaming "Please put me in a Function" let me write everything for you from Scratch.

First Create a Function that will access the Data from the Database, i see you used a Reader, a Datatable wont be bad

Private void  Bind_Combo()

{
string connStr = ConfigurationManager.ConnectionStrings["MetrologyConnectionString"].ToString();
string strQuery = "select [Name] from [Production.Devices] where" + " [Name] = [@Name] ";
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand();
cmd.Parameters.AddWithValue("@Name", ddlDev.SelectedItem.Value);
cmd.CommandType = CommandType.Text;
cmd.CommandText = strQuery;
cmd.Connection = conn;
Datatable dt = new Datatable();
SqlDataadapter da = new SQlDataadapter();
da.selectedCommand = cmd;
try
{
conn.Open();
da.Fill(dt);
DropDownlist.dataSource = dt;
DropDownlist.Displaytext =" Devices";
}
catch(sqlException ex)
{
lblmessage.text = ex.Message;
}
Finally
{
if(conn != null)
{
conn = null;
}
}

the above method will be called from the page load like this

Page load

Bind_Combo();


and when are done , you will go to your Selectedindexchange event of your dropdownlist and write the Following

Session["MySession_Value"] = DropDownlist.SelectItem.ToString();


I did not Write this in VS , so don't do a Copy and Paste. and Put a break point and Tell me what do you see after you make a selection in your Dropdownlist. If you can get the Session with a value and make sure that in your Pop-up the name of session variable is Correct.

Thank you again for posting at Dotnetfunda


Vuyiswa Maseko





Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/12/2009 [Member] Starter

Up
0
Down
Thank you for the reply , i will have to take a closer look monday , by the way the code is in C# , i will notice you on monday morning , thank you again.

Adrian

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/12/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Afternoon Sbadrian

The Code is C# as you can see , but if you want it in VB.NET , you can easly convert the code here

http://converter.telerik.com/

Thank you For Posting at DotnetFunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/15/2009 [Member] Starter

Up
0
Down
Good Morning , Vuyiswa Maseko

I corrected the code as you said.
First i get this error : Object reference not set to an instance of an object.

cmd.Parameters.AddWithValue("@Name", ddlDev.SelectedItem.Value);


DropDownlist.Displaytext =" Devices"; i did not find DisplayText only Text



Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/16/2009 [Member] Starter

Up
0
Down
Some help with Object reference not set to an instance of an object please??

I run the debbuger and in Immediate Window i hot the following :

Immediate Window :

? cmd.Parameters.AddWithValue("@Name", ddlDev.SelectedItem.Value);
'cmd' is null

?cmd.Parameters.AddWithValue("@Name", ddlDev.SelectedItem.Value);
'((System.Web.UI.WebControls.ListControl)(((ASP.section3_default_aspx)this).d
dlDev)).SelectedItem' is null

I hope for an reply , thank you

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/16/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Sbadrian

Am Sorry i could answer you quickly, it was a Public Holiday in South Africa Yesterday.

Firstly this is what i saw in your Code. First you have Directly used the Dropdownlist as a Parameter and that is not Correct , if the user did not select anything it will come back with nulls and that will give you that error or if the value is null it will give you that Error. That is why the Good Programming Practice is not to use the Controls Directly because what is coming from a Control is Coming from a user and it might not be what your code expects. The First thing you should do is declare a varible and make sure that you check it for nulls or empty strings before you use it as a parameter in your command object.

String SelectedValue = ddlDev.SelectedItem.SelectedText;


if(SelectedValue  != "")

{
//Do some Database Work
}


and this Database work is done this way

cmd.Parameters.Add("@Name",SqlDatatype.Varchar,20).Value  = SelectedValue  ;


In this Case you are sure that there will be a Value and you will not get the Error you got.

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko




Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/16/2009 [Member] Starter

Up
0
Down
Now i am kinda lost:

private void Bind_Combo()
{
string SelectedValue = ddlDev.SelectedItem.Text;
string connStr = ConfigurationManager.ConnectionStrings["MetrologyConnectionString"].ToString();
string strQuery = "select [Name] from [Production.Device] where" + " [Name] = [@Name] ";
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand();
if (SelectedValue != "")
{
cmd.Parameters.Add("@Name", SqlDbType.NVarChar, 25).Value = SelectedValue;
}
cmd.CommandType = CommandType.Text;
cmd.CommandText = strQuery;
cmd.Connection = conn;

DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;

try
{
conn.Open();
da.Fill(dt);
ddlDev.Text = "Devices";
}
catch (SqlException ex)
{
AA.Text = ex.Message;
}
finally
{
if (conn != null)
{
conn = null;
}
}
}

It gets me the same error : object reference at this line string SelectedValue = ddlDev.SelectedItem.Text;

It seems that there is no SelectedText , do i miss something here?

In Immediate Window i got this

?string SelectedValue = ddlDev.SelectedItem.Text;
A local variable named 'SelectedValue' is already defined in this scope

Then i renamed to SelectedVal and it still says the same thing that is already defined in this scope.




Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/17/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Sbadrian

/*If i were you i would have started by Created a Stored Procedure like this
and removing SQl in my C# code or page*/

create proc prc_name
(
@Name varchar(20)
)
as
select [Name] from [Production.Device] where [Name] = @Name


and in my page i will have a Combobox and i will take its selected value and pass it to a Function like this


        string SelectedValue = ddlDev.SelectedItem.Text;

string SelectedValue = ddlDev.SelectedItem.Text;

try
{
DataTable dt = Bind_Grid(SelectedValue);
//lets say i want to bind a Gridview
Combobox1.DataSource = dt;
Combobox1.DisplayText = "Name";
}
catch (SqlException ex)
{
AA.Text = ex.Message;
}


The above code is in the Part where you want to Bind and your Combo, this can be in the Page load. and your Function should change and accept a Parameter and return a Datatable and look exactly like this

private DataTable Bind_Combo(String SelectedValue)
{


string connStr = ConfigurationManager.ConnectionStrings["MetrologyConnectionString"].ToString();

SqlConnection conn = new SqlConnection(connStr);

SqlCommand cmd = new SqlCommand();

cmd.Parameters.Add("@Name", SqlDbType.VarChar, 25).Value = SelectedValue;

cmd.CommandType = CommandType = CommandType.StoredProcedure;

cmd.CommandText = "prc_name";

cmd.Connection = conn;

DataTable dt = new DataTable();

SqlDataAdapter da = new SqlDataAdapter();

da.SelectCommand = cmd;

try
{
conn.Open();

da.Fill(dt);

}
catch (SqlException ex)
{
AA.Text = ex.Message;
}
finally
{
if (conn != null)
{
conn = null;
}
}
}


with this approach i dont see anything failing. Now i need you to try this and put a break point where you start using this function and check if there are any empty values especially in the value returned by the Combobox.

Thank you for Posting at dotnetfunda

Were Looking forward for your reply

Vuyiswa Maseko




Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/17/2009 [Member] Starter

Up
0
Down
HI again,

Well i created the procedure(works) but there are problems with the code:

1. Where do you put the first code you write it after the procedure. In Page_Load? and there is this error Cannot implicitly convert type 'void' to 'System.Data.DataTable' here DataTable dt = Bind_Grid(SelectedValue);

2. There is no code for Bind_Grid , and there is an invalid expression in (String SelectedValue)

3. So i'm totally lost

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/17/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Afternoon Sbadrian

I think am Confused myself :) i lost you completely, I have read from the First message. ok Dont panic nothing is Wrong yet. but mybe you are the one that went out of the topic we had. am guilty too.

The Second code has to be in the pageload. As you can see i have duiplicated the declaration of a Variable , you can remove one of them.

and try it again.

Thank you for posting at Dotnetfunda


Vuyiswa Maseko



Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/17/2009 [Member] Starter

Up
0
Down

Vuyiswa Maseko ,

Sorry for the confusion , i`m just a little upset about this. Let`s try this aproach:

protected void Page_Load(object sender, EventArgs e)
{
Bind_Combo();
}

private void Bind_Combo()
{
string connStr =
ConfigurationManager.ConnectionStrings["MetrologyConnectionString"].ToString();
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand();
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;


try
{
cmd.CommandText = "DDLDeviceName";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = conn;
string SelectVal = ddlDev.SelectedItem.Text;
if (SelectVal != "")
{
cmd.Parameters.Add("@Name", SqlDbType.NChar, 25).Value = SelectVal;


}
conn.Open();
da.Fill(dt);
ddlDev.Text = "Aparate";
}
catch (SqlException ex)
{
AA.Text = ex.Message;
}
finally
{
if (conn != null)
{
conn = null;
}
}
}

protected void ddlDev_SelectedIndexChanged(object sender, EventArgs e)
{
Session["Var"] = ddlDev.SelectedItem.ToString();
}

Error: Object reference not set to an instance of an object.
Line 42: string SelectVal = ddlDev.SelectedItem.Text;
[NullReferenceException: Object reference not set to an instance of an object.]

All i want is to make the DropDownList to work and on selected item from the DDL to be memorized in a session , we did this so far but the problem is that the DDL is sending only the first value.

And i want to say many thanks for helping me out with this, many many many thanks.

Adrian


Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/17/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Afternoon Sbadrian

I see where is the Problem , your Dropdown returns null or Empty String , You are not getting the Value. Change the Code to look like this

Change this

Session["Var"] = ddlDev.SelectedItem.ToString();

to

Session["Var"] = ddlDev.SelectedItem.Value.ToString();


and try it again , please put a Breakpoint to see if it goes there

Thanks

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/17/2009 [Member] Starter

Up
0
Down
After this quick change Session["Var"] = ddlDev.SelectedItem.Value.ToString();

I run the debbuger and stopped at this line:

Line 42:
string SelectVal = ddlAparat.SelectedItem.Text;

[NullReferenceException: Object reference not set to an instance of an object.]


Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/18/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
But that is something Different, i have never seen that in your Code :) am i right ? ?

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/18/2009 [Member] Starter

Up
0
Down
yes i have changed it because i`m trying to see a proper solution to solve my problem and i`m starting to get lost :D

I see now that my dropdown list is not populated , and that is why i get the error message [NULL] , so i will populate now the DDl and see further to select an item and store it into session

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/18/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
But show me the code that Populate the Dropdownlist and when you run your Application are there any items in the DDL?

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/18/2009 [Member] Starter

Up
0
Down
i want to populate the DDL from a database using code behind , there are no items in the DDL , i will import names of some devices from a data base table. I could not make it until now to populate the DDL from code behind :|
Can i get some help with that?

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/18/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Sbadrian

That is why am here to help. Lets see

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/18/2009 [Member] Starter

Up
0
Down
Good morning
Vuyiswa Maseko

So i populated the DDL from code as it follows:

protected void Page_Load(object sender, EventArgs e)

{
if (!IsPostBack)
{
BindDdlDev();
}
}


private string GetConnectionString()

{
return System.Configuration.ConfigurationManager.ConnectionStrings["MetrologyConnectionString"].ConnectionString;
}


private void BindDdlDev()

{
DataTable dt = new DataTable();
SqlConnection conn = new SqlConnection(GetConnectionString());

try
{
conn.Open();
string sqlStatement = "SELECT [Name] FROM [Production.Devices]";
SqlCommand sqlCmd = new SqlCommand(sqlStatement, conn);
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
sqlDa.Fill(dt);

if (dt.Rows.Count > 0)
{
ddlDev.DataSource = dt;
ddlDev.DataTextField = "Name";
ddlDev.DataValueField = "Name";
ddlDev.DataBind();
}
}

catch (System.Data.SqlClient.SqlException ex)
{
AA.Text = ex.Message;
}

finally
{
conn.Close();
}
}


protected void ddlDev_SelectedIndexChanged(object sender, EventArgs e)

{
Session["Var"] = ddlDev.SelectedItem.Value.ToString();
}


The ddl is populated with some devices name, when i select a device it opens a pop up page but still i cant save the selected name into the pop up page.

In the pop up page cs i have :

protected void Page_Load(object sender, EventArgs e)

{
if (Session["Var"] != null)
{
AA.Text = (string)Session["Var"];

}
else
{
AA.Text = "Session information not found.";
}
}


In the asp label on my pop up page it displays the message: Session information not found.

Editing again:

The selection is working now , but if i select a device name it display the last selection , let me give you an example:

at the beginning i selected A
it display Session information not found
i recompile again and select B
and it displays A
i refresh the page and select C
and it displays B
and so on , it keeps on displaying the last device , not like this
select A displays A
select B displays B ... etc

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/19/2009 [Member] Starter

Up
0
Down
Are the values selected from the DDL stored somewhere? Like i select a value A and the server needs to memorize that value in the DDL? i`m a little confused :D

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/21/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning

But a Break point in this code and check if the code runs in this Part.


protected void ddlDev_SelectedIndexChanged(object sender, EventArgs e)


{

Session["Var"] = ddlDev.SelectedItem.Value.ToString();

}


Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/22/2009 [Member] Starter

Up
0
Down
Yes i put the breakpoint and it runs there; in the immediate window i put
?session["Var"]=ddlDev.SelectedItem.Value.ToString();
and it was displayed as result a value from the DDL

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/22/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Please Add a Declaration of a Variable after the assignment of a Session and Assign the variable and and when you busy doing a step through tell me if it find the Correct value in the test variable

Thanks

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/23/2009 [Member] Starter

Up
0
Down
if (Session["Var"] != null)

{
AA.Text = (string)Session["Var"];
}
else
{
AA.Text = "Information not found.";
}

when i select some value from de DDL it still says to tme "Information not found." I cannot see the problem to solve it , please help me with this..

void Session_Start(object sender, EventArgs e)

{
Session.Add("Var", ddlDev.SelectedItem.Value.ToString());
}

protected void ddlDev_SelectedIndexChanged(object sender, EventArgs e)
{
Session["Var"] = ddlDev.SelectedItem.Value.ToString();
}


I did this declaration but i don`t know if it is ok , still no current value selected from the DDL is displayed.

Hope for a quick reply , thank you

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/29/2009 [Member] Starter

Up
0
Down
I still cannot see the selected value from the DDl into the desired page were i want the information to be displayed. I`m very stuck with this

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/30/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
You Problem is Easy and i think you are Doing a very small mistake. Go to Skype and lets Chat there , let me see your Code there , i will test it and check there was the Problem. Please prepare a Sample Project that you can send it to me through skype. my username is Vuyiswamb ,search for me (South Africa). i Normal dont use Skype people disturb me there. Come there

Thanks

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/30/2009 [Member] Starter

Up
0
Down
Finally we got a solution to the passing value problem:

- the code was correct but the problem was in the DDL properties , AutoPostBack was set to False , after changing it to True , everything was working OK , the selected value from the DDL was stored in a session and i can use now the value every were i want to display it .

Many thanks Vuyiswa Maseko for your help.

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/30/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response