473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

SkinID not working for images

WT
Hello,

In my code I set the SkindId for image objects before the Page_Load event
for the page.
The image is created then added to the control list of an HtmlAnchor object
already present in the ascx page.
I checked with traces that the skinid is correctlyset, theApp_Theme folder
contains the correct Theme whichcontains the Skin, and this last file
contain correct path to the gif image placed in a folder under the
currenttheme.
But no image displayed, looking to the generated source I find <img src=""
......?
Is thisa known problem ?
Any help welcome.

CS
Feb 5 '07 #1
2 2119
Howdy,

I think you haven't set Theme attribute of the page. I copied working
example for you:
-- begin aspx code --
<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true"
CodeFile="HelloWorld.aspx.cs" Inherits="HelloWorld"
Theme="Red" %>

<html>
<head runat="server">
<title></title>
</head>
<body>
<form id="Form1" runat="server">

<script runat="server">
protected void Page_Init(object source, EventArgs e)
{
Image image = new Image();

image.ID = "img1";
image.SkinID = "red";

myAnchor.Controls.Add(image);

}
</script>

<a href="#" runat="server" id="myAnchor"></a>

</form>
</body>
</html>
-- end aspx code --

-- begin skin file --

<asp:Image runat="server" ImageUrl="~/1.jpg" SkinID="red"/>

-- end skin file --

Skin file is put under App_Themes\Red\RedSkin.skin folder

--
Milosz
"WT" wrote:
Hello,

In my code I set the SkindId for image objects before the Page_Load event
for the page.
The image is created then added to the control list of an HtmlAnchor object
already present in the ascx page.
I checked with traces that the skinid is correctlyset, theApp_Theme folder
contains the correct Theme whichcontains the Skin, and this last file
contain correct path to the gif image placed in a folder under the
currenttheme.
But no image displayed, looking to the generated source I find <img src=""
......?
Is thisa known problem ?
Any help welcome.

CS
Feb 5 '07 #2
Thanks for Milosz's input.

Hi CS,

As Milosz suggested, you can first check the page's Theme setting to see
whether the Theme has been applied to the page(in the page directive). Or
if you want to programmatically apply Theme for your web page, you can use
Page.PreInit event to do it. e.g.

void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "themename";
}

Here is good article which has described creating and apply Theme for
ASP.NET 2.0 page

#Creating Web Application Themes in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/lib...#themes_topic8

Please feel free to post here if you have any further questions on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Feb 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: stephen.mcallister | last post by:
I am toying around with Personalization in asp.net 2.0 and would like my users to be able to choose a SkinID at runtime. I have a theme with a default gridview skin and a custom skin. There are 2...
0
by: shapper | last post by:
Hello, How do I set the SkinId of a Label? I have this but I got an error: Private Sub lName_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles lName.Init ' Define lName...
0
by: V | last post by:
Hello! I made custom control with tables and labels in it. In my page I have several of these controls. Each one should have different color of tables etc. I have different SkinIDs for that....
1
by: V | last post by:
Hello! I made custom control with tables and labels in it. In my page I have several of these controls. Each one should have different color of tables etc. I have different SkinIDs for that....
14
by: WT | last post by:
Hello, I have a usercontrol loaded in a page with a theme. This usercontrol contains columns template with hyperlinks, with skinID. The columns are not displayed, seems thta there is some...
0
jenka1980
by: jenka1980 | last post by:
What is the best way to correspond SkinId in GridView to the data which bound to it ? I have dataset which I bound to a GridView. Dataset contains a table where part of rows are title rows....
0
by: Joey | last post by:
In my app I have many master/content pages. On each content page I set controls in the Page_PreInit event. This was working fine until I added AJAX and an UpdatePanel to one of my content pages....
3
by: PrabodhanP | last post by:
I have CSS based mouseover scrolling for divContent embeded in my webpage.It works fine in IE,but not working in mozilla-FF. It is located at the location.....
11
by: neovantage | last post by:
Hey all, I have recently started work on div based websites as suggested the great man acoder of this community advise me to learn divs. I made a page using div. In my page i want that content...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.