so i want if images are tooo small then they should be display in original size
or if the images are tooo large then i want to fix the maximum size to adjust their height and width .. how to do?
Thank you!
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 17, 2010, 9:20 PM EDT
you can use an handler for this. i have created the handler in my website to deal with different size of images.
here is the example code how to use it in your aspx code or in code behind c#
aspx:
Codebehind:
Please mark as answer if it helps.
Dipa AhujaRank #1,168 · 1.5K reputationPosted Mar 18, 2010, 8:28 AM EDT
my images are in "albumImages" folder i wrote this way..
ImageUrl='<%# "~/Mygang/Controls/ThumbJpeg.ashx?Vfilepath=~/Mygang/albumImages/" + (Eval("Image","albumImages/{0}")+"&Height=100&Widthe=100") %>'
bt images are not shown..
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 20, 2010, 12:23 AM EDT
here is your error:
Error: ImageUrl='<%# "~/Mygang/Controls/ThumbJpeg.ashx?Vfilepath=~/Mygang/albumImages/" + (Eval("Image","albumImages/{0}")+"&Height=100&Widthe=100") %>'
Corrected: ImageUrl='<%# "~/Mygang/Controls/ThumbJpeg.ashx?VFilePath=~/Mygang/albumImages/" + (Eval("Image")+"&Height=100&Width=100") %>'
no need to give path "albumImages/{0}" in Eval(); just fetch the image name ... and check the spells too.. cause these are parameters are used by Handler file..Case Sensitive
hope you got problem solved.