i have a .aspx page with a FileUpload control. i want to achieve upload images to the website. but before that i need check image height and width with these condition:
-
if image height >768 or width >1024 then show a popup message for continue…. (yes/No)
-
if image height <768 or width <1024 then show a popup message for continue…. (yes/No)
So, far i have done image upload code , but how to achieve this ? any kind of help/ suggestion will appreciated.
<asp:RegularExpressionValidator ID="revUploaderMainPopup" runat="server" ControlToValidate="UploaderMainPopup" ErrorMessage="*" ValidationGroup="MainPopUploadvlg" ToolTip="Only .jpg, .bmp, .png are valid." ForeColor="Red" Display="Dynamic" ValidationExpression="(.*\.([Jj][Pp][Gg])|.*\.([Bb][Mm][Pp])|.*\.([pP][nN][gG])$)"> </asp:RegularExpressionValidator>
i done it in the following way:
i have taken two variable(image and string) a div with popup, having tow button.
after validating image i am setting
display:blockto the div from server.on the click of ye button i am saving it.
in the
.csfie: