本文介绍了ASP.net中的广告轮播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我第一次在asp.net中使用ad rotator,并且遇到了问题,它可以成功运行,但是图像和替代文本不会显示在网络上.我该怎么解决这是我的代码:
Hi,
I am using ad rotator first time in asp.net and face the problem It runs Successfully but image and alternate text is not displayed on the web. How could i solve it Here is my code:
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<Imageurl>
~/Images/images.jpg
</Imageurl>
<Navigateurl>
https://www.google.com/
</Navigateurl>
<Alternatetext>
GOOGLE
</Alternatetext>
<Keyword>Search</Keyword>
<Impression>1</Impression>
</Ad>
<Ad>
<Navigateurl>
https://www.google.com/
</Navigateurl>
<Alternatetext>
Google1
</Alternatetext>
<Keyword>Search</Keyword>
<Impression>2</Impression>
</Ad>
</Advertisements>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default10.aspx.cs" Inherits="Default10" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="100%" align="center">
<tr>
<td>
Examples of Ad Rotator
</td>
</tr>
<tr>
<td>
<asp:AdRotator ID="Adrotator1" runat="server" Target="_blank" BorderColor="AliceBlue" BorderStyle="Dotted" BorderWidth="2pt" AdvertisementFile="Adrotator.xml" Height="500px" Width="900px" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
推荐答案
<ad>
标记必须为
<Ad>
像这样尝试:
Try like this:
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<Imageurl>
"Images/images.jpg"
</Imageurl>
<Navigateurl>
https://www.google.com/
</Navigateurl>
<Alternatetext>
GOOGLE
</Alternatetext>
<Keyword>Search</keyword>
<Impression>1</impression>
</Ad>
<Ad>
<Navigateurl>
https://www.google.com/
</Navigateurl>
<Alternatetext>
Google1
</Alternatetext>
<Keyword>Search</keyword>
<Impression>2</impression>
</Ad>
</Advertisements>
这篇关于ASP.net中的广告轮播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!