私は次の方法でそれを行いました:私は2つの変数(画像と文字列)をポップアップ付きのdivに取り、牽引ボタンを持っています。画像を検証した後display:block
、サーバーからdivに設定しています。
あなたがたボタンをクリックするだけで私はそれを保存しています。
<div id="dvPopup" class="popup" runat="server" style="display: none">
<asp:Panel ID="pnlpopup" runat="server" Style="display: block; position: absolute; width:400px;
margin: auto" CssClass="modalConfirmation">
<div style="width: 400px; height: 30px;" class="MessageHeaderError">
<div class="modalHeader">
Confirmation
</div>
</div>
<br />
<div style="color: Black">
<span runat="server" id="spnMessge" style="font-weight:bold">Picture is smaller than 1024 x 768 and will be stretched.</span>
</div>
<div class="small">
</div>
<div>
<div style="display: table-cell; height: 40px; padding-left: 80px; vertical-align: middle;
width: 80px;">
<asp:ImageButton ID="btnYes" ImageUrl="~/images/correct.png" runat="server" AlternateText="YES"
ToolTip="Yes" OnClick="btnYes_Click" />
</div>
<div style="display: table-cell; height: 40px; vertical-align: middle;">
<asp:ImageButton ID="btnNo" ImageUrl="~/images/delete.png" runat="server" AlternateText="NO"
ToolTip="No" Style="margin-left: 100px;" OnClick="btnNo_Click" />
</div>
.cs
FIE
で:
private bool ValidateImageSize(System.Drawing.Image imgPopup, string strSource)
{
//Messure height & width and show popup;
if ((strSource == "MainPopup") && (imgPopup.Height > 768 || imgPopup.Width > 1024))
{
return true;
}
else if (strSource == "SmallPopup" && imgPopup.Height > 300 || imgPopup.Width > 400)
{
return true;
}
return false;
}