Click here to Skip to main content
16,021,687 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Within update panel i have detailView. In that detailview i have a dropdownlist. This ddl has OnSelectedIndexChanged. When we change the index, the event gets fire.

The problem is After page load when i select the another index, the event fired but again its assigned to default value on its first time itself. in further If i select another value in ddl, the functionality gets work. On first selection not working properly and it reassigned to old one.

I checked with EnableViewState=true. I have used postback method to filter and avoid rebound while postback. Autopostback is true. But its not work on its first selection. Hope u understand the problem statement.

If anybody know the solution direct me to resolve this problem.

Thanks in advance
Posted

1 solution

Make sure in page_load,you binded your dropdown properly.It should be like
C#
protected void Page_Load(object sender, EventArgs e)
    {
         if (!IsPostBack)
        {
            //Bind here
        }
    }

Not
C#
protected void Page_Load(object sender, EventArgs e)
    {
        //I suspect you have binded here.
    }

Regards..:laugh:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900