Hyperlink Properties
-
generally url is something like ~/App_Data/.... but in imageurl r u getting like that path ?
-
I have a hyperlink on my page and i set the properties as follows hlnkLogo.NavigateUrl = (string)Session["ImageUrl"]; hlnkLogo.ImageUrl = (string)Session["ImageUrl"]; hlnkLogo.Text = (string)Session["ImageUrl"]; My problem is i cant get the imageUrl property and the the Text property to work together. If i use the ImageUrl property the text property wont work, it will only display text once i remove the imageurl propery, does anyone know how to solve this. Thank you.
omlac wrote:
If i use the ImageUrl property the text property wont work, it will only display text once i remove the imageurl propery
That is by design. From the documentation: "The HyperLink control can be displayed as text or an image. Use the ImageUrl property to specify an image to display for the HyperLink control. Note: If both the Text and ImageUrl properties are set, the ImageUrl property takes precedence. If the image is unavailable, the text in the Text property is displayed. In browsers that support ToolTip functionality, the Text property also becomes the ToolTip." What is it that you are trying to accomplish?
Despite everything, the person most likely to be fooling you next is yourself.
-
I have a hyperlink on my page and i set the properties as follows hlnkLogo.NavigateUrl = (string)Session["ImageUrl"]; hlnkLogo.ImageUrl = (string)Session["ImageUrl"]; hlnkLogo.Text = (string)Session["ImageUrl"]; My problem is i cant get the imageUrl property and the the Text property to work together. If i use the ImageUrl property the text property wont work, it will only display text once i remove the imageurl propery, does anyone know how to solve this. Thank you.
-
AFAIK both these property will not work together. If you set both the property then imageURL will take the precedence and in case if image is not available then the text will be shown.
Apurva Kaushal
-
omlac wrote:
If i use the ImageUrl property the text property wont work, it will only display text once i remove the imageurl propery
That is by design. From the documentation: "The HyperLink control can be displayed as text or an image. Use the ImageUrl property to specify an image to display for the HyperLink control. Note: If both the Text and ImageUrl properties are set, the ImageUrl property takes precedence. If the image is unavailable, the text in the Text property is displayed. In browsers that support ToolTip functionality, the Text property also becomes the ToolTip." What is it that you are trying to accomplish?
Despite everything, the person most likely to be fooling you next is yourself.
-
Thank you very much. Let me use the tooltip, but would u know of a control that handles both simultaenously, i have a web app where both are working unfotunately i cant send it here on the forum coz its not on the internet. thanks
-
Thank you I have a web application where both of them are working together, would u know which control it is, ie would you know a control that handles both. Thanx
-
You say that you want both properties to work, but you haven't explained how you would want it to work. What would something like that look like?
Despite everything, the person most likely to be fooling you next is yourself.
-
May be some custom control. Or if you can give some more detail like of its behaviour then may be we can be able to make a guess. :)
Apurva Kaushal
-
Thank you for your help, i will try to add an image button next to the hyperlink. If you have a better idea your help is appreciated Regards