Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In GridView i've the following DropDownlist Control. When I click on some index then SelectedIndexChanged event is firing in .Net Framework 2.0 version of Windows Vista and is working fine. Also When im using .Net Framework 4.0 in windows 8 version working fine.
But the issue is when im using .Net Framework 2.0 in windows 8 version page is getting refresh rather it has to fire dropdownlist selectedindexchanged event..


ASP.NET
<asp:TemplateField>
	<ItemTemplate>
       <asp:DropDownList ID="ddlCLStatus" runat="server" AutoPostBack="true" CssClass="ddlblack" CausesValidation="false"
        OnSelectedIndexChanged="ddlCLStatus_SelectedIndexChanged" SelectedValue='<%# Bind("Status") %>'>
            <asp:ListItem Text="Pending" Value="P"></asp:ListItem>
            <asp:ListItem Text="Cleared" Value="C"></asp:ListItem>
            <asp:ListItem Text="Returned" Value="R"></asp:ListItem>
            <asp:ListItem Text="Clear All" Value="CA"></asp:ListItem>
            <asp:ListItem Text="Returned All" Value="RL"></asp:ListItem> <%--Added by Gaurav Sikarwar on 02-03-2015--%>
        </asp:DropDownList>
	</ItemTemplate>
</asp:TemplateField>
Posted
Updated 2-Dec-15 20:48pm
v2
Comments
Suvendu Shekhar Giri 3-Dec-15 1:32am    
That's by design. You have set AutoPostBack="true" so when you fire any event of the dropdownlist the page will refresh(which is in fact a postback).

Please provide more info about what's not working.
Have you debugged by putting a breakpoint in the event? Share your observation.
JanardhanSharma 3-Dec-15 2:50am    
Yes i debugged the solution.. Autopostback is already set to true.. If i set Autopostback to False then Event wont fire.. I tried and is not firing when it's false. Now i provided some more info.. plz look in to that.
John C Rayan 3-Dec-15 4:35am    
What browser are you using? Can you check for any script error in Browser status page. Why do you want .NET 2.0 , .NET 2.0 should work fine in .NET 4. So I don't understand why you are trying very old .NET framework in the latest OS.

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