In these 2 files I have problems: Submenu.ascx , Footermenu.ascx
But I'm not sure which module is using this: TheDNNMenu or DDRMenu
Here is the submenu.ascx.cs cod:
using System;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EscentricsLib.Common;
using EscentricsLib.Sql;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Text;
public partial class Portals__default_Skins_sdccc_submenu : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
//UtilityDisplayServerVariableInfo();
if (Request.QueryString["TabID"] != null)
{
string TabId = Request.QueryString["TabID"];
SqlParameter[] spa = new SqlParameter[0];
int countRecord = DB.GetSqlN("Select count(*) as N From [Tabs] where [ParentId] = " + DB.SQuote(TabId) + " And [IsVisible]=1 AND IsDeleted=0 and [ParentId]!=43 and [ParentId]!= 7", spa);
if (countRecord > 0)
{
ltSubMenuList.Text = RenderSubMenuList(TabId);
}
else
{
int nTabId = DB.GetSqlN("SELECT ParentId as N From Tabs where TabID = " + DB.SQuote(TabId), spa);
//Response.Write(nTabId.ToString());
ltSubMenuList.Text = RenderSubMenuList(nTabId.ToString());
}
}
}
private string RenderSubMenuList(string tabId)
{
SqlDataReader rs = DB.GetReader("Select [TabName], [TabID], [TabOrder], [TabPath] From [Tabs] where [ParentId] = " + DB.SQuote(tabId) + " AND ParentId != 43 AND ParentId != 61 AND ParentID != 7 And [IsVisible]=1 AND IsDeleted=0 AND IsSecure=0Order By [TabOrder]");
SqlParameter[] spa = new SqlParameter[0];
string ParentTabName = DB.GetSqlS("Select [TabName] as S From [Tabs] where [TabID] = " + DB.SQuote(tabId) + " And IsSecure=0 AND IsDeleted=0 And [IsVisible]=1 ", spa).ToLower();
StringBuilder subMenuStr = new StringBuilder();
// subMenuStr.Append("<ul>");
subMenuStr.Append("<ul id='submenu_" + tabId + "'>");
while (rs.Read())
{
string selectedItemId = Request.QueryString["TabID"];
subMenuStr.Append("<li class='sub_menu'>");
string Accomplishment_page_id = "90";
if (selectedItemId == "91")
{
selectedItemId = Accomplishment_page_id;
}
if (selectedItemId == DB.RsFieldInt(rs, "TabID").ToString())
{
subMenuStr.Append("<a class=\"selected\" href=\"" + ExtractDomainNameFromURL(Request.Url.AbsoluteUri) + UppercaseFirst(DB.RsField(rs, "TabPath").Replace("//","/").Substring(1)) + ".aspx\">" + DB.RsField(rs, "TabName") + "</a>");
}
else
{
string subtabname = DB.RsField(rs, "TabName");
subMenuStr.Append("<li>");
if (subtabname == "Twitter")
subMenuStr.Append("<a href='http://twitter.com/SDConventionCtr' target='_blank'>" + DB.RsField(rs, "TabName") + "</a>");
else if (subtabname == "Facebook")
subMenuStr.Append("<a href='http://www.facebook.com/pages/San-Diego-Convention-Center/358290337510' target='_blank'>" + DB.RsField(rs, "TabName") + "</a>");
else if (subtabname == "Youtube")
subMenuStr.Append("<a href='http://www.youtube.com/user/SDConvenCtr' target='_blank'>" + DB.RsField(rs, "TabName") + "</a>");
else
subMenuStr.Append("<a href=\"" + ExtractDomainNameFromURL(Request.Url.AbsoluteUri) + UppercaseFirst(DB.RsField(rs, "TabPath").Replace("//", "/").Substring(1)) + ".aspx\">" + DB.RsField(rs, "TabName") + "</a>");
}
subMenuStr.Append("</li>");
}
subMenuStr.Append("</ul>");
rs.Close();
return subMenuStr.ToString();
}
public static string UppercaseFirst(string s)
{
// Check for empty string.
if (string.IsNullOrEmpty(s))
{
return string.Empty;
}
// Return char and concat substring.
return char.ToUpper(s[0]) + s.Substring(1);
}
public static string ExtractDomainNameFromURL(string Url)
{
if (Url.Contains(@"://"))
Url = Url.Split(new string[] { "://" }, 2, StringSplitOptions.None)[1];
string fullDomain = "http://" + Url.Split('/')[0];
if (HttpContext.Current.Request.ServerVariables["PATH_INFO"].ToString() != string.Empty)
{
fullDomain += HttpContext.Current.Request.ServerVariables["PATH_INFO"].ToString().Replace("/Default.aspx", "/");
}
return fullDomain;
}
public void UtilityDisplayServerVariableInfo()
{
int loop1, loop2;
NameValueCollection coll;
// Load ServerVariable collection into NameValueCollection object.
coll = Request.ServerVariables;
// Get names of all keys into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Key: " + arr1[loop1] + "<br>");
String[] arr2 = coll.GetValues(arr1[loop1]);
for (loop2 = 0; loop2 < arr2.Length; loop2++)
{
Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>");
}
}
}
}
Please help me
Thanks,
Bahareh