Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9218177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:48:08+00:00 2026-06-18T02:48:08+00:00

i have a .aspx page with a FileUpload control. i want to achieve upload

  • 0

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> 
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:48:09+00:00Added an answer on June 18, 2026 at 2:48 am

    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:block to the div from server.
    on the click of ye button i am saving it.

     <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>
    

    in the .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;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Send.aspx page that has an uploadify control on it. Upload.ashx handles
I have aspx page that have TextBox control for User Arabic Name I want
I have an aspx page with multiple FileUpload controls and one Upload button. In
I have a aspx page that alows a user to upload an image for
I have aspx page with a user control. I want to implement caching for
I have one aspx page and two controls one FileUpload control and Image control.
I have Created a Asp:FileUpload control in aspx page, I try to access the
I have an ASPX page and on this page I have a control that
I have a aspx page that has a UpdatePanel and a asp timer. the
I have a .aspx page that loads three separate .ascx controls to represent adding,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.