ASP.NET MVC: how to parse url string to get RouteData [duplicate] - asp.net-mvc-2

This question already has answers here:
How to get RouteData by URL?
(2 answers)
Closed 8 years ago.
Is there any way to get RouteData from a url string?
I have login form with returlUrl as query string parameter.
My routes are defined as : {languageCode}/{controller}/{action}
In action method LogIn(string returlUrl) the returlUrl is something like "en/home/contacts" etc.
I need to change languagePart a i dont want to use string.Replace, as routes may change in future.
Thank you.

So this is an old thread obviously, but for anyone else coming to this question via Google, I just wrote a blog post about a way to do this pretty easily. I actually came across this question on SO when I was attempting to find a way to do this myself but I didn't find one that I liked so I wrote my own.
Creating a RouteData Instance from a URL

This forums thread might be useful: http://forums.asp.net/t/1281667.aspx
This is the best option I can think of off the top of my head. Bascially, using RouteTable.Routes.GetRouteData and Mocking HttpContextBase based on your Url string.

Related

Unable to do any action after switching to a new window using Karate [duplicate]

This question already has an answer here:
Switch Page Karate UI issue
(1 answer)
Closed 1 year ago.
I am not able to proceed with performing any action after switching to the new window.I am using 0.9.6
Then switchPage('Page Title')
karate.log("driver.url", driver.url) [gives me the new window url]
below is where it fails since it did not identify the locator
And waitFor('locator on the new page') [Fails]
I know there was a similar issue posted last month but with no resolution. Since I am not able to comment on it, I had to post a new question.
Karate-UI automation : Able to Switch page but not able to identify elements on that new page
Please try 1.1.0.RC2 and confirm if it is fixed: https://github.com/intuit/karate/issues/1606

Setting up Dynamic Links in Firebase with Wordpress site

I am really struggling here... All I actually want to achieve is that I can get the Generate-Strong-Password function inside my app but that is actually harder than I thought.
I learned that I should go with Firebase Dynamic Links because I have a Wordpress-Website from All-Inkl.com.
I followed this Tutorial and there is actually an Apple-Site-Association-File at the moment. But I can't access my Website anymore as it looks like this:
Inside my Firebase Project I am getting this error which says that there not all the necessary "A-Files" are inside my Website:
My DNS-Settings:
I've been struggling for weeks now to get this done so if anyone has any idea how I can fix it I would be extremely grateful!! (btw, I am a total newbie when it comes to websites; I know my way around Swift though)
It seems that different domain providers accept different values for DNS entries ('A records' = 'A-Datensätze', in this case).
Try editing the entries for the Host field (which currently hold your website's URL) to one of the 'common inputs' listed here: https://firebase.google.com/docs/hosting/custom-domain?hl=de#domain-key
As the URL to your site doesn't seem to be what your provider accepts, I would suggest you try replacing it with the next option, i.e. replacing it with # .
Hope this helps solving your issue!

How to create API with Dart?

I am currently creating a Flutter plugin, but I'm stuck in creating API.
This is an API that I want to create. (Java Example)
JAVA
PeterWorks.UserProperties userProperties = new PeterWorks.UserProperties();
userProperties.setAttrs("user_nick", "peterPark")
.setAttrs("place","Seoul")
.setAttrs("height",180)
.setAttrs("married",false);
Can you give me a sample that how to create that API with Dart?
Thanks.
You should check the types of topics that are normally allowed here, as this is borderline and others my outright flag it. In general, you should be posting specific questions showing what you've actually tried and not "build it for me" questions.
That said, here is a link (no affiliation) I referenced a while ago that focuses on building a basic backend server using Dart. See the second example.

Profile picture URL using http://graph.facebook.com/{social network id}/picture?type=large not returning profile pic actual profile picture [duplicate]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I have an issue now, suddenly all url image from facebook graph API in my database return a default image look likes this:
Example url :
http://graph.facebook.com/{user-id}/picture?type=large
It is a known bug (which could also mean that it will not be possible anymore in the future):
https://developers.facebook.com/bugs/2054375031451090/
You should subscribe to the bugs and wait.
Update: You can make it work by adding an access_token to the API call, but you should only do that server side, of course. An App Access Token should be good enough:
https://graph.facebook.com/<userId>/?fields=picture&type=large&access_token=...
Update 20.04.2018: It seems like picture URLs are working without an Access Token again: <img src="https://graph.facebook.com/[app-scoped-id]/picture" />
Please add access token parameter in the url
https://graph.facebook.com/id/picture?type=large&access_token=faskfjsld
This will work for sure.
There is an update here:
https://developers.facebook.com/bugs/2054375031451090/
I just tried and it works, by simply appending your access token to the URL link.
So this:
https://graph.facebook.com/<userId>/?fields=picture&type=large
Should become like this:
https://graph.facebook.com/<userId>/?fields=picture&type=large&access_token=...
Hope it helps!

Custom macro for NSLocalizedString [duplicate]

This question already has answers here:
Custom NSLocalizedString?
(7 answers)
Closed 9 years ago.
This question is regarding the localization from inside the app.
There are several blogs/tutorials that really helps and show the way to do it.
The ones which i referred to implement it are as below:
http://learning-ios.blogspot.in/2011/04/advance-localization-in-ios-apps.html
http://www.pastie.org/1976594
I am able to achieve it (with the help of such blogs.. thanks to them).
But i was trying one thing and i had a little doubt regarding the same as below
I am trying to create a same macro as the NSLocalizedString
[i.e. NSString *NSLocalizedString(String *key, String *value)]
but with a different macro name
something like
[NSString *getLocalizedString(String *key, String *value)] in my class and try to just replace NSLocalizedString method with my own macro using the same.
But a serious doubt/concern that i have is, is this technique/way approved by APPLE?
i mean.. can/will this violate the apple terms of non usage of Private API or kind of overriding the same??
Coz i have tried check the same in various blogs.. but was not able to find any specific answer to the same.
Can you please confirm if this can violate the T&C of APPLE or can i go ahead with the custom macro approach?
If possible can u also provide the link/blog/tutorial from which i can understand it better?
Thanks a lot in advance.
I don't see how this is using any kind of private APIs. -[NSBundle localizedStringForKey:] is a public API. You can write whatever macros or functions you want that call it. You can even #undef NSLocalizedString and replace it with your own definition if you want, it's just a C macro.
This won't violate Apple's terms. In fact, they recommend you do this to test your app and make sure you translated all the strings. They demonstrated how to do this in the 2012 WWDC video, session 244 Internationalization Tips and Tricks at the 23:50 mark.