Solved

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

Posted on 2013-01-13
7
314 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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.…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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