我想使用数据库中的复选框弹出gridview,并根据Checkbox选择选择行
<asp:GridView ID="GridView3" runat="server" BorderWidth="1px" Width="93%" style="margin:7px 0px 8px 4px;" BorderStyle="Solid" RowStyle-BorderWidth="1px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="appschk" runat="server" />
<asp:HiddenField ID="hdnId" runat="server" Value='<%#Eval("Campaignid")+","+Eval("CostType")+","+Eval("Country")+","+Eval("ChannelType")+"|"%>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
-----Jquery----
$(document).ready(function () {
$('#btncampin').click(function () {
debugger;
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Premium.aspx/appscampaign",
data: "{}",
dataType: "json",
async: true,
cache: false,
success: function (data) {
//alert(data);
for (var i = 0; i < data.d.length; i++) {
$("#GridView3").append("<tr><td>" + data.d[i].campaignid + "</td><td>" + data.d[i].costtype + "</td><td>" + data.d[i].country + "</td><td>" + data.d[i].channeltype + "</td><td>");
}
},
error: function (result) {
alert("Error");
}
});
});
});
------web method----
[System.Web.Services.WebMethod]
public static Appsrecords[] appscampaign()
{
List<Appsrecords> customers = new List<Appsrecords>();
string query = string.Format("select top 100 Campaignid,CostType,Country,ChannelType from tracklog where Appid<>'' order by InsDateTime desc");
using (SqlConnection con =
new SqlConnection("server=203.115.195.52;User Id=appl;password=mcom007;database=mcom_track"))
{
using (SqlCommand cmd = new SqlCommand(query, con))
{
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Appsrecords customer = new Appsrecords();
customer.campaignid = Guid.Parse(reader["Campaignid"].ToString());
//customer.adname = reader.GetString(1);
customer.costtype = reader.GetString(1);
customer.country = reader.GetString(2);
customer.channeltype = reader.GetString(3);
customers.Add(customer);
}
}
}
但是在附加数据库之后,只显示数据行而没有复选框..请帮助我..