Click here to Skip to main content
15,915,089 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: It's been a long time and need some help... Pin
Alexander DiMauro1-Oct-10 1:07
Alexander DiMauro1-Oct-10 1:07 
GeneralRe: It's been a long time and need some help... Pin
MacRaider41-Oct-10 1:22
MacRaider41-Oct-10 1:22 
GeneralRe: It's been a long time and need some help... Pin
Not Active1-Oct-10 2:23
mentorNot Active1-Oct-10 2:23 
GeneralRe: It's been a long time and need some help... Pin
MacRaider41-Oct-10 2:39
MacRaider41-Oct-10 2:39 
GeneralRe: It's been a long time and need some help... Pin
Alexander DiMauro1-Oct-10 8:13
Alexander DiMauro1-Oct-10 8:13 
AnswerRe: It's been a long time and need some help... Pin
Ron Nicholson1-Oct-10 5:43
professionalRon Nicholson1-Oct-10 5:43 
GeneralRe: It's been a long time and need some help... Pin
MacRaider41-Oct-10 6:18
MacRaider41-Oct-10 6:18 
NewsGot something running! Pin
MacRaider45-Oct-10 3:06
MacRaider45-Oct-10 3:06 
QuestionConnecting Sql Server Pin
vijaylumar29-Sep-10 19:46
vijaylumar29-Sep-10 19:46 
AnswerRe: Connecting Sql Server Pin
SeMartens29-Sep-10 20:57
SeMartens29-Sep-10 20:57 
GeneralRe: Connecting Sql Server Pin
vijaylumar29-Sep-10 21:17
vijaylumar29-Sep-10 21:17 
GeneralRe: Connecting Sql Server Pin
SeMartens29-Sep-10 21:23
SeMartens29-Sep-10 21:23 
GeneralRe: Connecting Sql Server Pin
vijaylumar29-Sep-10 22:01
vijaylumar29-Sep-10 22:01 
GeneralRe: Connecting Sql Server Pin
SeMartens29-Sep-10 22:18
SeMartens29-Sep-10 22:18 
AnswerRe: Connecting Sql Server Pin
Gamzun2-Oct-10 1:12
Gamzun2-Oct-10 1:12 
GeneralRe: Connecting Sql Server Pin
vijaylumar2-Oct-10 1:43
vijaylumar2-Oct-10 1:43 
GeneralRe: Connecting Sql Server Pin
Gamzun3-Oct-10 10:20
Gamzun3-Oct-10 10:20 
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);
    }

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.