Hi. i make a site with two language. Turkish and English. i try to do this.
for example i am in product page. my url is
.../product/man/tshirt. in english language. when turkish language is selected i want to change this url as ../urun/erkek/tshirt. my page controls changes correctly.(buttons'name, labels etc.) .
operator
Member
41 Points
143 Posts
change url on same page
Mar 14, 2012 03:36 AM|LINK
Hi. i make a site with two language. Turkish and English. i try to do this.
for example i am in product page. my url is
.../product/man/tshirt. in english language. when turkish language is selected i want to change this url as ../urun/erkek/tshirt. my page controls changes correctly.(buttons'name, labels etc.) .
i think that i must a routing module.
anyone has any knowledge or idea?
Thanks in advance.
stevenbey
All-Star
16526 Points
3378 Posts
Re: change url on same page
Mar 15, 2012 01:20 AM|LINK
Are you using WebForms or MVC?
http://stevenbey.com
Recursion: see Recursion
operator
Member
41 Points
143 Posts
Re: change url on same page
Mar 15, 2012 02:14 PM|LINK
i use webforms
stevenbey
All-Star
16526 Points
3378 Posts
Re: change url on same page
Mar 15, 2012 02:23 PM|LINK
You marked the thread as answered. Have you resolved your issue?
http://stevenbey.com
Recursion: see Recursion
operator
Member
41 Points
143 Posts
Re: change url on same page
Mar 15, 2012 02:46 PM|LINK
stevenbey
All-Star
16526 Points
3378 Posts
Re: change url on same page
Mar 15, 2012 03:48 PM|LINK
Are you able to use Routing?
http://stevenbey.com
Recursion: see Recursion
operator
Member
41 Points
143 Posts
Re: change url on same page
Mar 15, 2012 03:57 PM|LINK
i use urlrouting on .Net 4.0
stevenbey
All-Star
16526 Points
3378 Posts
Re: change url on same page
Mar 15, 2012 04:02 PM|LINK
Yes, what version are you using?
http://stevenbey.com
Recursion: see Recursion
Allen Li - M...
Star
10411 Points
1196 Posts
Re: change url on same page
Mar 20, 2012 03:28 AM|LINK
Hi, you can set your route rules in “Global.asax”, for more information, please refer to:
http://msdn.microsoft.com/en-us/library/cc668201.aspx
And then, please add a DropDownList to your page, for example:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Text="Please select your language"></asp:ListItem> <asp:ListItem>English</asp:ListItem> <asp:ListItem>Turkish </asp:ListItem> </asp:DropDownList>In your C# codes, please add the following event handling codes:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (this.DropDownList1.SelectedIndex==1) { Response.Redirect("product/man/tshirt"); } else if (this.DropDownList1.SelectedIndex==2) { Response.Redirect("urun/erkek/tshirt"); } }If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework