Hello everyone, I have a drop-down list that contains the Arabic language and the English language. I want, if I choose the Arabic language, the page will go to the right, and if I choose the English language, the page will go to the left.
>>>>>>>>>>>>>>>>>>>
Imports System.Threading
Imports System.Globalization
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Web
Imports System.Web.Configuration
Imports System.Web.Security
Imports System.Collections
Imports System.IO
Imports DevExpress.XtraEditors
Imports System.Net
Imports System.Net.Security
Imports System.DBNull
Imports System.Security.Cryptography.X509Certificates
Imports System.Xml
Imports System.Data.SqlTypes
Public Class BasePage5
Inherits System.Web.UI.Page
Protected WithEvents HyperLink2 As System.Web.UI.WebControls.HyperLink
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents txtUserName As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents ValidationSummary1 As System.Web.UI.WebControls.ValidationSummary
Protected WithEvents DataList1 As System.Web.UI.WebControls.DataList
Protected WithEvents RequiredFieldValidator1 As System.Web.UI.WebControls.RequiredFieldValidator
Protected connStr = WebConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents Button3 As System.Web.UI.WebControls.Button
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents Button4 As System.Web.UI.WebControls.Button
Protected WithEvents Button5 As System.Web.UI.WebControls.Button
Protected WithEvents Button6 As System.Web.UI.WebControls.Button
Protected WithEvents Button7 As System.Web.UI.WebControls.Button
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
Protected WithEvents lblout As System.Web.UI.WebControls.Label
Protected WithEvents lblOutput As System.Web.UI.WebControls.Label
Protected WithEvents Textbox3 As System.Web.UI.WebControls.TextBox
Protected WithEvents Textbox4 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents Label7 As System.Web.UI.WebControls.Label
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents Label9 As System.Web.UI.WebControls.Label
Protected WithEvents Label10 As System.Web.UI.WebControls.Label
Protected WithEvents ddlLanguages5 As System.Web.UI.WebControls.DropDownList
Protected Connection = New SqlConnection(connStr)
Dim PageNo
Dim strHostName As String
Protected Overrides Sub InitializeCulture()
Dim language As String = "en-us"
If Request.UserLanguages IsNot Nothing Then
language = Request.UserLanguages(0)
End If
If Request.Form("__EVENTTARGET") IsNot Nothing AndAlso Request.Form("__EVENTTARGET").Contains("ddlLanguages5") Then
language = Request.Form(Request.Form("__EVENTTARGET"))
End If
Thread.CurrentThread.CurrentCulture = New CultureInfo("ar-SA")
Thread.CurrentThread.CurrentUICulture = New CultureInfo(language)
End Sub
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PageNo = "5"
If Session.Contents("name") = "" Then
lblout.Visible = True
lblout.Text = "User Session Expired, please Login again...."
Else
adminmenu()
lblout.Visible = False
DefaultButton(Me.txtUserName, Me.Button1)
BINDSEC()
End If
DefaultButton(Me.Textbox4, Me.Button1)
If Not Me.IsPostBack Then
If ddlLanguages5.Items.FindByValue(CultureInfo.CurrentCulture.Name) IsNot Nothing Then
ddlLanguages5.Items.FindByValue(CultureInfo.CurrentCulture.Name).Selected = True
End If
End If
End Sub
Sub adminmenu()
Dim Uname, usertype As String
Dim Connection As New SqlConnection(connStr)
Uname = Session.Contents("name")
Dim ds As New DataSet()
Dim adapter As New SqlDataAdapter("Select menuType,ptype,remarks from [HRusers] Where remarks like '%" & PageNo & "%' and userid = '" & Uname & "'", Connection)
adapter.Fill(ds, "Details")
If ds.Tables("Details").Rows.Count <> 0 Then
usertype = ds.Tables("Details").Rows(0).Item("MenuType").ToString()
Else
Response.Redirect("mainpage.aspx")
End If
End Sub
Dim ULOCATION, UCOUNTER, ptype, mtype
Dim utype As Char
Dim Bno
Sub BINDSEC()
Dim Connection As New SqlConnection(connStr)
Dim adapter2 As New SqlDataAdapter("SELECT CCode,printreceipt,menutype from hrusers where userid='" & Session.Contents("name") & "'", Connection)
Dim ds2 As New DataSet()
adapter2.Fill(ds2, "tran2")
utype = ds2.Tables("tran2").Rows(0).Item("printreceipt")
mtype = ds2.Tables("tran2").Rows(0).Item("menutype")
If mtype = "User" Then
Dim adapter As New SqlDataAdapter("select ptype, Bno, Location, Project, Cname from building where Bno in (SELECT CCode from hrusers where userid='" & Session.Contents("name") & "')", Connection)
Dim ds As New DataSet()
adapter.Fill(ds, "tran")
ULOCATION = ds.Tables("tran").Rows(0).Item("location")
UCOUNTER = ds.Tables("tran").Rows(0).Item("cname")
ptype = ds.Tables("tran").Rows(0).Item("ptype")
Bno = ds.Tables("tran").Rows(0).Item("Bno")
Else
ULOCATION = "Admin"
UCOUNTER = "Admin"
ptype = "Admin"
Bno = 0
End If
End Sub
Sub BindTime()
Dim Connection As New SqlConnection(connStr)
Dim adapter As New SqlDataAdapter("SELECT MEALTYPE, CONVERT(varchar, STARTTIME, 108) AS StartTime, CONVERT(varchar, ENDTIME, 108) AS CloseTime, ActivityMealStatus FROM MEALTIME WHERE Status='Y' and (CONVERT(varchar, STARTTIME, 108) < CONVERT(varchar, GETDATE(), 108)) AND (CONVERT(varchar, ENDTIME, 108) > CONVERT(varchar, GETDATE(),108))", Connection)
Dim ds As New DataSet()
adapter.Fill(ds, "tran")
DataGrid1.DataSource = ds.Tables("tran").DefaultView
DataGrid1.DataBind()
End Sub
Private Sub DefaultButton(ByRef objTextControl As TextBox, ByRef objDefaultButton As Button)
Dim sScript As New System.Text.StringBuilder()
sScript.Append("" & vbCrLf)
sScript.Append("function fnTrapKD(btn){" & vbCrLf)
sScript.Append(" if (document.all){" & vbCrLf)
sScript.Append(" if (event.keyCode == 13)" & vbCrLf)
sScript.Append(" { " & vbCrLf)
sScript.Append(" event.returnValue=false;" & vbCrLf)
sScript.Append(" event.cancel = true;" & vbCrLf)
sScript.Append(" btn.click();" & vbCrLf)
sScript.Append(" } " & vbCrLf)
sScript.Append(" } " & vbCrLf)
sScript.Append("}" & vbCrLf)
sScript.Append("" & vbCrLf)
objTextControl.Attributes.Add("onkeydown", "fnTrapKD(document.all." & objDefaultButton.ClientID & ")")
If Not Page.IsStartupScriptRegistered("ForceDefaultToScript") Then
Page.RegisterStartupScript("ForceDefaultToScript", sScript.ToString)
End If
End Sub
Dim Fname, MNAME, lNAME, stype, dname
Public Function RemoteCertificateValidate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
Return True
End Function
Dim scode
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim aid = txtUserName.Text
ServicePointManager.ServerCertificateValidationCallback = AddressOf RemoteCertificateValidate
Dim StudentOutputData As New BarCodeApps.ServiceReference1.Student2Data
Dim StudentInputData As New BarCodeApps.ServiceReference1.UserInput
Dim StudentSSOClient As New BarCodeApps.ServiceReference1.StudentsServiceClient
StudentInputData.StudentId = aid
StudentInputData.ConsumerApplication = "BarCodeApps"
Fname = StudentOutputData.FIRST_NAME_ENG
MNAME = StudentOutputData.MIDDLE_NAME_ENG
lNAME = StudentOutputData.LAST_NAME_ENG
Label6.Text = Fname & " " & MNAME & " " & lNAME & "(" & StudentOutputData.STUDENT_ID & ")"
dname = StudentOutputData.DEPARTMENT_NAME_ENG
Label9.Text = StudentOutputData.DEPARTMENT_NAME & " " & StudentOutputData.DEPARTMENT_NAME_ENG
Label10.Text = "STATUS : " & StudentOutputData.STATUS_DESC
scode = StudentOutputData.STATUS_CODE
stype = "KSU Student"
lblOutput.Visible = True
Label5.Visible = True
Label6.Visible = True
Label8.Visible = True
Label9.Visible = True
Label10.Visible = True
If scode = "1" Then
BindCheck()
Label10.BackColor = Drawing.Color.White
Label10.ForeColor = Drawing.Color.Green
ElseIf scode <> "1" Then
Dim Connection As New SqlConnection(connStr)
Dim cmdAddType As SqlCommand = New SqlCommand("chkID", Connection)
cmdAddType.CommandType = CommandType.StoredProcedure
cmdAddType.Parameters.Add(New SqlParameter("@IDNO", SqlDbType.NVarChar, 255))
Dim OParm As SqlParameter = cmdAddType.Parameters.Add("@OReturn", SqlDbType.Int)
OParm.Direction = ParameterDirection.Output
cmdAddType.Parameters("@IDNO").Value = txtUserName.Text
Connection.Open()
cmdAddType.ExecuteNonQuery()
Dim OReturn As String = cmdAddType.Parameters("@OReturn").Value.ToString
If CStr(OReturn) = "1" Then
Dim adapter As New SqlDataAdapter("SELECT Aid, sname, location,building from student where ltrim(rtrim(aid))='" & Trim(txtUserName.Text) & "'", Connection)
Dim ds As New DataSet()
adapter.Fill(ds, "head")
Label6.Text = ds.Tables("head").Rows(0).Item("sname") & "(" & ds.Tables("head").Rows(0).Item("Aid") & ")"
Label9.Text = ds.Tables("head").Rows(0).Item("building")
Label10.Text = "STATUS : " & Label9.Text
stype = "NON-KSU Student"
BindCheck()
Label10.BackColor = Drawing.Color.White
Label10.ForeColor = Drawing.Color.Green
Else
Label10.Text = "STATUS : " & StudentOutputData.STATUS_DESC
Connection.Close()
Label10.BackColor = Drawing.Color.Yellow
Label10.ForeColor = Drawing.Color.Red
End If
Else
End If
End Sub
Sub BindCheck()
Label2.Visible = True
Label3.Visible = False
Button4.Visible = False
Button6.Visible = False
Label4.Visible = False
Button5.Visible = False
Button7.Visible = False
Button2.Visible = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Connection As New SqlConnection(connStr)
Dim cmdAddType As SqlCommand = New SqlCommand("removeStudent", Connection)
cmdAddType.CommandType = CommandType.StoredProcedure
cmdAddType.Parameters.Add(New SqlParameter("@SName", SqlDbType.NVarChar, 255))
cmdAddType.Parameters.Add(New SqlParameter("@Counter", SqlDbType.NVarChar, 255))
cmdAddType.Parameters.Add(New SqlParameter("@Building", SqlDbType.NVarChar, 255))
cmdAddType.Parameters.Add(New SqlParameter("@aid", SqlDbType.NVarChar, 255))
cmdAddType.Parameters.Add(New SqlParameter("@user", SqlDbType.NVarChar, 255))
Dim OParm As SqlParameter = cmdAddType.Parameters.Add("@OReturn", SqlDbType.Int)
OParm.Direction = ParameterDirection.Output
cmdAddType.Parameters("@SName").Value = Fname & " " & MNAME & " " & lNAME
cmdAddType.Parameters("@Counter").Value = UCOUNTER
cmdAddType.Parameters("@Building").Value = ULOCATION
cmdAddType.Parameters("@aid").Value = txtUserName.Text
cmdAddType.Parameters("@User").Value = Session.Contents("name")
Connection.Open()
cmdAddType.ExecuteNonQuery()
Dim OReturn As String = cmdAddType.Parameters("@OReturn").Value.ToString
If CStr(OReturn) = "1" Then
lblOutput.Visible = True
lblOutput.Text = "Already this Student removed..."
Else
lblOutput.Visible = True
lblOutput.Text = "Student Removed Successfully... "
Connection.Close()
End If
End Sub
End Class
What I have tried:
<%@ Page Language="vb" AutoEventWireup="false" Src="removeCustomer.aspx.vb" Inherits="removeCustomer"%>
<title>Remove Customer
.style1
{
width: 62px;
height: 47px;
}
.style2
{
width: 114px;
height: 16px;
}
.style4
{
width: 114px;
height: 41px;
}
.style5
{
width: 62px;
height: 41px;
}
.style6
{
height: 47px;
}
.style11
{
height: 101px;
}
<ul id="flexmenu1" class="flexdropdownmenu">
<li><a href="ChangePassword.aspx"><%= Resources.Resource.Greetings34%></a></li><li><a href="NewUsers.aspx"><%= Resources.Resource.Greetings35%></a></li><li><a href="UserDetails.aspx"><%= Resources.Resource.Greetings36%></a></li><li><a href="Add_Building.aspx"><%= Resources.Resource.Greetings37%></a></li>
<li><a href="BlockCustomer.aspx"><%= Resources.Resource.Greetings38%></a></li>
<li><a href="AddStudent.aspx"><%= Resources.Resource.Greetings39%></a></li>
<li><a href="AddMeal.aspx"><%= Resources.Resource.Greetings40%></a>
</li></ul>
<ul id="flexmenu3" class="flexdropdownmenu">
<li><a href="ReadBarcode.aspx"><%= Resources.Resource.Greetings17%></a></li> </ul>
<ul id="flexmenu4" class="flexdropdownmenu">
<li><a href="Financial_Report2.aspx"><%= Resources.Resource.Greetings42%></a></li><li><a href="Financial_Report4.aspx"><%= Resources.Resource.Greetings43%></a></li><li><a href="MealReport2_MJM.aspx"><%= Resources.Resource.Greetings44%> </a></li><li><a href="Financial_Report3.aspx"><%= Resources.Resource.Greetings45%> </a></li></ul>
<ul id="flexmenu2" class="flexdropdownmenu">
<li><a href="BarcodePrint.aspx"><%= Resources.Resource.Greetings46%></a></li></ul>
<div id="topNav">
<ul>
<li><a href="MainPage.aspx" title="Home"><%= Resources.Resource.Greetings2%></a></li> <li><a href="#" title="Setup" data-flexmenu="flexmenu1"><%= Resources.Resource.Greetings29%></a></li> <li><a href="#" title="Read" data-flexmenu="flexmenu3"><%= Resources.Resource.Greetings30%></a></li> <li><a href="#" title="Reports" data-flexmenu="flexmenu4"><%= Resources.Resource.Greetings31%></a></li> <li><a href="#" title="Print" data-flexmenu="flexmenu2"><%= Resources.Resource.Greetings32%></a></li>
<li><a href="Login.aspx" title="logout"><%= Resources.Resource.Greetings33%></a></li> </ul>
</div>
<div class="inner_copy"></div>
<div id="body">
<div id="topShadow"></div>
<div id="bodyPannel">
<div style="width: 690px; height: 444px" id="container">
<h2><%= Resources.Resource.Greetings102%></h2>
<br><br>
<table style="width: 400px; height: 19px" id="Table1" border="0" cellspacing="4" cellpadding="4" width="466"><tbody><tr><td style="width: 62px">
<table style="width: 40px; height: 26px" id="Table7" border="0" cellspacing="1" cellpadding="1" width="40"><tbody><tr><td><asp:hyperlink id="HyperLink2" tabindex="7" runat="server" forecolor="Red"
="" font-size="10pt" tooltip="Add User" width="25px" font-names="Verdana" navigateurl="~/removeCustomer.aspx" designtimedragdrop="82" font-bold="True"><%= Resources.Resource.Greetings85%></td></tr></tbody></table>
</td><td colspan="2" align="left" valign="top">
<asp:label style="text-align:left" id="Label10" runat="server"
="" forecolor="Red" font-size="14pt" font-bold="True" visible="False" width="529px">Break Fast
<br>
<br>
<asp:datagrid style="Z-INDEX: 0" id="DataGrid1" runat="server" font-size="10pt"
="" width="300px" font-names="Verdana" cellpadding="4" borderwidth="2px" borderstyle="Dotted" bordercolor="Black" cellspacing="4" forecolor="#333333" gridlines="None" height="16px">
<edititemstyle backcolor="#999999">
<selecteditemstyle font-bold="True" forecolor="#333333" backcolor="#E2DED6">
<alternatingitemstyle backcolor="White" forecolor="#284775">
<itemstyle forecolor="#333333" backcolor="#F7F6F3">
<headerstyle font-bold="True" forecolor="#000000" backcolor="#748995">
<footerstyle forecolor="White" backcolor="#5D7B9D" font-bold="True">
<pagerstyle horizontalalign="Center" forecolor="White" backcolor="#284775">
<br>
</td></tr><tr><td style="width: 62px"></td><td style="width: 114px" colspan="2">
<asp:label style="Z-INDEX: 0" id="lblOutput" runat="server" font-size="10pt"
="" forecolor="Red" font-names="Verdana" width="500px"></td></tr><tr><td style="width: 62px">
<asp:label style="Z-INDEX: 0" id="Label1"
="" runat="server" forecolor="Black" font-size="12pt" width="147px" font-names="Trebuchet MS" height="16px"><%= Resources.Resource.Greetings103%></td><td align="left" class="style2">
<asp:textbox style="Z-INDEX: 0" id="txtUserName" tabindex="1" runat="server"
="" tooltip="Enter New User Name" width="200px" height="20px"></td><td align="left">
<asp:button style="Z-INDEX: 0" id="Button1" runat="server"
="" text="<%$Resources:Resource, Greetings107 %>" backcolor="#E7DBC6" borderstyle="None" height="30px" width="150px"></td></tr><tr><td class="style1">
<asp:label style="Z-INDEX: 0" id="Label5" runat="server"
="" forecolor="Black" font-size="12pt" font-bold="False" visible="False" width="150px"><%= Resources.Resource.Greetings88%></td><td colspan="2" class="style6">
<asp:label style="Z-INDEX: 0" id="Label6" runat="server"
="" forecolor="Navy" font-size="12pt" font-bold="True" visible="False" width="500px">Break Fast </td></tr><tr><td class="style5">
<asp:label style="Z-INDEX: 0" id="Label8" runat="server"
="" forecolor="Black" font-size="12pt" font-bold="False" visible="False" width="150px"><%= Resources.Resource.Greetings89%> </td><td colspan="2" class="style4">
<asp:label style="Z-INDEX: 0" id="Label9" runat="server"
="" forecolor="Navy" font-size="12pt" font-bold="True" visible="False" width="500px">Break Fast</td></tr><tr align="center"><td class="style11"><asp:textbox style="Z-INDEX: 0" id="TextBox1"
="" runat="server" visible="False" width="72px">
<asp:textbox style="Z-INDEX: 0" id="Textbox3" runat="server" visible="False"
="" width="85px">
</td><td class="style11">
<asp:label style="Z-INDEX: 0"
="" id="Label2" runat="server" forecolor="Navy" font-size="15pt" font-bold="True" visible="False" width="309px"><%= Resources.Resource.Greetings104%></td><td class="style11">
<asp:button style="Z-INDEX: 0" id="Button2" runat="server" font-names="Verdana"
="" font-bold="True" text="<%$Resources:Resource, Greetings106 %>" visible="False" width="150px" backcolor="White" height="30px" font-size="14pt" forecolor="Red">
<asp:button style="Z-INDEX: 0"
="" id="Button3" runat="server" font-names="Verdana" font-bold="True" text="<%$Resources:Resource, Greetings105 %>" visible="False" font-size="14pt" width="150px" backcolor="White" height="30px" forecolor="#33CC33"></td></tr><tr><td style="width: 62px"></td><td style="width: 114px"></td><td></td></tr><tr><td style="width: 62px">
<asp:textbox style="Z-INDEX: 0" id="TextBox2" runat="server" width="72px" visible="False"></td><td style="width: 114px"><asp:label style="Z-INDEX: 0"
="" id="Label3" runat="server" forecolor="Navy" font-size="15pt" font-bold="True" visible="False" width="200px">Lunch - Status
<asp:label style="Z-INDEX: 0" id="lblout" runat="server" forecolor="Red" font-size="X-Small" font-names="Verdana" font-bold="True"></td><td><asp:button style="Z-INDEX: 0" id="Button4" runat="server" font-names="Verdana" font-bold="True" text="NOT TAKEN" visible="False" width="150px" backcolor="#FF8000" height="40px"><asp:button style="Z-INDEX: 0" id="Button6" runat="server" font-names="Verdana" font-bold="True" text="TAKEN" visible="False" font-size="16pt" width="150px" backcolor="#C0FFC0" height="40px"></td></tr><tr><td style="width: 62px"></td><td style="width: 114px"></td><td></td></tr><tr><td style="width: 62px">
<asp:label style="Z-INDEX: 0" id="Label7" runat="server"
="" forecolor="#CC3300" font-size="12pt" font-bold="True" visible="False" width="150px">Extra Cash </td><td style="width: 114px">
<asp:textbox style="text-align :right" id="Textbox4" runat="server" visible="False"
="" width="200px" font-size="12pt">
<asp:label style="Z-INDEX: 0" id="Label4" runat="server" forecolor="Navy"
="" font-size="15pt" font-bold="True" visible="False" width="200px">Dinner - Status</td><td>
<asp:button style="Z-INDEX: 0" id="Button5" runat="server" font-names="Verdana" font-bold="True" text="NOT TAKEN" visible="False" width="150px" backcolor="#FF8000" height="40px">
<asp:button style="Z-INDEX: 0" id="Button7" runat="server" font-names="Verdana" font-bold="True" text="TAKEN" visible="False" font-size="16pt" width="150px" backcolor="#C0FFC0" height="40px"></td></tr><tr><td style="width: 62px">
<asp:dropdownlist id="ddlLanguages5" runat="server" autopostback="true">
<asp:listitem text="English" value="en-us">
<asp:listitem text="Arabic" value="AR">
</td><td style="width: 114px">
<asp:validationsummary style="Z-INDEX: 0" id="ValidationSummary1" runat="server" showmessagebox="True" showsummary="False" displaymode="List"></td><td>
<asp:requiredfieldvalidator style="Z-INDEX: 0" id="RequiredFieldValidator1" runat="server" errormessage="<%$Resources:Resource, Greetings99 %>" display="None" controltovalidate="txtUserName"></td></tr><tr><td colspan="3"></td></tr></tbody></table>
</div>
</div>
<div id="bottomShadow"></div><br class="spacer">
</div>
<%----%>