62,074
社区成员
发帖
与我相关
我的任务
分享
<head id="Head1" runat="server">
<title>豆瓣酱网</title>
<style type="text/css">
.geren{ background-image :url('image/geren.jpg')}
.body {height :480px; width :1219px; background-image :url('image/201.jpg');
color: #3366CC;
}
.button
{
border-style: none; /*去掉边框*/
border-width: medium; /*图片宽带*/
background: url('image/dian.gif') no-repeat left top; /*图片路径*/
height:62px; /*图片高度*/
}
</style>
</head>
<body>
<form id="form2" runat="server">
<div id="Div1" class="geren" runat="server" style="height: 100px">
<asp:ImageButton ID="ImageButton1" runat="server" Height="92px" Width="106px" />
<asp:Label ID="Label2" runat="server" Text="Uid:" style="margin-top:10px;"></asp:Label>
<asp:Label ID="Label3" runat="server" Text="Label:"></asp:Label>
</div>
<div class= "body">
<div id="lanmu" runat="server" style="margin-left:150px ; height:80px; width: 1219px">
<asp:Button ID="Button2" runat="server" Text="读书" CssClass="button" style="margin-top :10px; margin-left :20px; font-size: small; font-weight: 700; color: #C0EC13;"
Height="50px" Width="95px"/>
<asp:Button ID="Button3" runat="server" Text="影视" CssClass="button" style="margin-top :10px; margin-left :80px; font-size: small; font-weight: 700; color: #C0EC13;"
Height="50px" Width="95px" />
<asp:Button ID="Button4" runat="server" Text="动漫" CssClass="button" style="margin-top :10px; margin-left :80px; font-size: small; font-weight: 700; color: #C0EC13;"
Height="50px" Width="95px"/>
<asp:Button ID="Button5" runat="server" Text="音乐" CssClass="button" style="margin-top :10px; margin-left :80px; font-size: small; font-weight: 700; color: #C0EC13;"
Height="50px" Width="95px" />
<asp:Button ID="Button6" runat="server" Text="随记" CssClass="button" style="margin-top :10px; margin-left :80px; font-size: small; font-weight: 700; color: #C0EC13;"
Height="50px" Width="95px"/>
</div>
<div id="zhuangtai" runat="server"
style="margin-left:120px; height:300px; width: 890px">
<asp:ImageButton ID="ImageButton2" runat="server" Height="80px" Width="90px" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</div>
</form>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>豆瓣酱网</title>
<style type="text/css">
.geren
{
background-image: url('image/geren.jpg');
}
.body
{
height: 480px;
width: 1219px;
background-image: url('image/201.jpg');
color: #3366CC;
}
.button
{
border-style: none; /*去掉边框*/
border-width: medium; /*图片宽带*/
background: url('image/dian.gif') no-repeat left top; /*图片路径*/
height: 62px; /*图片高度*/
}
</style>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#Button2").click(function () {
$.ajax({
url: "这里填写要请求的地址", //
success: function (data) { //data 是返回值
$("#ImageButton1").attr("src", "你要的图片SRC");
$("#Label2").text("你要显示的Uid");
$("#Label3").text("你要显示的Label");
}
})
})
})
</script>
</head>
<body>
<form id="form2" runat="server">
<div id="Div1" class="geren" runat="server" style="height: 100px">
<asp:ImageButton ID="ImageButton1" ClientIDMode="Static" runat="server" Height="92px"
Width="106px" />
<asp:Label ID="Label2" runat="server" Text="Uid:" Style="margin-top: 10px;" ClientIDMode="Static"></asp:Label>
<asp:Label ID="Label3" runat="server" Text="Label:" ClientIDMode="Static"></asp:Label>
</div>
<div class="body">
<div id="lanmu" runat="server" style="margin-left: 150px; height: 80px; width: 1219px">
<asp:Button ID="Button2" ClientIDMode="Static" runat="server" Text="读书" CssClass="button"
Style="margin-top: 10px; margin-left: 20px; font-size: small; font-weight: 700;
color: #C0EC13;" Height="50px" Width="95px" />
</div>
<div id="zhuangtai" runat="server" style="margin-left: 120px; height: 300px; width: 890px">
<asp:ImageButton ID="ImageButton2" ClientIDMode="Static" runat="server" Height="80px"
Width="90px" />
<asp:Label ID="Label1" ClientIDMode="Static" runat="server" Text="Label"></asp:Label>
</div>
</div>
</form>
</body>
</html>
Ajax处理程序代码:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["cid"] != null)
{
string cid = Request.QueryString["cid"].ToString();
//根据CID查找你要的货品信息
//把要返回的信息组织一下,如果信息量不大,可以用字符串分割的方式直接输出
Response.Write("......");
}
else
{
Response.Write("NULL");
}
}