Solved

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

Posted on 2013-01-13
7
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

632 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