Springen naar inhoud


- - - - -

meertaligheid werkt niet goed

meertaligheid

  • Log in a.u.b. om te beantwoorden
Geen reacties in dit onderwerp

#1 bailey

bailey

    Starting Developer

  • Leden
  • 1 berichten
    Laatst bezocht 24 feb 2012 00:10

Geplaatst op 24 februari 2012 - 00:11

Ben bezig met een script asp.net 2.0 en 2005 sql server.  Funktionneert niet lekker. Wanneer ik op EN icon click komt er geen server application in home wanneer ik de hyperlink (description from admin panel aanklikt) Probleem ik een andere icon krijg ik een server application error.
In de Owner's login neem ik de EN icon en vul de logins in: druk op add property en krijg het totale pagina. Doe ik hetzelfde bv. FR incon of ES incon of andere lang krijg ik een partieel pagina.  (tot Holydat Types)Snap er niets van?
Denk dat het iets te maken heeft met session lang() maar hoe en wat?
stuk van de code:

Code:
<< FillPage()
If Not IsPostBack Then
If Session("Lang") Is Nothing Then
Session("Lang") = "EN"
End If>>

code van de default.aspx voeg ik hierbij.
logins voor de owner's: owner password: 111111
Imports System.Text
Imports System.Web
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient

Namespace holidaylettings
	Partial Class Index
		Inherits System.Web.UI.Page
		Private GlobalFunc As MyFunc.Functions
		Protected WithEvents lblAdTitle1 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody1 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle2 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody2 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle3 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody3 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle4 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody4 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle5 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody5 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle6 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody6 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle7 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody7 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdTitle8 As System.Web.UI.WebControls.Label
		Protected WithEvents lblAdBody8 As System.Web.UI.WebControls.Label
		Dim hlSectionTitle(10) As HyperLink
		Dim lblSectionTitle(4) As Label
		Dim hlSectionBody(20) As HyperLink
		Dim imgSectionImage(20) As System.Web.UI.WebControls.Image
		Dim hlBottomSectionBody(7) As HyperLink
		Dim hlBottomSectionTitle(7) As HyperLink
		Dim hlBottomLink(2) As HyperLink
		Dim DataGridRegions, DataGridTowns As DataGrid

#Region " Web Form Designer Generated Code "
		'This call is required by the Web Form Designer.
		<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		End Sub
		Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
			'CODEGEN: This method call is required by the Web Form Designer
			'Do not modify it using the code editor.
			InitializeComponent()
		End Sub
#End Region
		Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
			'Put user code to initialize the page here
			Session("URL") = Request.Url.LocalPath
			GlobalFunc = New MyFunc.Functions()
			FillPage()
			If Not IsPostBack Then
				If Session("Lang") Is Nothing Then
					Session("Lang") = "EN"
				End If
				MyLang()
				GlobalFunc.gf_bind_ddlb(ddlCountry, "SELECT * FROM CountryT")
				If Session("Lang") = "EN" Then
					ddlCountry.Items.Insert(0, "Select Country")
				ElseIf Session("Lang") = "DE" Then
					ddlCountry.Items.Insert(0, "Select Country")
				ElseIf Session("Lang") = "FR" Then
					ddlCountry.Items.Insert(0, "Select Country")
				ElseIf Session("Lang") = "ES" Then
					ddlCountry.Items.Insert(0, "Select Country")
	 ElseIf Session("Lang") = "NL" Then
					ddlCountry.Items.Insert(0, "Select Country")
				End If
				txtNewsRegistration.Attributes.Add("onchange", "return checkemail(this);")
				BindList()
				BindList1()
			End If
		End Sub
		Private Sub BindList1()
			Dim str_sql As String
			str_sql = "SELECT * FROM GuidesT"
			GlobalFunc.gf_bind_dlist(dtlCountry1, str_sql)
		End Sub
		Private Sub MyLang()
			Dim str_sql, s1, s2, s3 As String
			str_sql = "SELECT LanguagesT.LangDescr, LanguagesT.Enabled, TitlesT.TitleKey, TitlesT.TitleText FROM LanguagesT INNER JOIN TitlesT ON LanguagesT.LangID=TitlesT.LangID ORDER BY TitlesT.LangID"
			Dim gDS As DataSet
			Dim idr As DataRow
			Dim ind, i As Integer
			gDS = New DataSet()
			i = 0
			GlobalFunc.gf_fill_table(gDS, "Langs", str_sql)
			ind = gDS.Tables("Langs").Rows.Count
			While i < ind
				idr = gDS.Tables("Langs").Rows(i)
				If idr("Enabled") = "1" Then
					If idr("LangDescr") = "DE" Then hlDe.Visible = True
					If idr("LangDescr") = "EN" Then hlEn.Visible = True
					If idr("LangDescr") = "FR" Then hlFr.Visible = True
					If idr("LangDescr") = "ES" Then hlEs.Visible = True
	 If idr("LangDescr") = "NL" Then hlNl.Visible = True
				End If
				s1 = "" & idr("LangDescr")
				s2 = "" & idr("TitleKey")
				s3 = s1 & s2
				Application(s3) = "" & idr("TitleText")
				i = i + 1
			End While
		End Sub
		Sub FillPage()
			'-------------------------------------------------
			'fill arrays of titles and bodies
			'-------------------------------------------------
			Dim MyReader As SqlDataReader
			Dim i As Integer ', intCount
			Dim strSql As String
			'----------------------------------------------------------------
			'Section Titles
			'----------------------------------------------------------------
			hlSectionTitle(0) = SectionTitle1
			hlSectionTitle(1) = SectionTitle2
			hlSectionTitle(2) = SectionTitle3
			hlSectionTitle(3) = SectionTitle4
			hlSectionTitle(4) = SectionTitle5
			hlSectionTitle(5) = SectionTitle6
			lblSectionTitle(1) = SectionTitle8
			lblSectionTitle(2) = SectionTitle9
			lblSectionTitle(3) = SectionTitle10
			lblSectionTitle(4) = SectionTitle11
			i = 0
			strSql = "SELECT HomePageSectionDescr,URL FROM HomePageSectionT "

			Dim gDS As DataSet
			Dim idr As DataRow
			Dim ind As Integer
			gDS = New DataSet()
			GlobalFunc.gf_fill_table(gDS, "Home", strSql)
			If (gDS.Tables("Home").Rows.Count > 0) Then
				ind = gDS.Tables("Home").Rows.Count - 1
				For i = 0 To ind
					idr = gDS.Tables("Home").Rows(i)
					hlSectionTitle(i).Text = idr("HomePageSectionDescr")
					hlSectionTitle(i).NavigateUrl = idr("URL")
				Next
				'For i = 6 To 9
				'	idr = gDS.Tables("Home").Rows(i)
				'	lblSectionTitle(i - 5).Text = idr("HomePageSectionDescr")
				'Next
			End If
			'-----------------------------------------------------------------
			'Section Body
			'-------------------------------------------------------------------
			hlSectionBody(0) = SectionBody11
			hlSectionBody(1) = SectionBody21
			hlSectionBody(2) = SectionBody22
			hlSectionBody(3) = SectionBody31
			hlSectionBody(4) = SectionBody32
			hlSectionBody(5) = SectionBody41
			hlSectionBody(6) = SectionBody42
			hlSectionBody(7) = SectionBody51
			hlSectionBody( [img]http://www.vbib.be/public/style_emoticons/default/icon_cool.gif[/img] = SectionBody52
			hlSectionBody(9) = SectionBody61
			hlSectionBody(10) = SectionBody62
			hlSectionBody(11) = SectionBody63
			hlSectionBody(12) = SectionBody81
			hlSectionBody(13) = SectionBody82
			hlSectionBody(14) = SectionBody91
			hlSectionBody(15) = SectionBody92
			hlSectionBody(16) = SectionBody101
			hlSectionBody(17) = SectionBody102
			hlSectionBody(18) = SectionBody111
			hlSectionBody(19) = SectionBody112
			hlSectionBody(20) = SectionBody113
			imgSectionImage(0) = image11
			imgSectionImage(1) = image21
			imgSectionImage(2) = image22
			imgSectionImage(3) = image31
			imgSectionImage(4) = image32
			imgSectionImage(5) = image41
			imgSectionImage(6) = image42
			imgSectionImage(7) = image51
			imgSectionImage( [img]http://www.vbib.be/public/style_emoticons/default/icon_cool.gif[/img] = image52
			imgSectionImage(9) = image61
			imgSectionImage(10) = image62
			imgSectionImage(11) = image63
			imgSectionImage(12) = image81
			imgSectionImage(13) = image82
			imgSectionImage(14) = image91
			imgSectionImage(15) = image92
			imgSectionImage(16) = image101
			imgSectionImage(17) = image102
			imgSectionImage(18) = image111
			imgSectionImage(19) = image112
			imgSectionImage(20) = image113
			i = 0
			strSql = "SELECT SectionID,TextContent,SideID,ImageURL,URL FROM HomePageSectionContentT"
			GlobalFunc.gf_fill_table(gDS, "HomePage1", strSql)
			ind = gDS.Tables("HomePage1").Rows.Count
			While i < ind
				idr = gDS.Tables("HomePage1").Rows(i)
				hlSectionBody(i).Text = idr("TextContent")
				hlSectionBody(i).NavigateUrl = idr("URL")
				imgSectionImage(i).ImageUrl = "prop/" & idr("ImageURL")
				i = i + 1
			End While

			hlBottomLink(0) = BottomLink1
			hlBottomLink(1) = BottomLink2
			hlBottomLink(2) = BottomLink3
			i = 0
			strSql = "SELECT BottomLink,URL FROM HomePageSectionContentT WHERE BottomLink<>'0'"
			GlobalFunc.gf_fill_table(gDS, "HomePageSection", strSql)
			ind = gDS.Tables("HomePageSection").Rows.Count
			While i < ind
				idr = gDS.Tables("HomePageSection").Rows(i)
				hlBottomLink(i).Text = idr("BottomLink")
				hlBottomLink(i).NavigateUrl = idr("URL")
				i = i + 1
			End While

		End Sub
		Private Sub ddlCountry_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlCountry.SelectedIndexChanged
			If Not ddlCountry.SelectedIndex = 0 Then
				Response.Redirect("search.aspx?cid=" & ddlCountry.SelectedItem.Value)
			End If
		End Sub
		Private Sub imbRegister_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imbRegister.Click
			Response.Redirect("owners/userlogin.aspx")
		End Sub
		Private Sub imbNews_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imbNews.Click
			Dim strNews As String
			strNews = "SELECT UserIDNews FROM NewsListT WHERE EmailNews='" & txtNewsRegistration.Text & "'"
			If Not txtNewsRegistration.Text = "" Then
				If GlobalFunc.SelectSQLItem(strNews) = "" Then
					GlobalFunc.ExecuteSQL("INSERT INTO NewsListT (EmailNews,DataRegNews) VALUES('" & txtNewsRegistration.Text & "',getdate())")
					txtNewsRegistration.Text = "Done!"
				Else
					txtNewsRegistration.Text = "E-mail already exist!"
					Return
				End If
			End If
		End Sub
		Public Sub BindList()
			Dim str_sql As String
			str_sql = "SELECT DISTINCT CountryT.countryID,CountryT.countryName FROM CountryT " & _
					" INNER JOIN PropertyT ON CountryT.countryID=PropertyT.countryID where propertyt.status=2"
			GlobalFunc.gf_bind_dlist(dtlCountry, str_sql)
		End Sub
		Sub dtgRegions_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
			BindGridTowns()
		End Sub
		Sub dtgTowns_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
		End Sub
		Private Sub dtlCountry_ItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dtlCountry.ItemCreated
			If Not e.Item.DataItem Is Nothing Then
				DataGridRegions = e.Item.FindControl("dtgRegions")
				Dim strSql As String
				strSql = "SELECT DISTINCT RegionT.RegionID, SUBSTRING(RegionDescr, 1,40) as RegionDescr1 FROM RegionT INNER JOIN PropertyT ON PropertyT.RegionID=RegionT.RegionID WHERE PropertyT.status=2 and RegionT.countryID=" & DataBinder.Eval(e.Item.DataItem, "countryID")
				GlobalFunc.gf_bind_grid(DataGridRegions, strSql)
			End If
		End Sub
		Sub BindGridTowns()
			Dim dItem As DataGridItem
			Dim ctrl As Control
			Dim lblRegionID As Label
			If Not DataGridRegions Is Nothing Then
				For Each dItem In DataGridRegions.Items
					For Each ctrl In dItem.Controls
						lblRegionID = ctrl.FindControl("lblRegionID")
						DataGridTowns = ctrl.FindControl("dtgTowns")
						If Not DataGridTowns Is Nothing Then
							GlobalFunc.gf_bind_grid(DataGridTowns, "SELECT DISTINCT TownT.TownID,TownDescr FROM TownT INNER JOIN PropertyT ON PropertyT.TownID=TownT.TownID WHERE PropertyT.status=2 and TownT.RegionID=" & lblRegionID.Text & " ORDER BY TownT.TownDescr")
						End If
					Next
				Next
			End If
		End Sub
	End Class
End Namespace


met dank




0 gebruiker(s) lezen dit onderwerp

0 lid(leden), 0 bezoeker(s), 0 anonieme gebruikers

Inloggen


Untitled 1

Met dank aan J├╝rgen voor de jarenlange inzet van visualbasic.be (anno dec 2000)
Met dank aan Mike en Ronneke voor de jarenlange inzet van vbib.be (anno dec 2010)
Met dank aan PascalBianca voor de jarenlange inzet van vbib.be (anno dec 2016)