Witam,
Mam następujący problem. Gdy naciskam button dodaj pojawia mi się dialog i zaraz znika. Chce tak zrobić, aby ten dialog był wyświetlany dopóki użytkownik go nie zamknie.
<%@ Page Title="" Language="C#" MasterPageFile="~/Glowna.Master" AutoEventWireup="true" CodeBehind="kategoirie.aspx.cs" Inherits="WebApplication1.WebForm6" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css ">
<script type="text/javascript" src="https://code.jquery.com/jquery.js "></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.10.4/jquery-ui.js "></script>
<script type="text/javascript">
$(document).ready(function ()
{
$("#<%=Dodaj.ClientID%>").click(function ()
{
$("#dodaj_kategorie").dialog(
{
resizable: false,
width: '40%',
title: "Dodaj kategorie"
});
});
});
function showimagepreview(input) {
if (input.files && input.files[0]) {
var filerdr = new FileReader();
filerdr.onload = function (e) {
$('#<%=Image1.ClientID%>').attr('src', e.target.result);
}
filerdr.readAsDataURL(input.files[0]);
}
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Button ID="Dodaj" class="btn btn-default" runat="server" style="margin-left:80%;" Text="Dodaj" />
<br />
<div id="dodaj_kategorie" style="display: none;">
<div class="wprowadzTytul">
<asp:Panel ID="Panel1" runat="server" style="width:100%;display: table-cell;"><br /><br />
<div class="wprowadzTytul"style="margin-left: 5%;">
Wprowadź nazwę kategorii:
</div>
<div class="TextBoxtytul" style="margin-left: 5%; width:100%">
<asp:TextBox ID="TextBoxTytul" CssClass="form-control" runat="server" onchange="nameTake(this)"></asp:TextBox>
</div>
<div class="Validacja" style="width: 90%; text-align:left">
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Wprowadz nazwe kategorii" ControlToValidate="TextBoxTytul" Display="Dynamic" Font-Size="10px" ForeColor="Red" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
</div>
<asp:Panel ID="Panel2" runat="server" style="width:30%; margin-left: 10%; display: inline;">
Dodaj ikone:
<div style="width:90%; display: flex; margin:auto;" >
<asp:Label ID="LabelZdjecie1" runat="server" Width="102" BorderStyle="Solid" style="text-align:center; margin-left:10%;">
<asp:Image ID="Image1" runat="server" Width="100%"/>
</asp:Label>
<div class="wczytywanie" style="margin-left:1%;">
<asp:FileUpload ID="FileUploadImage1" Width="80%" Height="20px" runat="server" Font-Size="10px" onchange="showimagepreview(this)" />
</div>
<br /><br />
</div>
</asp:Panel>
<br />
<div id="guzik_zaloguj">
<asp:Button ID="Button1" runat="server" type="button" class="btn btn-default" Text="Dodaj" OnClick="Button1_Click"/>
</div>
</asp:Panel>
</div>
<br />
</div>
</asp:Content>