Web Forms :: Restrict Page To Certain Referrer?
Mar 30, 2010
I have a page which I only want to be accessable via a certain other page.Example, PageTwo.aspx can only be accessed via PageOne.aspxAll other referrers redirect to asp.netCan this be done in asp?
View 2 Replies
Similar Messages:
Feb 22, 2010
We have a scenario whereby we are hosting an ASP.NET MVC web site on behalf of someone else.The customer in this case wants us to restrict access to the web site, to those users who have logged in to their main portal. They should then only be able to get to our web site via a link from that portal.At this point I'm not yet sure what technology or authentication mechanism the 3rd party are using but just wanted to clarify what the possible options might be.If we call our hosted site B, and their portal web site A,as I see it we could:Check the referrer for all requests to B, unless they've come from A they can't get inCheck for a specific cookie (assuming A uses cookies)
View 2 Replies
Sep 9, 2010
I'd like to capture the http referrer url following the rendering of a custom error page.I have this set in my web.config
<customErrors mode="On">
<error statusCode="500" redirect="/StaticError.aspx" />
</customErrors>
In the OnLoad(EventArgs e) event -- I'm trying to do this, but it appears to be too late.this.txtReferrer.Text = Request.UrlReferrer.ToString();Is it possible to capture the referrer url?
View 1 Replies
Jan 22, 2010
I am using C#. Below is my sample code.
private void Page_Load(object sender, System.EventArgs e)
{
string str = Request.UrlReferrer.ToString();
Label1.Text = str;
}
The result in Label1.Text is http://localhost:82/data/WebForm1.aspx.Now I want the result "WebForm1.aspx" in Label1.Text
View 2 Replies
Oct 12, 2010
I have a master page containing menu items and if i click on any menu item then postback happens(it's not an asynchronous postback) that page loads in the content area. Now, if the page has taken some time to load and the user again clicks some other menu, then at some cases, it is crashing. So what i want to do is when postback is happening, I want to restrict the user to click anywhere on the master page or content page. We have achieved this on asynchronous postback.... But cant find a solution during postback.
View 6 Replies
Sep 1, 2010
What is the best way to restrict the user from going to the previous page after logging out?
View 2 Replies
Mar 21, 2011
Am building an dll which contains a function called geturl(Uri myuri), Uri as parameter. Basically i want to get the url of the page which calls this function(function is located on DLL). I have used the below code, but am not sure the page url can be overrided //In default.aspx //class declaration myclass mc = new myclass(); Uri ur = Request.Url; string str = mc.geturl(ur) //In DLL public string geturl(Uri myuri) { Uri MyUrl = myuri; string requrl = MyUrl.AbsoluteUri.ToString(); return requrl; } So my question is can the Uri on the default.aspx be assigned with custom url as [URL] instead of http://localhost/test/default.aspx
View 4 Replies
Aug 24, 2010
I want to be able to restrict page access in a web application deployed in IIS 6.0. Say my web applications has these pages:
a.aspx
b.aspx
c.aspx
d.aspx
The proper way to access is [URL]" From a.aspx the other aspx pages could be loaded. What I want to be prevent is someone typing in: [URL]
View 2 Replies
Sep 17, 2010
I feel like i've done this a ton of times, but i can't for the life of me figure out what is going wrong.
Default.aspx:
protected void Page_Load(object sender, EventArgs e)
{
var r1 = Request.UrlReferrer; // null
var r2 = Request.ServerVariables["HTTP_REFERRER"]; // null
}
SingleSignOn.aspx:
protected void Page_Load(object sender, EventArgs e)
{
Response.Redirect("/");
}
If i type "/SingleSignOn.aspx" in the URL, it redirects to Default.aspx, but the referrer is null.
What am i missing here?
What im trying to do (this is a simplified example), is on any page, i will have some JavaScript to do the following:
window.location.replace('~/SingleSignOn.aspx');
Which, you guessed it, signs the user in, and redirects to the homepage.
But i need to build logic into that JavaScript to not redirect to the SingleSignOn.aspx page if we just came from there.
Does the referrer only get populated by actual link user clicks?
How can i do this then? I don't want to use QueryString because i dont want to see that in the URL.
View 2 Replies
Jul 8, 2010
I am doing a 301 permanent redirect from an old server to a new server. When the new server's page is hit I want to be able to determine whether the user comes from the old site and then react differently, i.e. instruct user to re-book mark the new page.
View 2 Replies
Nov 12, 2010
I am making an online exam website where a user is taken to a page where there are multiple choice questions. I want to set it up so that once a user navigates to this exam page, he cannot navigate back. The only way he can get out of it is by clicking the submit button and then he cannot access that page again. The questions on the exam page are in an sql database. restricting the navigation of the page.
View 2 Replies
Feb 10, 2010
I'm currently testing my application and am stuck on trying to figure out how to create a custom fake URL referrer. I've tried to hard code it, but am getting an error that it is read-only. Here is what I've tried so far:
fakeController.HttpContext.Request.UrlReferrer.AbsolutePath = "http://www.yahoo.com";
as well as,
fakeController.Request.UrlReferrer = "http://www.yahoo.com";
I've searched the web for some ideas on how to create a fake/mock URL referrer for my fake controller, but have had no luck.
Note: I'm using Visual Studios built-in unit testing facilities.
UPDATE:
I would be more than willing to use any other unit testing system outside of Visual Studio, unfortunately here at my work we are only allowed to use Visual Studio's built-in system, so I gotta work with what I've got.
View 3 Replies
Jan 14, 2010
when i would like to restrict files to access only on my Test page , here i am retriving my files in iframe in Test page, problem occurs when a user authenticated themselves then they will be redirected on welcome page and he can access my files through welcome page on Browser by knowing my Folder Name. but i do'nt want to give permissions to access on welcome page using IBrowser i only want to give my files(.mht files) that should be accessed on iframe.
this code as shown below doing pretty well in Visual studio "Debug mode but when i deploy this on iis 7.0 then it is not restricting my .mht files so please help , if you have any othe idea to protect then please give me .
[code]....
View 7 Replies
Jul 14, 2010
I need to get the calling page url referrer and host name. I works for me if the calling pages are within the same network. When a page is called from an internal site that are outside of my network, I got the following error:
Object reference not set to an instance of an object.
It failed on this line:
string userURL = Request.UrlReferrer.ToString();
View 1 Replies
Feb 4, 2011
I have folder in my asp.net website ..namely admin
i have following pages inside admin folder ... login.aspx, home.aspx, welcome.aspx ...
i want if user directly open page ... welcome.aspx or anyother page inside admin folder then it automatically redirect to login.aspx till they login using admin id and pass ...
how to do this setting in web.config...using authorization vb.net
View 1 Replies
Dec 6, 2010
When I use WatiN to go to a specific web page, how can I fake the HTTP referrer with a query string (i.e. request is from google search with query string q=search_term)? So I can verify that the response header has the 301 redirect for specific referrer URL.
View 2 Replies
Jan 20, 2011
I've got textboxes for dates, and they are hooked up to the jquery datepicker. I would like to disallow actual typing into the text boxes, forcing the datepicker UI to be the *only* method of populating the textbox. I tried setting the textbox to readonly, but that ended up not passing the on-screen-displayed datepicker-selected date back to the server, and hence not saved.
View 4 Replies
Feb 24, 2011
I have a requiredfield validation control and only want it to be triggered when a certain button is clicked instead of any button that causes a post back. For example I have 2 buttons in an updatepanel and I don't want these to cause the validation since the entire form is not being posted back.
View 3 Replies
Apr 15, 2013
Developing online car booking application.. I have a scenario for restricting only 10 bookings daily.
View 1 Replies
Jan 7, 2011
On my web page i have to restrict content selection if user drag mouse on page, as on normal page have enable that if user try to drag mouse then content will get select.
I have found javascript for same and apply it, its running well for IE and i have found css tag for Mozzila to restrict content selection, both working well,but now what i want , on my web page i have textboxes, due to apply JS and CSS user also can't able to select text from textbox..and i want to allow to select content from textbox.
window.onload = function () {
document.onselectstart = function () { return false; } // ie
}
CSS
Body
{
-moz-user-select:none; // Mozzila
}
View 2 Replies
Jun 30, 2010
I am planning to make a membership-oriented website where users are allowed to upload files to their accounts, which have a limited amount of space.I can surely see a code-oriented solution (with a database holding the size of each file), but I was wondering whether it's possible to restrict folder sizes with Windows or ASP.Net (web.config?). I don't really think it's possible through the web.config,
but I'd still like to ask the community.Does anyone know what's the best way to implement the above?
View 1 Replies
Oct 26, 2010
If a user use back button of a browser and make any change on that webform then how can i restrict him to do so.I my case its a quiz and i don't wanna allow user to change his answer
View 3 Replies
Jul 21, 2010
i want to restrict user from clicking submit button multiple times without disableing the button .
let me know how can we do that.
View 8 Replies
Jul 31, 2010
I have generated dynamic text boxes for each table row there are 6 text boxes
1. For the first two text boxes the values given by the user should be in valid range(this range comes from the database).User is allowed to enter the value within that specified values only. How to achieve this? I have taken drop down lists but if the values in drop down increases selecting required value is tedious to the user.. (if it is having 1000 values) and while I am retrieving the values I have written query such as Null values ignored. But I am getting NULL values in the dropdown here is the code what I have written,
(Database is Oracle)
If
Not (OledbCmd.Equals(String.Empty)
Or OledbCmd
Is
Nothing)
Then
OledbDA.SelectCommand = OledbCmd
OledbDA.Fill(ds, "textDB")
dt = ds.Tables("testDb") If
(dt.Rows.Count > 0) Then
ddlist.DataSource = dt If UCase(s) =
"NUMBER"
Then
ddlist.DataValueField = "num"
ElseIf UCase(s) =
"NAME"
Then
ddlist.DataValueField ="name"
End If
ddlist.DataBind()
ddlist.Items.Insert(0,
"Select")
ddlist.SelectedIndex = 0 Else
ddlist.Items.Insert(0,"Norecords")
End If
End
If
2. In the rows generated when user presses functional key F3 then the values of the above row(previous row) have to be copied in present row. similarly for F4 column copying. This I achieved through the Java script. But I have many forms requirement is same. where as text boxes id differ. how can I generalize the One function to work for all forms. I wrote as like this.
document.getElementById("No"+ cnt).value = document.getElementById("No" + (cnt-1)).value;
document.getElementById("Name"+cnt).value = document.getElementById("Name" + (cnt-1)).value;
For all the 6 text boxes.where as for column copying I wrote as
document.getElementById(id + cnt).value = document.getElementById(id + (cnt-1)).value;
here id is the text box id Which I am passing.
View 4 Replies
Apr 27, 2010
I want to restrict future date selection, how can i do it..........?
Is there any regular expression to do this..............?
View 2 Replies