Jump to content

Error-there Is No Source Code Available For The Current Location.


lbenezra

Recommended Posts

HiI am using in my site Button Link that trasfer to a switch.apsx page which get a language parameter and load the same page in the language that choose.This line is in the master page:<div align="right" class="headmenuE"><a href="HomePage_en.aspx">Home</a> | <a href="ContactN_en.aspx">Contact Us</a> |<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" OnClick="LinkButton1_Click">Hebrew-עברית</asp:LinkButton> </div> The function in the CS file:protected void LinkButton1_Click(object sender, EventArgs e) { Int32 Page = Convert.ToInt32(Session["page"]); if (Page < 11) Response.Redirect("switchpage.aspx?lang=heb"); }It work Ok in all pages on site except one page that cause the above error. I don't understand why??THE PAGE IS :ASPX FILE NAMED: ProductsTabs_En.aspx:----------------------------------------------------------------------------------------------------------------------------------------------<%@ Page Language="C#" MasterPageFile="~/MasterPage2.master" AutoEventWireup="true" CodeFile="ProductsTabs_En.aspx.cs" Inherits="ProductsTabs_En" Title="Untitled Page" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><div style="width:100%; margin-left:2%;" class="layTextBlock"> <div class="infoPageText" > <!-- Name of Division --> <asp:FormView ID="FormView2" runat="server" DataKeyNames="id" DataSourceID="AccessDataSource3"> <ItemTemplate> <BR /> <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl='<%# Eval("id", "Industries_en.aspx?industry_id={0}") %>'> <asp:Label ID="navigation_title_enLabel" runat="server" CssClass="Title" Text='<%# Bind("navigation_title_en") %>'></asp:Label> </asp:HyperLink> </ItemTemplate> </asp:FormView> <BR /> <!-- DataSource for page --> <asp:AccessDataSource ID="AccessDataSource3" runat="server" DataFile="~/App_Data/hbc_new.mdb" SelectCommand="SELECT id, navigation_title_en, url FROM Industries WHERE (id = ?)"> <SelectParameters> <asp:SessionParameter Name="id" SessionField="Industry" Type="Int32" /> </SelectParameters> </asp:AccessDataSource> <!-- Title of Activity + short statement + Sector being shown--> <br /> <DIV> <asp:Panel id="PageContents" runat="server" > <span class="TopPageTitle"><asp:PlaceHolder id="PlaceActivityTitle" runat="server"></asp:PlaceHolder> </span> <br /> <span class="layTextBlock" style="margin-left:2%;"><asp:PlaceHolder id="PlaceTopText" runat="server" ></asp:PlaceHolder> </span> <BR /> <span class="layTextTitle" style="margin-left:5%;"><asp:PlaceHolder id="PlacePortfolioTitle" runat="server" ></asp:PlaceHolder> </span> <!-- tabs for sector + ingredient listing --> <cc1:TabContainer ID="TabContainer1" runat="server" CssClass="ajax__tab_orange-theme " > </cc1:TabContainer> </asp:Panel>   </DIV>   <br /> Additional applications and materials are also available! Contact us! </div> <!-- Picture of Division being shown --> <BR /> <BR /> <BR /> <BR /> <div class="IndustrypicP" > <asp:FormView ID="FormView3" runat="server" DataKeyNames="id" DataSourceID="AccessDataSource3"> <ItemTemplate> <asp:HyperLink ID="HyperLink5" ToolTip="Return to main Industry" runat="server" NavigateUrl='<%# Eval("id", "Industries_en.aspx?industry_id={0}") %>'> <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("url", "{0}") %>' /> </asp:HyperLink> <BR /> <BR /> </ItemTemplate> </asp:FormView> </div> </div> </asp:Content>------------------------------------------------------------------------------------------------------------------------cs file:----------------------------------------using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Collections.Generic;using System.Data.Odbc;using System.Data.OleDb;using AjaxControlToolkit;public partial class ProductsTabs_En : System.Web.UI.Page{ protected string subCategoryName; protected string categoryName; protected string activityTitle; protected int industryID; protected int activityID; protected int selectedActivityID; protected int subActivityID; protected string navigationTitle; protected string topText; protected string portfolioTitle; protected void Page_Load(object sender, EventArgs e) { Session["page"] = 8; activityID = Convert.ToInt32(Request.QueryString["ActivityID"]); subActivityID = Convert.ToInt32(Request.QueryString["act_id"]); industryID = GetIndustryID(activityID); Session["Industry"] = industryID; Session["activity"] = activityID; string DataPlace = Server.MapPath("App_Data\\hbc_new.mdb"); string lang = "en"; if (!Page.IsPostBack) { UpdatePannel(); List<Category> categories = Category.GetCategories(activityID, DataPlace, lang); foreach (Category category in categories) { GridView gv = new GridView(); HyperLinkField Hyperlink1 = new HyperLinkField(); gv.AutoGenerateColumns = false; gv.BorderWidth = 0; gv.DataSource = category.Products; //add hyper link field to grid gv.DataKeyNames = new string[] { "productName" }; Hyperlink1.DataNavigateUrlFields = new string[] { "productName" }; if (activityID == 352) { Hyperlink1.DataNavigateUrlFormatString = "documents/{0}.pps"; Hyperlink1.Target = "_blank"; } else { Hyperlink1.DataNavigateUrlFormatString = "contactN_en.aspx?productID={0}&industry_id=" + industryID + "&activity_id=" + activityID; } Hyperlink1.DataTextField = "productName"; gv.Columns.Add(Hyperlink1); gv.DataBind(); gv.HeaderRow.Visible = false; AjaxControlToolkit.TabPanel tab = new AjaxControlToolkit.TabPanel(); tab.Controls.Add(gv); tab.HeaderText = category.CategoryName; this.Title = this.Title + " " + category.CategoryName; TabContainer1.Tabs.Add(tab); } } TabContainer1.ActiveTabIndex = 0; } protected void UpdatePannel() { string topText; string portfolioTitle; string activityTitle; //connect to database string DataPlace = Server.MapPath("App_Data\\hbc_new.mdb"); string connectionString = ConfigurationSettings.AppSettings["DataConnectionString"]; connectionString = connectionString.Replace("TEMP", DataPlace); OleDbConnection m_connection = new OleDbConnection(connectionString); OleDbCommand cmdTemp = m_connection.CreateCommand(); m_connection.Open(); cmdTemp.CommandText = "SELECT id,navigation_title_en,name_heb,products_title_en, top_text_en, portfolio_title_en, parent_id FROM Activities WHERE id=" + activityID; OleDbDataReader reader = cmdTemp.ExecuteReader(CommandBehavior.SingleRow); reader.Read(); subCategoryName = reader.GetString(1); if (reader.IsDBNull(3)) activityTitle = "Materials for " + subCategoryName; else activityTitle = reader.GetString(3); if (reader.IsDBNull(4)) topText = ""; else topText = reader.GetString(4); if (reader.IsDBNull(5)) portfolioTitle = "Our material portfolio for " + subCategoryName; else portfolioTitle = reader.GetString(5); topText = topText.Replace("Hirshberg Brothers", "<BR/><span class=Hirshberg>Hirshberg Brothers</span>"); topText = topText.Replace("אחים הרשברג", "<span class=Hirshberg>אחים הרשברג</span>"); PlaceActivityTitle.Controls.Add(new LiteralControl(activityTitle)); PlaceTopText.Controls.Add(new LiteralControl(topText)); PlacePortfolioTitle.Controls.Add(new LiteralControl(portfolioTitle)); m_connection.Close(); } protected int GetIndustryID(int pActivityID) { OleDbDataReader reader; OleDbCommand cmdTemp; int nextID, industryID; //connect to database------------------------------------------------------------ string DataPlace = Server.MapPath("App_Data\\hbc_new.mdb"); string connectionString = ConfigurationSettings.AppSettings["DataConnectionString"]; connectionString = connectionString.Replace("TEMP", DataPlace); //---------------------------------------------------------------------------- OleDbConnection m_connection = new OleDbConnection(connectionString); m_connection.Open(); cmdTemp = m_connection.CreateCommand(); cmdTemp.CommandText = "SELECT id, name_en , parent_id FROM Activities WHERE id=" + pActivityID; reader = cmdTemp.ExecuteReader(CommandBehavior.SingleRow); if (reader.Read()) { nextID = industryID = reader.GetInt32(2); //navControl.AddLevel(reader.GetString(1),"#"); while (nextID != 0) { industryID = nextID; reader.Close(); cmdTemp.CommandText = "SELECT id,navigation_title_en, parent_id FROM Activities WHERE id=" + industryID; reader = cmdTemp.ExecuteReader(CommandBehavior.SingleRow); if (reader.Read()) { nextID = reader.GetInt32(2); } else throw new Exception("No activity with id " + industryID + " was found."); } reader.Close(); return industryID; } else throw new Exception("The activity ID wasn't found!"); }}------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...