How to get file name of any page regardless of URL? - asp.net

I would like to force SSL on certain pages around the site, like for login, registration etc. by specifying a string array and checking whether the current URL fits a certain criteria in a custom HttpModule.
It works well, as long as the URL correctly reflects the page, however I use routing tables, so some requests I point to login page, if a page requires login, and I end up with a login page on the screen and with an URL for members' area.
Is there a way to find the actual file name of a page?
Example:
http://www.mysite.com/login - file name is login.aspx, which is not reflected by the url.
http://www.mysite.com/members - file name is still login.aspx if a user is not logged in.

Instead of using the URL, could you use the class name?
If TypeOf(Page) Is LoginPage Then
End If

System.IO.Path.GetFileName(HttpContext.Current.Request.FilePath);

Related

Send information from elementor form to another page with the modified data

I'm building a wordpress site with elementor pro.
I want to make a form (in which you enter some numerical data as metric cubes and other numbers) that redirects you to another page where that data is transformed. How can I do that?
maybe you can use a template with html javascript linked by an external link button
When redirecting to the other page (eg: site.com/other-page) you could include the "numerical data" as a Query String directly in the redirected URL (eg: site.com/other-page?data=1234). Then, upon initial loading of the other page, the data can be retrieved from the URL

How to redirect a submitted Caldera Form to another page?

I created a form using the Caldera Forms plugin.
When submitted I want it to redirect to another page.
I've set up the Redirect Processor like in the screenshot below:
However when I submit my form I'm redirected to the current page with an additional parameter at the end.
ie. http://nsa/wordpress/?page_id=16&cf_id=17
How can I redirect to another page?
I was facing same issue, but just use absolution URL like /?page_id=16
mean don't use http://example.com (dont use domain name, just use the Page with "/")
so it could be /thank-you or /page_id=16

URL doesnot change after login in laravel

The URL of login page is localhost:8000/login.
and after login it remain same but i want to return the URL name as the name of form after login as view page like localhost:8000/company_details. can anyone help me for how will i redirect to company_details with compact('company','email') and what will be my route to redirect with these two variables.
Here is my code.
if (!empty($login)) {
return view('company_details',compact('company','email'));
}
Ok, after reading your edits, I have a better understanding of your problem.
What you are looking for are redirects: https://laravel.com/docs/5.3/responses#redirects
Right now, you are saying that when people visit /login, you do some login stuff and return a specific view. Nowhere in your code does it say change the URL.
What you do instead of returning a view, is you redirect the user (see link) to the url you want, or the named route you want. This way the users browsers gets a request to go to another page (/company_details in this case) and changes the url and get whatever you are serving at /company_details.

Google Analytics page url displayed wrong

In one of my client's sites in Google Analytics, under Site Content > All Pages, all the page urls are showing incorrectly, with the domain name placed after the page url.
Normally the homepage is displayed as /
in this case the homepage is displayed as:
/www.domain.com
and all other pages are the same, such as:
/shopping-cart/www.domain.com
does anyone know how to fix this?
Thanks
It sounds like a Filter was created to show the full domain name, but the variables for Hostname, $A1, and Request URI, $B1, got switched around.
Here is a screenshot of the filter I use with the variables underlined.
I also ran into this issue and saw that I had the Default URL setting set to our domain:
screencapture of default url field
This field is under View Settings. We had entered the domain in this field and it was appending it to pages because this field is intended for "index.html" paths.

If a page 'A' is opened, find out from which source page page 'A' has been called?

I am currently in "pageA.aspx". Using top.location.href or Response.Redirect(), I've come to "pageB.aspx". How to find out that which page has called "pageB.aspx". Is it "pageA.apsx" or any other page.
I aware of using URL Query-String. But I need to use any other option.
You can use Request.UrlReferrer.
Gets information about the URL of the client's previous request that
linked to the current URL.

Resources