What Event Exactly?
I need to know which event i have to use? Im not sure in what event i have to put my code in exactly.Please help.
I need to know which event i have to use? Im not sure in what event i have to put my code in exactly.Please help.
Maxood wrote:
I need to populate a dropdown listbox
Maxood wrote:
once the user the clicks his desired selection in the dropdown listbox ....I need to know which event i have to use? Im not sure in what event i have to put my code in exactly.Please help.
Remco
The populate procedure is as follows:
Sub populate(sender as object, e as eventargs)
'code to populate subcategory dropdown list box
End Sub
But it is not working , whenever i select any other item in the category listbox the first item gets selected automatically.Need to sort out this problem.
Please look in to it and let me know what to do...thanx
okay let me just explain the heart of the problem. There is this dropdownlist populated with vales from SQL Server 7.0 database i.e. "clothing","food","stores" and "homeliving".
Now just the first time when the user selects any value from this list the first value "clothing" gets selected and on the status bar it comes "opening page http://maxood/5040/watal.aspx" .This means the page gets loaded again.
Now how can i stop it!!?
Here is my code for the page load event:
Dim strConnection as String = "server=Maxood;database=watal;user id=sa;password=;"
Dim strSql as String = "Select categoryname from category"
Dim objConn1 as New SqlConnection(strConnection)
Dim cmdCat as New SqlCommand(strSql,objConn1)
objConn1.Open()
cboCat.DataSource = cmdCat.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
cboCat.DataTextField = "categoryname"
cboCat.DataBind()
strSql = "Select * from city"
Dim objConn2 as New SqlConnection(strConnection)
Dim cmdCity as New SqlCommand(strSql,objConn2)
objConn2.Open()
cbocity.DataSource =cmdCity.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
cboCity.DataTextField="city"
cboCity.DataBind()
Please explain!!
like this
Page_load(even ......)
{
if (!IsPostBack)
{
BindingCode.....
}
}
I am writting it in C# but I hope It is understood.
I hope this will be helpful.
is iT ?
thnax a lot for this tip. I need to know what event is generated when a user selects a new item in a dropdown list box.
Please give me an exaple through code...thanx.
private
{
Response.Write("I am here");
}
THis will help..