Solved

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

Posted on 2013-01-13
7
309 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 82

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 82

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 82

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

13 Experts available now in Live!

Get 1:1 Help Now