Click here to Skip to main content
15,893,814 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionInheritance Pin
future383929-Sep-10 4:09
future383929-Sep-10 4:09 
AnswerRe: Inheritance [Longish Post] Pin
Keith Barrow29-Sep-10 21:48
professionalKeith Barrow29-Sep-10 21:48 
GeneralRe: Inheritance [Longish Post] Pin
future383930-Sep-10 4:19
future383930-Sep-10 4:19 
GeneralRe: Inheritance [Longish Post] Pin
Keith Barrow30-Sep-10 9:39
professionalKeith Barrow30-Sep-10 9:39 
QuestionAsp.net Cross Page Post Back issue Pin
AndieDu28-Sep-10 20:44
AndieDu28-Sep-10 20:44 
AnswerRe: Asp.net Cross Page Post Back issue Pin
Not Active29-Sep-10 2:43
mentorNot Active29-Sep-10 2:43 
GeneralRe: Asp.net Cross Page Post Back issue Pin
AndieDu29-Sep-10 13:36
AndieDu29-Sep-10 13:36 
QuestionWhich approach is faster ? calculate Image size in Server or Client ? Pin
Nadia Monalisa28-Sep-10 19:40
Nadia Monalisa28-Sep-10 19:40 
Hi,

I learned that, if I use image height and image width attribute in html than, the page loads faster because the internet explorer wont need to calculate the image dimension. So, in my ASP.NET code behind file, I calculate the image from server and render html code with appropriate height and width attribute for image. Now, I am wondering, if I dont calculate the image height and image width in server and let the browser calculate it on the fly when rendering, will that be more efficient ?

Here is my code that I used to get Image Size in Server:

public static Size GetImageDimension(string absolutePath)
    {
        byte[] imageData = File.ReadAllBytes(absolutePath);

        var fullSizeImageHeight = -1;
        var fullSizeImageWidth = -1;
        MemoryStream origStream = null;
        System.Drawing.Image fullSizeImg;
        try
        {
            origStream = new MemoryStream(imageData);
            fullSizeImg = System.Drawing.Image.FromStream(origStream);
            fullSizeImageHeight = fullSizeImg.Height;
            fullSizeImageWidth = fullSizeImg.Width;
        }
        catch
        {
        }
        finally
        {
            if (origStream != null)
                origStream.Dispose();
        }

        return new Size(fullSizeImageWidth, fullSizeImageHeight);
    }

AnswerRe: Which approach is faster ? calculate Image size in Server or Client ? Pin
vaghelabhavesh29-Sep-10 18:08
vaghelabhavesh29-Sep-10 18:08 
GeneralRe: Which approach is faster ? calculate Image size in Server or Client ? Pin
Nadia Monalisa29-Sep-10 19:05
Nadia Monalisa29-Sep-10 19:05 
QuestionAsynchronous webmethods Pin
david vermeulen28-Sep-10 19:19
david vermeulen28-Sep-10 19:19 
AnswerRe: Asynchronous webmethods Pin
Not Active29-Sep-10 2:51
mentorNot Active29-Sep-10 2:51 
AnswerRe: Asynchronous webmethods Pin
NeverHeardOfMe29-Sep-10 3:54
NeverHeardOfMe29-Sep-10 3:54 
QuestionPost via email Pin
Jassim Rahma28-Sep-10 12:35
Jassim Rahma28-Sep-10 12:35 
QuestionNavigationURL question Pin
Jassim Rahma28-Sep-10 12:26
Jassim Rahma28-Sep-10 12:26 
AnswerRe: NavigationURL question Pin
Not Active28-Sep-10 13:49
mentorNot Active28-Sep-10 13:49 
QuestionExpires question Pin
Jassim Rahma28-Sep-10 10:46
Jassim Rahma28-Sep-10 10:46 
AnswerRe: Expires question Pin
thatraja28-Nov-10 1:24
professionalthatraja28-Nov-10 1:24 
Questionabout configuration file Pin
Dhyanga28-Sep-10 5:52
Dhyanga28-Sep-10 5:52 
AnswerRe: about configuration file Pin
JHizzle28-Sep-10 6:04
JHizzle28-Sep-10 6:04 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 6:08
Dhyanga28-Sep-10 6:08 
GeneralRe: about configuration file Pin
Not Active28-Sep-10 6:19
mentorNot Active28-Sep-10 6:19 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 7:29
Dhyanga28-Sep-10 7:29 
GeneralRe: about configuration file Pin
Not Active28-Sep-10 7:57
mentorNot Active28-Sep-10 7:57 
GeneralRe: about configuration file Pin
Dhyanga28-Sep-10 8:02
Dhyanga28-Sep-10 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.