Jul 05, 2012, 1:07 PM
Data not binding into ComboBox
Hai Everybody
Data is not binding into Combobox through DirectEvent, but when we are write code in pageload its working fine
Anybody tell me the reason,and i have used the sourcecode of ext.net2.0Rc1.
here is the code
Data is not binding into Combobox through DirectEvent, but when we are write code in pageload its working fine
Anybody tell me the reason,and i have used the sourcecode of ext.net2.0Rc1.
here is the code
<%@ Page Language="C#" AutoEventWireup="true" Inherits="FieldContainerForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" runat="server">
protected void get(object sender, DirectEventArgs e)
{
cn.Open();
SqlCommand cmd = new SqlCommand("select phone from empdetails", cn);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
cb1.Items.Add(new Ext.Net.ListItem(dr["phone"].ToString()));
}
dr.Close();
cn.Close();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:Button ID="b1" runat="server" Text="Get" OnDirectClick="get"></ext:Button>
<ext:ComboBox ID="cb1" runat="server" Width="100" Text="Split Data"></ext:ComboBox>
</div>
</form>
</body>
</html>