facebook application asp.net javascript file errors - c#

I have created asp.net application and hosted on facebook.
but i cannot refer the javascript files .
they are referred in aspx pages as "Scripts/Jquey.js"
but while rendering application page in facebook.
it tries to look for.
url/page.aspx/Scripts/Jquery.js
which it cant find.
how to overcome this

If your path is relative to the root you should include the tilde, otherwise it will just be treated as relative to the page itself i.e. ~/Scripts/Jquery.js.

Related

Firebase hosting for .NET Web Forms

I'm trying to deploy a Web Forms app using the Firebase. I know it offers the SDK for .NET Framework 4.5+ and I'm using this documentation to set it up. I managed to run the hosting and access the page, where it can navigate among the HTML files within the public directory. I moved the .aspx (and .aspx.cs) files into the public directory and redeployed, but the .aspx page is displayed like a text file with all the <%: property %> tags printed as is. See screenshot below using the Wingtip Toys sample from Microsoft documentation.
I'm lost whether firebase doesn't support .aspx, I set up something wrong, or if the documentation lacks important information.

Make login page on root of website

Using asp.net how would you achieve having the login page on the root of the website so for example, the login page to be on www.helloworld.com rather than having a separate file for the login www.helloworld.com/login.aspx
Does any understand what I am trying to do?
Additional information:
Just to give you some examples, look at this website www.torn.com then look at this one www.mobslife.com.. Notice how the url for the login page is just www.torn.com but on www.mobslife.com it is www.mobslife.com/login.php
If the site uses Web Forms and IIS has the standard set of default pages defined, then you can use file Default.aspx under the root directory of the web site to implement the login form.

Load asp.net website inside winform C#

I have a(n) (MDI) Windows Form application. It contains two forms. One form (Measured data) controls an engine, another form (laboratory) should show my asp.net web site that has various assignments for the user to do.
How can I show the asp.net default page in that laboratory form? I'm using awesomium to make a browsing window in my laboratory form.
Doing the following
webView.LoadURL("file:///D:/school/4e%20jaar/Erasmus/ErasmusProject/Laboratory/deault.aspx");
gives an error. Probably because the asp.net site isn't online. but how can I run the site so I can see the default.aspx page?
I have on solution with three projects
ErasmusProject
ASP.NET website
SIMOclasses
SIMOForm
The problem is you cannot execute aspx files with file:/// path.
You have to execute on IIS.
So first thing you have to do setup iis if you didnt, create new web site (or use Default Web Site) to execute your aspx files, than change your link file:/// to http://localhost or something.
The URL you've specified looks like its accessing the raw file via the file system. i.e. file:///D:/.../default.aspx.
(You've also misspelt 'default' in your question!)
Can you access that URL from a browser (e.g. IE, Firefox, etc) and see the content you want? I suspect you can't and that you're missing the webserver that is compiling and serving the .aspx pages.
You should host your website first :
WebDev.WebServer /port:9999 /path:"C:\Projects\MyWebSite"

ASP website not rendering style when redirected to log-in?

I am a little lost of why my log-in page is not rendering the styling when the default page is redirected to it.
1: is the page I get when I load my website from VS.
2: is the page I should get. (I do get the styling when I enter the log-in page direct URL)
What do I have to do to fix this?
Is it possible that css file is generated from a asp page? The default webserver from VS doesn't support asp files.
Things you can check: is the css file called? (network inspector)
Is the html of the login page completely valid?
Is it an internal redirect or external redirect? A internal redirect can have a different location and therefore maybe unable to locate the css file.
Make sure that the path to your CSS file is correctly specified in your login page.

Is it possible to have a .NET route that maps to the same place as a directory?

I'm building a CMS using WebForms on .NET 4.0 and have the following route that allows URLs like www.mysite.com/about to be mapped to the Page.aspx page, which looks up the dynamic content.
routes.MapPageRoute("page", "{name}", "~/Page.aspx");
The problem is that I have a couple of folders in my project that are interfering with possible URLs. For example, I have a folder called "blog" where I store pages related to handling blog functionality, but if someone creates a page for their site called "blog" then navigating to www.mysite.com/blog gets the following error:
403 - Forbidden: Access is denied. You
do not have permission to view this
directory or page using the
credentials that you supplied.
Other similar URLs route correctly, but I think because .NET is identifying /blog as a physical location on the server it is denying directory access. Is there a way to tell IIS / .NET to only look for physical files instead of files and folders?
It looks like IIS is denying you access to the actual folder.
By default Routing is supposed to honor the file system. Though this can be turned off.

Categories