User-1052995518 posted
hii there,
I'm new to microsoft mobile internet toolkit ...and i'm trying to bind selectionlist that's inside devicespecific control
i really need it ot's my graduation project [:'(]
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="supportsJavaScript">
<ContentTemplate>
<asp:DropDownList id="selLstLines" runat="server" OnSelectedIndexChanged="btnSearchBuses_Click" AutoPostBack="True">
<asp:ListItem Value="a">1</asp:ListItem>
<asp:ListItem Value="b">2</asp:ListItem>
<asp:ListItem Value="c">3</asp:ListItem>
</asp:DropDownList>
</ContentTemplate>
</Choice>
<Choice>
<ContentTemplate>
<mobile:SelectionList id="SelectionList1" runat="server" OnSelectedIndexChanged="btnSearchBuses_Click">
<Item Value="a" Text="1"/>
<Item Value="a" Text="2"/>
<Item Value="a" Text="3"/>
</mobile:SelectionList>
<mobile:Command ID="Command1" runat="server" text="Submit"/>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
here's the c# code before using devicespecific, what's the modifications should be done ?
public void btnSearchBuses_Click(object sender, EventArgs e)
{
con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["MobileStudentPortalConnectionString"].ConnectionString;
con.Open();
cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "Select Line From Buses";
da.SelectCommand = cmd;
da.Fill(ds);
selLstLines.DataSource = ds;
selLstLines.DataTextField = "Line";
selLstLines.DataBind();
con.Close();
}