Silverlight got http302 error after login successfully in iframe - silverlight

I have one silverlight 4 application which contains one iframe to show aspx pages. The silverlight app and the application in iframe, both are hosted in the same web server.
First, there are two login.aspx pages. One is in silverlight app, other is in another site which is embedded in iframe. My silverlight app will be loaded first and login successfully for silverlight app.
Then, in my silverlight app, there is one link button to load the aspx page into iframe.
When I access the aspx page in the iframe at the first tim, it will go to its login.aspx and login successfully. After that, I go back to the silverlight app, i immediately get the http 302 error. But the duration between i access aspx page and the silvelight app, not bigger than the time of session timeout.
So could anyone be able to figure out what can make the error?
P.S. It only occures after aspx page logins successfully. If I do not touch the aspx pages in iframe, just acces the silverlight pages, it will have no error.

Today found the root cause and resolved it. It is due to the two applications are placed into same machine. Then, the second login will overwrote the authentication cookie of the first login. (It meant to call the sencond's FormsAuthentication.SetAuthCookie() will overwrite the first ones.) So the solution is very easy. Just to make their authentication cookie name different:
`
<authentication mode="Forms">
<forms name=".SecondAuthCookie" loginUrl="login.aspx"
defaultUrl="default.aspx" />
</authentication>
`

Related

WebView2 control is not downloading the image files or any JS file mentioned in the page which we try to view in control

For my single page application, I would like to view the web pages of the angular application in the EdgeView2 control from the wpf application.
As you know, the single page application has js files in the index.html page. When I provide the website link in the Edgeview2 control of my windows app, it is not showing the complete web page.
I ran Fiddler to trace the request and response. There I saw that the JavaScript files are giving notFound http status. The same page is viewed from the browser properly where all the js files and images are downloaded and the page is functioning correctly.
Could anyone please help me?

How to generate .xap files in silverlight

I have a silverlight application with 2 pages, first is "animation" and second is "transformation"
first page works well, but second display nothing and i think the problem is: i don't have any transformation.xap. I only have have the animation.xap in my "clientBin" data for some reason
So here is my question: can i generate a .xap file for my transformation page so it can works?
Both pages are stored withing the same Silverlight application.
If you want to switch between pages you'll need to either:
Create another project that contains the transformation page and
redirect the browser to the page hosting it
Switch pages by setting the application's RootVisual to the page you want displayed

FB.init (of Facebook web app) doesn't seem to get called when running on mobile

I have a Facebook web app that runs on canvas. The canvas URL is configured as http://apps.facebook.com/myApp (example). This URL has an FB.init that helps me identify and login the user by getting his name and FB user id. This app runs fine on a PC or a laptop.
This page is very simple with some JavaScript but with routine HTML tags like <p>, <input>.
I configured the same URL as Mobile Site URL under Mobile Web. Since then I can now see the link for this app on my mobile device (an Android phone). But when I click on the link, the first page of the app opens in my mobile browser but it seems that FB.init can't run there. I can't get the user id and use name.
What is the reason and what is the solution, i.e., how to make the same app run on users' mobile phones?
Thanks.

Get session of DNN in aspx file

I write a standalone aspx file and upload it to DNN website. I add a html module and make an iframe to that aspx file. How I should check DNN user login or not in aspx file? I think there are something in Session but it is empty when I print it out on aspx page.
The aspx file executes outside of DNN. There is no context for you to work with. A much better approach is to turn your .aspx into a .ascx and derive from PortalModuleBase as the start of a DNN module. You can add a proper module to the page and permission the module as you see fit and DNN will take care of all the authentication and authorization details for you.
A starting point for module development
I don't recommend it in this situation, but you can also emulate the approach I described for getting context in a web service.
https://stackoverflow.com/a/9164573/51851
If your aspx is within DNN's website you can simply use Request.IsAuthenticated to check if user is logged in or not.
But be warned, if you have friendly URL turned on - DNN 5x and above will hijack you aspx request.

Silverlight navigation problems under IIS

I’m totally confused.
I’ve hosted my app under IIS on my machine (windows 7). If then I open IE and enter "http://localhost/MyApp.aspx#SomePage" it will really open the app and then navigate to that “SomePage” page. If then I’ll navigate to another page, address bar updates accordingly (i. e. "http://localhost/MyApp.aspx#SomeOtherPage"). So everything is fine.
But if I enter in browser "http://mypcnetworkname/MyApp.aspx#SomePage" it simply opens my app with the default page and doesn’t navigate to SomePage. If then I'll navigate to another page, address bar also doesn’t update. Navigating through screens doesn’t update nor history frame not address bar and vice verca — looks like browser navigation is disconnected from silverlight navigation (but I’m still able to navigate through application using hyperlinkbuttons in it).
What can I do to make it work? I guess it’s more iis configuration problem (however everything is default, except mime type for silverlight) than related to silverlight.
P. S. It’s an silverlight 4 app but I do have silverlight 5 installed on my machine.
one way to get around this would be use asp.net to write SomeOtherPage to the launch paramters of the html object.
You then can parse these values when you launch the application and make the switch your self in silverlight
heres a link on passing paramerters: Link

Resources