I have created sample. Refer the below code.
HTML
Default.aspx
<li><a href="#"></a>
<ul>
<asp:DataList ID="DLSoft" runat="server" RepeatDirection="Vertical" CssClass="dLmostanad">
<ItemTemplate>
<div id="MainDLS">
<div id="MainDL1S">
<div id="MainDL11S">
<asp:Label ID="Label3" runat="server" CssClass="lblcodeM" Text='<%# Eval("Code") %>'></asp:Label>
<asp:Label ID="Label4" runat="server" CssClass="lblnameM" Text='<%# Eval("Name") %>'></asp:Label>
</div>
<div id="MainDL12MS">
<div id="MainDL13">
<asp:Label ID="Label7" runat="server" CssClass="lbldesM" Text='<%# Eval("Description") %>'></asp:Label>
<asp:Label ID="Label5" runat="server" CssClass="lbldesM" Text='<%# Eval("Secondclass") %>'></asp:Label>
</div>
<div id="MainDL14">
<li>
<asp:ImageButton ID="ImgContinue" runat="server" CssClass="imgconS" ImageUrl="~/Image/Main/ContinueS.gif"
CommandArgument='<%# Eval("UrlName")%>' OnClick="ContinueSoft"></asp:ImageButton>
</li>
<asp:ImageButton ID="ImageButton1" runat="server" CssClass="imgconS1" ImageUrl="~/Image/Main/buttomS.jpg">
</asp:ImageButton>
</div>
</div>
</div>
<div id="imgMS">
<asp:Image ID="Image4" runat="server" CssClass="imgsoftM" ImageUrl='<%#Eval("image","image/software/{0}")%>'>
</asp:Image>
</div>
</div>
</ItemTemplate>
</asp:DataList>
</ul>
</li>
<div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
localStorage.removeItem('SelectedMenu');
$('[id*=ImgContinue]').on('click', function () {
localStorage.setItem("SelectedMenu", $(this).closest('td').find('[id*=Label5]')[0].innerText);
});
});
</script>
</div>
Software.aspx
<div id="mainSoft2">
<div id="MM1S">
</div>
<div id="MM2S">
<div id="MM2_1">
<div id="MM21" class="dasteS">
<li><a class="Asystem">سیستم عامل</a>
<ul>
<asp:DataList runat="server" ID="Dlsystem" CssClass="Dlvideo">
<ItemTemplate>
<li><a href="#" target="_blank">
<asp:LinkButton ID="Linkbtnclass" runat="server" CssClass="lbldasteMS" CommandArgument='<%# Eval("Secondclass") %>'><%# Eval("Secondclass") %></asp:LinkButton></a></li>
<div id="MM31S">
</div>
</ItemTemplate>
</asp:DataList>
</ul>
</li>
</div>
</div>
</div>
</div>
<div>
<style type="text/css">
.SelectedActiveMenu
{
color: Red !important;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
var selctedMenuHtml = localStorage.getItem('SelectedMenu');
var selectedMenu = $.grep($('[id*=MM21] ul a'), function (ele) {
return $(ele).html().trim() == selctedMenuHtml.trim();
}).pop();
$(selectedMenu).addClass('SelectedActiveMenu');
$(selectedMenu).focus();
});
</script>
</div>
Code
Default.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dtSystem = new DataTable();
dtSystem.Columns.AddRange(new DataColumn[2] { new DataColumn("Id", typeof(int)), new DataColumn("Secondclass", typeof(string)) });
dtSystem.Rows.Add(1, "ورژن های مختلف ویندوز");
dtSystem.Rows.Add(2, "مکینتاش Mac Os");
dtSystem.Rows.Add(2, "مکینتاش Linux");
dtSystem.Rows.Add(2, "مکینتاش Linux1");
dtSystem.Rows.Add(2, "مکینتاش Linux2");
dtSystem.Rows.Add(2, "مکینتاش Linux3");
dtSystem.Rows.Add(2, "مکینتاش Linux4");
dtSystem.Rows.Add(2, "مکینتاش Linux5");
dtSystem.Rows.Add(2, "مکینتاش Linux6");
dtSystem.Rows.Add(2, "مکینتاش Linux7");
dtSystem.Rows.Add(2, "مکینتاش Linux8");
DLSoft.DataSource = dtSystem;
DLSoft.DataBind();
}
}
protected void ContinueSoft(object sender, ImageClickEventArgs e)
{
ImageButton ImgEdit = (ImageButton)sender;
Response.Redirect("Software/SoftwareInfo/" + ImgEdit.CommandArgument);
}
Software.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dtSystem = new DataTable();
dtSystem.Columns.AddRange(new DataColumn[2] { new DataColumn("Id", typeof(int)), new DataColumn("Secondclass", typeof(string)) });
dtSystem.Rows.Add(1, "ورژن های مختلف ویندوز");
dtSystem.Rows.Add(2, "مکینتاش Mac Os");
dtSystem.Rows.Add(2, "مکینتاش Linux");
dtSystem.Rows.Add(2, "مکینتاش Linux1");
dtSystem.Rows.Add(2, "مکینتاش Linux2");
dtSystem.Rows.Add(2, "مکینتاش Linux3");
dtSystem.Rows.Add(2, "مکینتاش Linux4");
dtSystem.Rows.Add(2, "مکینتاش Linux5");
dtSystem.Rows.Add(2, "مکینتاش Linux6");
dtSystem.Rows.Add(2, "مکینتاش Linux7");
dtSystem.Rows.Add(2, "مکینتاش Linux8");
Dlsystem.DataSource = dtSystem;
Dlsystem.DataBind();
}
}
Global.asax
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>
<script RunAt="server">
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Softwareinfo", "Software/SoftwareInfo/{UrlName}", "~/software.aspx");
}
</script>
Screenshot