Click here to Skip to main content
15,880,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i used the html select..
ASP.NET
<select data-placeholder="Select one." class="chzn-select" tabindex="3" ID="ddlGvSerial" runat="server" style="width:250px">
                      </select>



trying to get it as dropdown list like this..

C#
DropDownList ddlSerialNo = obj.FindControl("ddlGvSerial") as DropDownList;

but i'm getting error..

C#
Object reference not set to an instance of an object.
Posted
Comments
Tejas Vaishnav 19-Sep-14 4:53am    
You are not allowed to access html control to code behind, as they are render on client side, you can not access it over server side, to access them on server side you either make them run at server or use asp.net control to access it over code behind page.
/\jmot 19-Sep-14 4:55am    
i already used Runat="server"
Shemeemsha (ഷെമീംഷ) 19-Sep-14 7:21am    
Use ddlGvSerial.Bind() function

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