<form id="form1" runat="server"> <div> <asp:ScriptManager runat="server"></asp:ScriptManager> <asp:Button ID="addnew" OnClick="addnew_Click" runat="server" Text="Add New" CssClass="btn btn-warning" /> <asp:Panel ID="panelRegister" CssClass="modalPopup form-control" runat="server" Style="display: none;"> <div class="row" style="margin-removed 5px"> <div class="col-xs-8"> <asp:Label ID="Label1" runat="server" Font-Size="Smaller"></asp:Label> </div> <div class="col-xs-4"></div> </div> <br /> <div class="row"> <div class="col-xs-3"></div> <div class="col-xs-3"> <asp:Button ID="cancel" runat="server" CssClass="btn btn-default" Text="Ok" CausesValidation="False" /> </div> <div class="col-xs-3"></div> </div> <br /> </asp:Panel> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground" PopupControlID="panelRegister" TargetControlID="addnew"></ajaxToolkit:ModalPopupExtender> </div> </form>
protected void addnew_Click(object sender, EventArgs e) { string sqlsel = "SELECT name FROM dbo.patient nic = '568921452' "; SqlCommand com = new SqlCommand(sqlsel, DBcon.connection()); SqlDataReader dr = com.ExecuteReader(); if(dr.Read()) { Label1.Text = dr[0].ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)