How to assign a web.Config value to imageurl in ImageButton?
-
Hi there, I've created a webpage which contains Imagebutton. This image path will be changable, so i want to put in web.Config file. Now how can i assign imageurl? Am using the code as:
ImageUrl='<%= ConfigurationManager.AppSettings["ImagePath"]%>navigation_02.jpg'
But image is not displaying and i got source code generated for this aspx page is:<input type="image" name="ctl00$ImgBtnAppt" id="ctl00_ImgBtnAppt" src="<%=%20ConfigurationManager.AppSettings["ImagePath"]%>navigation_02.jpg" style="border-width:0px;" />
Please help..!! How could i asign?Regards n Thks Sam.M
-
Hi there, I've created a webpage which contains Imagebutton. This image path will be changable, so i want to put in web.Config file. Now how can i assign imageurl? Am using the code as:
ImageUrl='<%= ConfigurationManager.AppSettings["ImagePath"]%>navigation_02.jpg'
But image is not displaying and i got source code generated for this aspx page is:<input type="image" name="ctl00$ImgBtnAppt" id="ctl00_ImgBtnAppt" src="<%=%20ConfigurationManager.AppSettings["ImagePath"]%>navigation_02.jpg" style="border-width:0px;" />
Please help..!! How could i asign?Regards n Thks Sam.M
you could try an img tag, or set the value in your code behind.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
you could try an img tag, or set the value in your code behind.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I dont want to assign this in code behind. I want only in aspx page. Is there any other way to set the imageurl?
Regards n Thks Sam.M
Not really, do you need to use the asp control and not the img tag ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Not really, do you need to use the asp control and not the img tag ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Sorry, I want only image button. Bcoz i'm using around 50 pages. I can't change all now..!! Any other solution is there? Please help..!!
Regards n Thks Sam.M
-
Sorry, I want only image button. Bcoz i'm using around 50 pages. I can't change all now..!! Any other solution is there? Please help..!!
Regards n Thks Sam.M
Quite plainly, if <%= is not parsed in the image tag, then I don't see what other solution you could possibly hope for, in the ASPX. I spent some time testing, and sure enough, for an Image server control, the values need to be set in the code behind, for an img tag, the inline method works fine.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Do you mean you want the same image to be applied to the image button throughout your project? If so just use a common_methods class and declare it in there
The problem is that the Image tag does not run the inline code tags.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Do you mean you want the same image to be applied to the image button throughout your project? If so just use a common_methods class and declare it in there