Solved

unable to validate page on w3c which is using asp.net imagerotator

Posted on 2013-01-13
7
312 Views
Last Modified: 2013-01-13
Below is my web user control

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ImageRotator.ascx.cs" Inherits="ImageRotator" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <div style="margin-top:1.5em;">
                 
                    <asp:Image ID="Image1" runat="server" Height="550" Width="550" alt="" Style="float:left; margin-left:2em;" /><br />
                    <br />
                    <asp:Label ID="lblImageDescription" runat="server" /><br />
                   <div style="margin:9em; float:left; margin: 0em 5em 0em 5em;">
                   <br />
                   <div style="margin-left:175px;">
                       <asp:ImageButton ID="Btn_Previous" runat="server" ImageUrl="../images/BACK-ARROW.png" Height=30 alt="Previous" style="text-align:center;"  /> 

                         <asp:ImageButton ID="Btn_Play" runat="server" ImageUrl="../images/pause.png" Height=28 alt="Play" style="padding-left:1em;text-align:center;"  /> 


                       <asp:ImageButton ID="Btn_Next" runat="server" ImageUrl="../images/FRONT-ARROW.png" alt="Next" Height=30 style="padding-left:1em;" />

                       </div>
                   <%-- <asp:Button ID="Btn_Previous" runat="server" Text="Previous" />
                    <asp:Button ID="Btn_Next"  runat="server" Text="Next" Width="64px" />--%>
                    <%--<asp:Button ID="Btn_Play" runat="server" Text="Play" ForeColor=White /><br />--%>
                    <asp:SlideShowExtender ID="SlideShowExtender1" AutoPlay="true" ImageDescriptionLabelID="lblImageDescription"
                        Loop="true" NextButtonID="Btn_Next" PlayButtonID="Btn_Play" PlayButtonText="Play" 
                        SlideShowServicePath="~/WebService.asmx" PreviousButtonID="Btn_Previous" SlideShowServiceMethod="GetSlides"
                        StopButtonText="Stop" TargetControlID="Image1" runat="server">
                    </asp:SlideShowExtender>

                    </div>
                     </div> </div>
        </ContentTemplate>
    </asp:UpdatePanel>
   
    </form>

Open in new window



I m unable to validate the page  http://nkarch.lifeintheuktest.co/the-practice.aspx

and getting the error


"Line 47, Column 156: Bad value for attribute src on element img: Must be non-empty."
0
Comment
Question by:mmalik15
  • 3
  • 3
7 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 100 total points
ID: 38772421
So put the file name of your first image in there.  In your actual page, it will be replaced almost immediately.
0
 

Author Comment

by:mmalik15
ID: 38772463
thanks for the comment. I have tried setting up the src value and give it path of the first image but now i get a different validation error

" Line 47, Column 138: Duplicate attribute src."


http://validator.w3.org/check?uri=http%3A%2F%2Fnkarch.lifeintheuktest.co%2Fthe-practice.aspx&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38772472
I meant you should put the file name in the existing 'src' attribute, not to add another 'src' attribute.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:mmalik15
ID: 38772485
ermm i have only one image control and this is how i have specified it

  <asp:Image ID="Image1" runat="server" src="Images/SliderImages/Lama%20Island%20HK.jpg" Height="550" Width="550" alt="" Style="float:left; margin-left:2em;" />

where else is the existing src?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38772498
It shows in your "View Source" of that section so something is putting it in there.
0
 

Author Comment

by:mmalik15
ID: 38772502
yeah i have seen in the source but can't figure out from where its coming. All i have is the usercontrol( the code is present in the earlier comment) and a web service.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.IO;

/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{

    public WebService()
    {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [System.Web.Services.WebMethod]
    [System.Web.Script.Services.ScriptMethod]
    public AjaxControlToolkit.Slide[] GetSlides()
    {
        string[] imagenames = System.IO.Directory.GetFiles(Server.MapPath("~/Images/SliderImages/"));
        AjaxControlToolkit.Slide[] photos = new AjaxControlToolkit.Slide[imagenames.Length];
        for (int i = 0; i < imagenames.Length; i++)
        {
            string[] file = imagenames[i].Split('\\');
            photos[i] = new AjaxControlToolkit.Slide("Images/SliderImages/" + file[file.Length - 1], file[file.Length - 1], "");
        }
        return photos;
    }

}

Open in new window

0
 
LVL 21

Accepted Solution

by:
masterpass earned 400 total points
ID: 38772709
Can yo update this

 <asp:Image ID="Image1" runat="server" src="Images/SliderImages/Lama%20Island%20HK.jpg" Height="550" Width="550" alt="" Style="float:left; margin-left:2em;" />

to

 <asp:Image ID="Image1" runat="server" ImageUrl="Images/SliderImages/Lama%20Island%20HK.jpg" Height="550" Width="550" alt="" Style="float:left; margin-left:2em;" />

Hope this helps
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now