Solved

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

Posted on 2013-01-13
7
313 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

776 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