I have different .aspx pages for English and arabic. eg. for ContactUs page i have Contactus.aspx for English and ContactUsAr.aspx for Arabic. In these pages data is coming from the table from database. For English Default Page(Main page) is DefaultEn.aspx and for arabic Default page(main page) is Default.aspx. If any one is on any English page and he is clicking on Arabic then i am redirecting to him Default.aspx. similarly if any one is on any Arabic Page and he is clicking on Arabic then i am redirecting to him DefaultEn.aspx. Here my requirement is that if any one is on English ContactUs page(ContactUs.aspx) and he is clicking on Arabic then how i will redirect to him Arabic Contact Us page(ContactUAr.aspx) or if he is on Arabic Registeration Page(RegistrationAr.aspx) and he is clicking on English then how i will redirect to him English Registration(Registration.aspx) page.
My code is given below:
<select id="language">
<option value="Arabic" style="font-weight:bold"> العــربية </option>
<option value="English"> English </option>
</select> <br/> <br/><asp:HiddenField ID="hdnLanguage" runat="server" Value="0" />
<center><input class="sub" type="image" src="images/submit_btn.jpg" name="submit" id="submit" value="Submit" onclick="javascript:getLanguage(); return false;" /></center>
</div><!--close box-->
-----------------------------------------------------
<script language="javascript" type="text/javascript" >
function getLanguage() {
if (document.getElementById('language').value == 'Arabic') {
window.open("Default.aspx?lan=ar_Ar", '_self');
return true;
}
else {
window.open("DefaultEn.aspx?lan=en_Us", '_self');
// window.open("document.referrer?lan=en_Us");
return true;
}
}
</script>
what i will have to do get my requirement.