Postback Problem

  • Thread starter Thread starter Nesli
  • Start date Start date
N

Nesli

Hi ,

I have problem postback while filled DropDownlist and
listbox. My form have lots of drop downlist and a Listbox.
First of all your choice first dropdown. This dropdown
fill second dropdown . But I choice second dropdown that
third dropdown filled. But I don't change nothing.

I ' ll make


Note; MyDropdown's postback true , my page
<pages autoEventWireup="false" validateRequest="false"/>
MySample COde

if (!IsPostBack)

{

Int32 PortalID=22;

DropDownPortal.DataSource=DacSoru.GetPortalSelect
(PortalID);

DropDownPortal.DataTextField="portalisim";

DropDownPortal.DataValueField="portal_id";
DropDownPortal.DataBind();

DrpDwnYarisma.DataSource=
DacSoru.GetPortal(DropDownPortal.SelectedItem.ToString());

DrpDwnYarisma.DataTextField="BilgiYarisma_ad";

DrpDwnYarisma.DataValueField="ID";
DrpDwnYarisma.DataBind();
SoruID =Int32.Parse(
DrpDwnYarisma.SelectedValue.ToString());

DrpDwnYarisma.Items.Insert
(0,new ListItem("Yarışma Adı Seçiniz!",null));
if
(DrpDwnYarisma.SelectedItem.ToString()!= "Yarışma Adı
Seçiniz")
{




DropDownSoru.DataSource= DacSoru.Get_Soru
(SoruID);

DropDownSoru.DataTextField="SoruMetni";

DropDownSoru.DataValueField="SoruID";

DropDownSoru.DataBind();
}
DropDownSoru.Items.Insert
(0,new ListItem("Yarışma Adı Seçiniz!",null));
if (Request.Form
["DropDownSoru"].ToString()!=null)
{
ShowMessage(Request
["DropDownSoru"].ToString() );
}

}

-------------------------------------
 
Nesli

You can't fill your second and third dropdown in the !Postback event. Your !Postback event should only fill the first dropdown control. When the user selects an item, you load the second dropdown control on the SelectedIndexChanged event of the first dropdown control. Do the same thing for the third control.

Hope this helps
Thoma

DISCLAIMER: This posting is provided "AS IS" with no warranties and confers no rights
 
Back
Top