Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2006, 02:12 AM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hi Imar,

I just found most important thing. This information will definitely help you to give some solid solution.

While trying to find the solution, I tried to set ABSOLUTE PHYSICAL PATH of the image to ImageUrl property, and to my surprise it displays the image as expected in DESIGN VIEW. Now, I understood that the problem is of resolving ImageUrl which is relative. e.g. "~/Images/DDCL/ArrowDownOff.gif".

Now, the problem to resolve relative url in DESIGN MODE is like this. All the url resolving methods like ResolveClientUrl, ResolveUrl or MapPath can resolve the url. But they belong to objects of Page, Application which are null at DESIGN MODE, and I could not find any other way to resolve the relative url to absolute one. Because these objects are live (or not null) at run time, I can resolve the url at run time but not at Design Time.

So, finally If you do know any way to resolve url at DESIGN TIME, my problem will be solved. :)

Thanks in advance,

Best Regards,
Hitul Patel


Hitul J. Patel
Software Engineer
 
Old November 30th, 2006, 05:03 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can call ResolveUrl on the base of the class, like this:

base.ResolveUrl(this.ImageUrl);

Does that help?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old December 1st, 2006, 12:35 AM
Registered User
 
Join Date: Aug 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hi Imar,

Sorry dear but it throws NullReferenceException. Well, Good news is that I found the solution. Visit the following link. It explains how to get physical path of web.config file, and I used the same concept to get physical path of custom image in my application. Cheers !!!

http://flimflan.com/blog/AccessingWe...meInNET20.aspx

By the way, Thanks for your help.

Regards,
Hitul Patel


Hitul J. Patel
Software Engineer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
Web Service, Custom Control, Custom Return Type robzyc ASP.NET 2.0 Basics 6 June 10th, 2008 08:03 AM
custom control inside custom control issues StevesonD ASP.NET 2.0 Professional 1 February 19th, 2008 06:54 PM
Help! Custom Server Control using User Control diehard ASP.NET 1.0 and 1.1 Professional 2 January 4th, 2006 12:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.