我正在使用此模板 http://www.egrappler.com/templatevamp-free-twitter-bootstrap-admin-template/
它是免费的并使用twitter bootstrap。 Bootstrap阻止asp.net元素。首先,我无法点击按钮,然后通过添加UseSubmitBehavior =" False"解决了这个问题。标记到按钮。
但是现在我无法将任何记录插入到mssql数据库中。文本框只返回空值。
我阅读了很多解决方案,但没有人工作。
我的Html
<div class="main-inner">
<div class="container">
<div class="row">
<div class="span12">
<div class="widget ">
<div class="widget-header">
<i class="icon-user"></i>
<h3>Cari Ekle</h3>
</div> <!-- /widget-header -->
<div class="widget-content">
<asp:Panel ID="Panel1" runat="server">
<asp:TextBox ID="txt_carikodu" placeholder="Cari Kodu" runat="server" Width="20%"></asp:TextBox> <asp:TextBox ID="txt_cariadi" placeholder="Cari Adı" runat="server" Width="50%"></asp:TextBox> <asp:TextBox ID="txt_cariyetkili" placeholder="Yetkili" runat="server" Width="25%"></asp:TextBox>
<asp:TextBox ID="txt_adres1" placeholder="Adres" runat="server" Width="99%"></asp:TextBox>
<asp:TextBox ID="txt_sabittel1" placeholder="Sabit Tel 1" runat="server" Width="18%"></asp:TextBox> <asp:TextBox ID="txt_sabittel2" placeholder="Sabit Tel 2" runat="server" Width="18%"></asp:TextBox> <asp:TextBox ID="txt_faks" placeholder="Faks" runat="server" Width="18%"></asp:TextBox> <asp:TextBox ID="txt_ceptel1" placeholder="Cep Tel 1" runat="server" Width="18%"></asp:TextBox> <asp:TextBox ID="txt_ceptel2" placeholder="Cep Tel 2" runat="server" Width="18%"></asp:TextBox>
<asp:TextBox ID="txt_il" placeholder="İl" runat="server" Width="32%"></asp:TextBox> <asp:TextBox ID="txt_ilce" placeholder="İlçe" runat="server" Width="32%"></asp:TextBox> <asp:TextBox ID="txt_ulke" placeholder="Ülke" runat="server" Width="32%"></asp:TextBox>
<asp:TextBox ID="txt_vd" placeholder="Vergi Dairesi" runat="server" Width="32%"></asp:TextBox> <asp:TextBox ID="txt_vn" placeholder="Vergi No" runat="server" Width="32%"></asp:TextBox> <br />
<asp:TextBox ID="txt_eposta" placeholder="E-posta" runat="server" Width="32%"></asp:TextBox> <asp:TextBox ID="txt_web" placeholder="Web" runat="server" Width="32%"></asp:TextBox> <br />
<asp:Button ID="btn_ekle" runat="server" Text="Kaydet" class="btn btn-default" UseSubmitBehavior="False" OnClick="btn_ekle_Click" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" UseSubmitBehavior="False" Text="Button" />
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Visible="false">
<div class="alert alert-success">
<button class="close" data-dismiss="alert" type="button">
×
</button>
<strong>Cari Eklendi!</strong> Cari bilgileri kaydedildi.
</div>
</asp:Panel>
</div> <!-- /widget-content -->
</div> <!-- /widget -->
</div> <!-- /span8 -->
</div> <!-- /row -->
</div> <!-- /container -->
</div> <!-- /main-inner -->
和C#
SqlConnection baglanti1 = new SqlConnection(ConfigurationManager.ConnectionStrings["bag2"].ConnectionString);
string ins = "Insert into cariler (carikodu,cariadi,cariyetkili,cariadres1,sabittel1,sabittel2,faks,ceptel1,ceptel2,il,ilce,ulke,eposta,web,vergidairesi,vergino) Values (@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8,@p9,@p10,@p11,@p12,@p13,@p14,@p15,@p16)";
SqlCommand komut1 = new SqlCommand(ins, baglanti1);
komut1.Parameters.AddWithValue("@p1", txt_carikodu.Text);
komut1.Parameters.AddWithValue("@p2", txt_cariadi.Text);
komut1.Parameters.AddWithValue("@p3", txt_cariyetkili.Text);
komut1.Parameters.AddWithValue("@p4", txt_adres1.Text);
komut1.Parameters.AddWithValue("@p5", txt_sabittel1.Text);
komut1.Parameters.AddWithValue("@p6", txt_sabittel2.Text);
komut1.Parameters.AddWithValue("@p7", txt_faks.Text);
komut1.Parameters.AddWithValue("@p8", txt_ceptel1.Text);
komut1.Parameters.AddWithValue("@p9", txt_ceptel2.Text);
komut1.Parameters.AddWithValue("@p10", txt_il.Text);
komut1.Parameters.AddWithValue("@p11", txt_ilce.Text);
komut1.Parameters.AddWithValue("@p12", txt_ulke.Text);
komut1.Parameters.AddWithValue("@p13", txt_eposta.Text);
komut1.Parameters.AddWithValue("@p14", txt_web.Text);
komut1.Parameters.AddWithValue("@p15", txt_vd.Text);
komut1.Parameters.AddWithValue("@p16", txt_vn.Text);
baglanti1.Open();
komut1.ExecuteNonQuery();
baglanti1.Close();
Panel1.Visible = false;
Panel2.Visible = true;