MVC :: Translate URL By Routing?

Sep 25, 2010

I use simple default route

routes.MapRoute(
"Default",
"{controller}/{action}/{id}");

The problem is that I want to translate some paths in my language but names of the controllers and actions should be leaved in english. For example I want to map URL "/wydarzenia/4/rejestruj" to "/events/4/register'. I tried

routes.MapRoute(
"Register",
"wydarzenia/{id}/rejestruj",
new { controller = "Events", action = "RegisterToEvent" });

But this doesn't work.

View 10 Replies


Similar Messages:

Social Networking :: Translate TextBox Text Using Google Translate API?

Apr 17, 2014

I want use Google API to Translate  the English to Marathi and vice-versa.

View 1 Replies

Web Forms :: Web.Routing Doesn't Work On Server On IIS Routing

Jul 20, 2010

I tried everything I could find, but still does not work on IIS routing.

View 2 Replies

Routing With Web Forms - Could Not Load System.Web.Routing

Dec 12, 2010

I am using:

ASP.NET 3.5 SP1 with Web Forms Routing thru Global.asax (System.Web.Routing and RegisterRoutes)IIS 7

Everything is working fine in my local machine, but it gives the following error in my hosting environment:

Could not load file or assembly 'System.Web.Routing, Version=3.5.0.0, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I did everything inside my web.config file mentioned in the following link:

[URL]

But I am still getting the above error.

What else am I supposed to do fix the error?

View 1 Replies

Rest WCF Url Routing & Web Forms Routing?

Feb 22, 2011

I have a Web application where i have added a reference to a RESTful WCF. I got the WCF url Routing to work in my webapplication by adding Inherits="RestService.Global" to the Web applications Global.asax.

<%@ Application Codebehind="Global.asax.cs" Inherits="RestService.Global" Language="C#" %>

But then i tried to create url Routing for the Web application and it does not work with the Inherits="RestService.Global" in the Global.asax. If i take it away it works fine. Is there a correct way to do this.

View 1 Replies

Web Forms :: URL Routing And Dynamic Routing?

Jan 31, 2011

I'm trying to create my own CMS and I've gotten a little bit stuck at the stage of URL routing.

I want clean URLs without extensions and I'd like to be able to create and modify them in a web based interface without any messing around with IIS or actual files.

I've seen how to create a static route, but for that I need to go into my Global.asax file and manually add it.I would like to have all of these routes stored in a database so that I can easily modify them later.

Does anyone know how this can be achieved?

Just for extra information, I will be attempting to create a feature so that if a path exists, but is later changed, a 301 redirect is created to the new URL, is this also possible? (My first problem is the main issue, but thought I might ask this as well just in case it makes a difference)

View 2 Replies

Handle MVC Routing Along With Webform Routing

Sep 2, 2010

How to handle asp.net mvc routing along with asp.net webform routing. I have merged my mvc app into my existing web application. In my web application i have implement routing as below:

routes.Add("View Product Details", new Route("Product/{City}/{Manufacturer}/{Name}/{ProductID}/{*ProductType}"));

Similarly i have implemented routing in mvc as below

routes.MapRoute("Product Details",
"Product/{City}/{Manufacturer}/{Name}/{ProductID}/{ProductType}",
new
{
controller = "Home",
action = "ProductDetails",
City= UrlParameter.Optional,
Manufacturer= UrlParameter.Optional,
Name= UrlParameter.Optional,
ProductID= UrlParameter.Optional,
ProductType= UrlParameter.Optional
});

How to handle both pages, as one is custom web form while other is asp.net mvc view?

View 1 Replies

Translate Vb.net To C# Of Property Use?

Sep 1, 2010

I have defined a property in a masterpage in vb.net.

I want to use the same code in a C# project, but I have no idea how to translate it. And yes Ive seen pages like: [URL]

and [URL]

Here's the code:

Public Property BreadCrumb() As String
Get
Return lblBreadcrumb.Text
End Get
Set(ByVal path As String)
Dim BreadCrumbBuilder As New StringBuilder
BreadCrumbBuilder.Append("<li><a title=""Home"" href=""/"">Home</a></li>")
If path <> "" Then
Dim a As Array = path.Split(";")
If a.Length = 2 Then
BreadCrumbBuilder.Append("<li class='active'><a href='" + a(0).ToString + "'>" + a(1).ToString + "</a></li>")
Else
Dim sfriendlyURLBuilder As New StringBuilder
For i As Integer = 0 To a.Length - 1
If i Mod 2 = 0 Then
sfriendlyURLBuilder.Append(a(i))
ElseIf i Mod 2 = 1 And i < a.Length - 2 Then
BreadCrumbBuilder.Append("<li><a href='" + sfriendlyURLBuilder.ToString + "'>" + a(i).ToString + "</a></li>")
Else
BreadCrumbBuilder.Append("<li class='active'><a href='" + sfriendlyURLBuilder.ToString + "'>" + a(i).ToString + "</a></li>")
End If
Next
End If
End If
lblBreadcrumb.Text = BreadCrumbBuilder.ToString 'globalfunctions.BuildBreadCrumb(path)
End Set
End Property

View 7 Replies

MVC :: How To Translate A View To Razor

Nov 15, 2010

I want to change my project to use razor syntax. How do I translate a view to razor syntax?

also, when I add a new view, I don't see an option for the view engine to use. Is there one?

View 4 Replies

Translate Website In Another Language?

Jun 4, 2010

I have developed a large business portal. I just realized I need my website in another language. I have researched the solutions available like

Used third party control on my website. (Does fit in my design. Not useful regarding SEO point of view. Dont want to show third party brand names.) Create Resource files for each language.( A lot of work required to restructure pages to use text from resource files. What about the data entered by the user like Business Description. )

I was thinking of a solution like a when a page is created on server side then I could translate it before sending back to client. Is there any way I can do that?(to translate everything including data added from databases or through a code. And without effecting design. )

View 7 Replies

Localization :: Translate Some Data In Other Language?

Feb 17, 2011

i am building a multi language website. static text i m translating using resource files, but data returned in dataset i am to bind with dropdownlist. i don't know how to translate that data and bind that. i have tried google translate element but it gives too many languages and i only need 3 or 4.

View 1 Replies

Localization :: Translate Some Text Using Globalization?

Sep 8, 2010

I am working on globalization project.In my search.aspx page I have PagedGridview.I has property called EmptyDataText which is set to "NoResults".(EmptyDataText="No Results")

How can I translate "No Results" Within EmptyDataText?I tried to create key both global and local resource file.

In my local resource I tried in search.aspx.fr-FR.resx I have
key called Search and its value is No Resu'dfd .Then in gridview I tried like

EmptyDataText=<%=GetLocalResourceObject("Search")
%>

But it is not working.

Then I tried using global resource

EmptyDataText=<%=Resources.Product.Seacrh%> where Product is resx(class)

<util:PagedGridView
ID="product"
runat="server" AllowPaging="true"
EmptyDataText="No Results"
AllowSorting="true"
PageSize="10"
OnPageIndexChanging="PageSearchResults"
AutoGenerateColumns="false"
OnRowCreated="HandleHeader"
>

View 1 Replies

Translate Login Button To French?

Apr 13, 2010

I tried some online transtation sites as well but I get different results that makes me unsure which one I should use. spell for me a text of Login button in French (for a User Name/Password page with the Login button).

View 3 Replies

Iframe Google Translate Code?

Jan 21, 2011

I am using following code to add a google translator to my page header. But if I move it inside page content its not displaying anything. How to get the same translator box in iframe.

<div id="google_translate_element" class="langSwitch"></div>
<script>
function googleTranslateElementInit() {

[code]...

View 2 Replies

Translate Numeric To Arabic Numbers?

Oct 5, 2010

how to translate the numeric to arabic numbers in label.. anyone?

here's my code:

passportlabela.Text = "" + drReaderb["DOC_NUMBER"].ToString() + "";

i want to translate the doc_number = 12345 in arabic numbers

View 1 Replies

Security :: Some Or All Identity References Couldn't Translate?

Jun 2, 2010

We use HttpContext.Current.User.Identity.Name to resolve the name of the currently loggen in user in the intranet sites we develop. Normally this works adequately, but we've recently encountered problems when installing an intranet on an IIS7.5 Server. The weird thing is that ASP.NET throws an error when executing an extremely simple page for debugging purposes:

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="[URL]/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%= HttpContext.Current.User.Identity.Name %>
</div>
</form>
</body>
</html>

The error is:

[Code]....

[IdentityNotMappedException: Some or all identity references could not be translated.] System.Security.Principal.SecurityIdentifier.Translate(IdentityReferenceCollection sourceSids, Type targetType, Boolean forceSuccess) +309 System.Security.Principal.SecurityIdentifier.Translate(Type targetType) +125 System.Security.Principal.WindowsIdentity.GetName() +154 System.Security.Principal.WindowsIdentity.get_Name() +42 ASP.test_default_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in c:inetpubwebsitewwwroot extranet estdefault.aspx:16 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +115 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +253 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +87 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240 System.Web.UI.Page.Render(HtmlTextWriter writer) +38 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4240

The beauty of it all is that an old school, classic ASP page that basically does the same thing doesn't throw an error, but just does what it has to do:

<%
response.write "Remote User: " & Request.ServerVariables("REMOTE_USER")
%>

This code simply delivers the name of the remote user. But the ASP.Net version doesn't deliver. The same server, same directory, same user. Different ASP version. Does anyone have an idea?

View 2 Replies

Localization :: How To Integrate Google Translate Api To Whole Website

Jul 15, 2010

I have included googles provided google translate script on websites home page, all it translated is just teh home page not the other pages on the website.I read about googletranslate.api, does any one has any info or an example how to embed teh google translate.api translate feature to whole website.

View 1 Replies

Forms Data Controls :: Translate Code To C#

Mar 17, 2011

translate this code to C#?

[Code]....

View 2 Replies

Localization :: Looking For Tool That Will Translate XML Content (using Google API)?

Feb 26, 2011

I have XML files that I would like to translate autamaticallly using google API.

Do you have good tools that do so?

View 2 Replies

Localization :: Translate Pages To Chinese Language?

Jan 12, 2010

We have a requirement wherein we need to translate all dynamic pages(i.e database driven pages) to Chinese language. Does .NET provide any API for this, or there are third-party APIs for the same. Which third-party is best recommended?

View 2 Replies

Social Networking :: How To Add Google Translate In Website

Nov 13, 2013

Is there any way to install google plugin's in .net. for e.g. if chinese wan't there content should display in there language then it should display on one click

View 1 Replies

Web Forms :: Url ReWriting Line Http://translate.google.com/?hl=en?

May 28, 2010

how i can rewrite url like this?translate.google.com/?hl=en

with out .aspx(or php)and with ?

like rewrite url www.mydomain.com/showcontent.aspx/pageid=1

www.mydomain.com/page/1 or like this

View 2 Replies

WebMatrix :: Translate Things Which Are Sitting In Microsoft.Web.Helpers.dll?

Feb 8, 2011

Is there a way to translate things which are sitting in Microsoft.Web.Helpers.dll? For example: to upload file tghe FileUploadHelper gets called and user is presented with two edit boxes plus 'Browse...' and 'Upload' buttons and 'Add more files' label - all this I'd like to translate as it looks really weird if I mix the languages on website.

View 3 Replies

Explicit Localization - Translate The Confirmation Message To Norwegian

Mar 2, 2010

when trying to translate the confirmation message to Norwegian i get the following error: Cannot have more than one binding on property 'OnClientClick' on 'System.Web.UI.WebControls.LinkButton'. Ensure that this property is not bound through an implicit expression, for example, using meta:resourcekey. i use Explicit localization in the following manner:

<asp:LinkButton ID="lnkMarkInvoiced" runat="server" OnClick="lnkMarkInvoiced_OnClick"
OnClientClick="<%# Resources: lnkMarkInvoicedResource.OnClientClick%>"
Visible="False" CssClass="stdtext" meta:resourcekey="lnkMarkInvoicedResource" ></asp:LinkButton>

here's the local resource file entry:

<data name="lnkMarkInvoicedResource.OnClientClick" xml:space="preserve">
<value>return confirm('Er du sikker?');</value>

if i remove the meta attribute i get the English text(default). how do i get the Norwegian text appearing without resorting to using the code behind? Update: removing the meta attribute prevents the exception from occurring but the original problem still exists. I can't get the Norwegian text to show. only the default English text shows.

Another Update: I know this question is getting old but i still can't get the Norwegian text to display.

View 3 Replies

DataSource Controls :: Linq To Sql Query / Could Not Translate Expression?

Mar 26, 2010

I have the following LINQ query which works correctly:

[Code]....

The following query, however causes an error:

[Code]....

"Could not translate expression 'Table(t_f2f_event).Where(e => ((e.EVT_START_DATE > Invoke(value(System.Func`1[System.Nullable`1[System.DateTime]]))) && (e.EVT_START_DATE < Invoke(value(System.Func`1[System.Nullable`1[System.DateTime]])))))' into SQL
and could not treat it as a local expression."

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved