Background Image disappearing ASP.NET Core Web App - c#

I have developed an application that allows file uploads and downloads with ASP.NET Core Web app (razor pages not controllers). In this app, I am setting a background image on each page as globally it doesn't work but something strange is happening with it.
On Initial login, the homepage background shows fine(see first image), but as soon as you switch to a different page and go back, its like it loses part of its URL? The original URL for the site image on initial login was http://ip.address/PORTAL/hero-range-1.jpg but when switching pages its like it loses the /PORTAL/ part? (see second image)

background-image: url('hero-range-1.jpg I would use background-image: url("http://ipaddress/PORTAL/hero-range-1.jpg")

Related

Refreshing current browser within iframe

I created a Registration Page in MVC 7 for a company but they only implemented the page as an iframe so once the user is successfully registered I redirect my created page to their home page but because this was implemented as an iframe, only the iframe loads the homepage so it looks like the website is inside itself. My page is also hosted on a different service as the website they implemented the iframe on. I do not have access to the current website's back-end so I was wondering if there was a way to refresh the entire website and not just the iframe. If anybody has some advise on how to do this using any method allowed on MVC I would appreciate that.

hidding the eye icon in IE10 inside an IFrame

I have two applications. The first is used as an internal user management application that was developed to for multiple applications to use as a central authentication service. It is placed in an IFrame inside the second application. The second application is the application users are logging into after they have been authenticated.
My problem is the show password eye icon in IE10. I have the CSS code in the central authentication app to hide the eye icon.
.input::-ms-reveal
{
display:none;
}
When I run just the central authentication app, the eye icon is hidden. However when I run the second app, with the central authentication app inside an IFrame, the CSS appears to be overridden and the eye icon is visible.
Has anyone encounter this before and what was your solution?
Depends on how you are implementing the IFrame. You need to make sure that page that is located in that IFrame is also pointing to that same CSS.
It's bad practice, but appending !important to the rule might cancel out whatever is causing it to not apply your rule. e.g.
.input::-ms-reveal
{
display:none !important;
}

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"

Link in winforms application which redirect to http page in default browser

Is it possible to add to the winformac application link control something which, when clicked, redirects you to the default browser with page opened for example google.com?
Launch a URL from a WinForms app

Magic with URL in asp.net - 3.5

This is my dilema:
My web site done in asp.net 3.5. I have buttons which if the user clicks should show images. The images are located at a third party and accessible via web url. So my app has to login to this third party app and they will return a url to me which i should then do a response.redirect in my website and show the user images
Think of it as have your own web page. you want to displlay images from yahoo and you need to log on to yahoo and all you have is a web address and know that it takes in username/password as either form elements or you could do yahoo.com?username=blah&pwd=doe
This would in normal sense take you to your yahoo home page and the login call also returns you a random file path which you use in your asp.net app and perform magic so that your web page is now redirected to yahoo.com/username/randomfilepath, which is basically a thumbnail page of your images.
i have tried doing this webrequest and then performing a response.redirect once i got the response back but that was a show stopper.
You might want to think about doing this inside of an IFrame. I did some facebook work which required the user to login to their facebook account. Then facebook returned to a my page at a url i specified.
What I did was create an IFrame then using the JQuery Dialog plugin showed the iframe, had that iframe postback to a FinishedLoggingIn.aspx page, then from that page I called window.top.someJavascriptToDisplayImages(someJsonWithImages);

Categories