Using Resources in Asp.Net 2.0. Problem.
-
Hello, I am trying to use my resources, in an Asp.Net 2.0 web site, but I am having a few problems. 1) Using with an Image I have an ASP:Image (ID=MyImage) in my aspx code. In my aspx.vb code I placed the following code: MyImage = Resources.Global.MyImage I get the error: Value of type 'System.Drawing.Bitmap' cannot be converted to 'System.Web.UI.WebControls.Image'. 2) Retrieving its URL Very often I use commercial control where I need to define an Image URL. Here is an example: something.Image.URL = "assets/images/MyImage.jpg" What I need to do is get the URL of my image: something.Image.URL = [URL of resource MyImage] Could someone explain how to solve these 2 problems? I have been looking around but I was not able to find the solution. Thanks, Miguel
-
Hello, I am trying to use my resources, in an Asp.Net 2.0 web site, but I am having a few problems. 1) Using with an Image I have an ASP:Image (ID=MyImage) in my aspx code. In my aspx.vb code I placed the following code: MyImage = Resources.Global.MyImage I get the error: Value of type 'System.Drawing.Bitmap' cannot be converted to 'System.Web.UI.WebControls.Image'. 2) Retrieving its URL Very often I use commercial control where I need to define an Image URL. Here is an example: something.Image.URL = "assets/images/MyImage.jpg" What I need to do is get the URL of my image: something.Image.URL = [URL of resource MyImage] Could someone explain how to solve these 2 problems? I have been looking around but I was not able to find the solution. Thanks, Miguel
i am no geek on resources but for first problem; make an aspx page that reads the given parameter matched resource . some page like readresource.aspx?param=Picture1 ... it will be a page like database blob picture to image page. but you wont use db but the resource. maybe this solves your both problems... for such a page sample search codeproject with "database image" or "resource image" with only asp.net selected on detail search Mikail Çetinkaya . The C# DEveloper