Greeting
I designed a page containe detailsview and grideview, I play with show mood, a detailsview in (modal popup) conatier, when a user clich on (Add product) a modal popup woking correctly.
Here a modal popup code for details view control in my work
- <script type="text/javascript">
- function ShowPopup(title, body) {
- $("#PopupCat .modal-title").html(title);
- $("#PopupCat .modal-body").html(body);
- $("#PopupCat").modal("show");
- }
- <div class="modal fade" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <table style="width:100%">
- <tr>
- <td style="text-align:left">
- <h4 class="modal-title" style="text-decoration:wavy; color:#006699">Add Category</h4>
- </td>
- <td style="text-align:right">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:red">×</button>
- </td>
- </tr>
- </table>
-
- </div>
- <div class="modal-body" style="padding-left: 0px;padding-right:0px">
- <div class="col-lg-12" style="padding-left: 10px;padding-right:0px">
-
- sp:DetailsView ID="DV_ADDCAT" runat="server" AutoGenerateRows="False" DefaultMode="Insert" OnItemCommand="DV_ADDCAT_ItemCommand" OnModeChanging="DV_ADDCAT_ModeChanging">
- <Fields>
- <asp:TemplateField HeaderText="Cat.Code">
- <EditItemTemplate>
- <asp:TextBox ID="Tb_CatCodeId" runat="server" Text=""></asp:TextBox>
- </EditItemTemplate>
- </asp:TemplateField>
- <asp:TemplateField HeaderText="Name" SortExpression="Name">
- <EditItemTemplate>
-
- </EditItemTemplate>
- <InsertItemTemplate>
- <asp:TextBox ID="TB_CatName_I" runat="server" Text="" ></asp:TextBox>
- </InsertItemTemplate>
- <ItemTemplate>
-
- </ItemTemplate>
- </asp:TemplateField>
- <asp:TemplateField HeaderText="Description" SortExpression="Description">
- <EditItemTemplate>
-
- </EditItemTemplate>
- <InsertItemTemplate>
- <asp:TextBox ID="TB_CDESC_I" runat="server" Text="" TextMode="MultiLine"></asp:TextBox>
- </InsertItemTemplate>
- <ItemTemplate>
-
- </ItemTemplate>
- </asp:TemplateField>
-
- <asp:TemplateField>
- <InsertItemTemplate>
- <div style="text-align:center">
- <asp:Button ID="Button1" runat="server" Text="Add" CommandName="AddNew" CssClass="btn btn-outline-success" />
- <asp:Button ID="Button2" runat="server" Text="Cancel" CommandName="Cancel" CssClass="btn btn-outline-dark"/>
- </div>
- </InsertItemTemplate>
- </asp:TemplateField>
- </Fields>
- </asp:DetailsView>
- </div>
- </div>
- </div>
- </div>
- </div>
In a same way I play on delete row from grideview message, (when a user delete record) a modal popup show message like this photo which work correctly in another page
But this method not working correctly in a page which i work on it which conatin another modal popup which conatine (deatils view control)
here a code for delete row in Grideview which should show a modal popup message, notice a delete row working correctly no problem with that, my problem a popup message not working correctly
- <script type="text/javascript">
- /for detailsview
- function ShowPopup(title, body) {
- $("#PopupCat .modal-title").html(title);
- $("#PopupCat .modal-body").html(body);
- $("#PopupCat").modal("show");
- }
-
- /for gridview
- function ShowPopupDcat(title, body) {
- $("#PopupCat .modal-title1").html(title);
- $("#PopupCat .modal-body1").html(body);
- $("#PopupCat").modal("show");
- }
- lt;/script>
event callback a modal popup in c# (Gridview RowCommand)
- if (e.CommandName == "Delete")
- {
- Label Lb_Ccode = (Label)GV_Category.Rows[rowidcat].FindControl("Lb_CoId_I");
- Label Lb_Cname = (Label)GV_Category.Rows[rowidcat].FindControl("Lb_CatName");
- Label Lb_imgCnm = (Label)GV_Category.Rows[rowidcat].FindControl("Lb_PhoName_I");
- DelFromCatFolder(Lb_imgCnm.Text);
- lbdcatinfo.Text = "Category Row" + " " + "[[" + Lb_Ccode.Text + "]]" + " " + "[[" + Lb_Cname.Text + "]]" + "deleted from Data Base";
- imgdel.ImageUrl = "~/images/Forbidden_area/row_del.png";
- ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopupDcat();", true);
- }
Soooooooooooooo what's wrong in my work? Is this method wrong completly or I can't able to call two modal pop up in differnt ways.
many thanks