BOOTSTRAP MODALPOPUP(когда я передаю значение в текстовое поле в bootstrao modal popup , всплывающее окно загружается, но текстовое поле не заполняется)
ЭТО МОЙ ПЕРЕДНИЙ КОНЕЦ
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="Category.aspx.cs" Inherits="Category" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Label ID="lblCID" runat="server" Text="" Visible="false"> Add New Category function openModal() { $('#modal-header-primary').modal('show'); } <%--Modal popup start--%> <div id="modal-header-primary" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header modal-header-primary"> × <h4 id="modal-header-primary-label" class="modal-title">Add New Category</h4> </div> <div class="modal-body"> <div class="col-md-6"> <div class="form-group"> <div class="input-icon"> <asp:TextBox ID="txtCategoryName" runat="server" class="form-control" data-toggle="tooltip"> </div> </div> </div> </div> <br> <div class="modal-footer"> Close <asp:Button ID="btnCategory" runat="server" Text="Submit" OnClick="btnCategory_Click" class="btn btn-primary"/> </div> </div> </div> </div> <%--Modal popup end--%> <%--Grid View start--%> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <triggers> <asp:AsyncPostBackTrigger ControlID="GVCategoryDetails" EventName="RowCommand" /> <contenttemplate> <div class="row"> </div> <div class="col-lg-12"> <div class="row"> <asp:Label ID="lblID" runat="server" Text="lblID" Visible="false"> <asp:Label ID="lblMsg" runat="server" Text="" ForeColor="Red" Visible="false"> <div class="panel panel-red"> <div class="panel-heading">Category Details</div> <div class="panel-body"> <asp:GridView ID="GVCategoryDetails" runat="server" CssClass="table table-hover table-bordered" PagerStyle-CssClass="pager" HeaderStyle-CssClass="header" RowStyle-CssClass="rows" AllowPaging="True" OnPageIndexChanging="GVCategoryDetails_PageIndexChanging" AutoGenerateColumns="false" OnRowDeleting="GVCategoryDetails_RowDeleting" OnRowCommand="GVCategoryDetails_RowCommand" DataKeyNames="CategoryId" PageSize="25"> <columns> <asp:TemplateField HeaderText="Sl.No."> <itemtemplate> <%#Container.DataItemIndex+1 %> <asp:BoundField HeaderText="CategoryId" DataField="CategoryId" Visible="false" ItemStyle-HorizontalAlign="Justify"> <ItemStyle HorizontalAlign="Justify"> <asp:BoundField HeaderText="Category Name" DataField="CategoryName" ItemStyle-HorizontalAlign="Justify"> <ItemStyle HorizontalAlign="Justify"> <asp:TemplateField HeaderText="Manage"> <itemtemplate> <asp:ImageButton ID="ImgView" runat="server" CausesValidation="False" CommandName="ViewPopup" ToolTip="Click here to view " ImageAlign="Middle" ImageUrl="~//images/view.png" /> <asp:ImageButton ID="ImgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip="Click here to edit " ImageAlign="Middle" ImageUrl="~/images/edit.png" /> <asp:ImageButton ID="ImgDelete" runat="server" CausesValidation="False" CommandName="Delete" ToolTip="Click here to delete" ImageAlign="Middle" ImageUrl="~/images/delet.png" /> </div> </div> </div> </div> <%--GridView end--%>
КОД C#
protected void GVCategoryDetails_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "ViewPopup") { ImageButton ImgView = (ImageButton)e.CommandSource; GridViewRow row = (GridViewRow)ImgView.Parent.Parent; int CategoryId = Convert.ToInt32(GVCategoryDetails.DataKeys[row.RowIndex].Value); DataTable dtCategory= _objMainBL.GetCategoryDetailsbyId(CategoryId); if (dtCategory!= null && dtCategory.Rows.Count > 0) { txtCategoryName.Text = dtCategory.Rows[0]["CategoryName"].ToString(); lblCID.Text = dtCategory.Rows[0]["CategoryId"].ToString(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true); } } }
Что я уже пробовал:
Мне нужно отобразить значение в текстовом поле