اخواتي الكرام
احتاج مساعدتكم حاجة ماسة فلي 3 اسابعي من العمل والدراسة للجافاسكريبت الا اني لم اتقن بعد
دلي هذا الكود المراد منه اخفاء جزء واظهار جزء من الصفحة بناء على ما تم اختياره في الدرب داون ليست
الا انه الا يعمل فهل من مرشد ينقذني
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JQueryTest._Default" %>
<!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 id="Head1" runat="server">
<title></title>
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js">
</script>
<script type="text/javascript">
$(document).ready(function () {
var isPostBackObject = document.getElementById('isPostBack');
if (isPostBackObject == "1") {
$("#div2").hide();
$("#div3").hide();
$("#div4").hide();
};
$("#Button1").click(function () {
var rbvalue = $("input[name='<%=Intent.UniqueID%>']:radio:checked").val();
if (rbvalue == "Confirm") {
$("#div2").show();
$("#div3").hide();
$("#div4").hide();
// $("#Panel1").show();
} else if (rbvalue == "Postpone") {
$("#div3").show();
$("#div4").hide();
$("#div2").hide();
} else if (rbvalue == "Decline") {
$("#div4").show();
$("#div2").hide();
$("#div3").hide();
} else {
alert("How'd you get here? Who sent you?");
}
});
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="HasBuffet">
<div id="div1">
div number 1 :
<br />
<asp:RadioButtonList runat="server" ID="Intent">
<asp:ListItem Value="Confirm">show div2</asp:ListItem>
<asp:ListItem Value="Postpone">show div3</asp:ListItem>
<asp:ListItem Value="Decline">show div 4 </asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
<div id="div2">
<asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink>
</div>
<div id="div3">
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</div>
<div id="div4">
<asp:Label ID="Label1" runat="server" Text="صبر جميل"></asp:Label>
</div>
</div>
</div>
</form>
</body>
</html>code bihained C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace JQueryTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
ClientScript.RegisterHiddenField("isPostBack", "1");
}
}
}
}
أو تجدون الابلكشن هنا
http://www.4shared.com/rar/DDtcU9nP/jquerytest_2.html
لك الشكر الجزيل