473,885 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to control Url access in asp.net

Hi guys,
I want users to complete a webform or edit a page before getting to
a specific page.
The pages need to do the following:
1)Check to see if they need to edit or complete a form if YES then until
they complete it they can get to a specific page or URL. If not i sent them
to the page they need to get to
2)But the thing is if a user is smart they can copy the url and paste it
directly.
And if they do that i want to throw them out .
How can i let a user get to the url unless they have done what i wanted.
Thanks in advance
Jul 14 '08 #1
3 1494
"Patrick.O .Ige" <Pa*********@di scussions.micro soft.comwrote in message
news:7E******** *************** ***********@mic rosoft.com...
I want users to complete a webform or edit a page before getting to
a specific page.
The pages need to do the following:
1)Check to see if they need to edit or complete a form if YES then until
they complete it they can get to a specific page or URL. If not i sent
them
to the page they need to get to
2)But the thing is if a user is smart they can copy the url and paste it
directly.
And if they do that i want to throw them out .
How can i let a user get to the url unless they have done what i wanted.
Several ways, probably...

However, an extremely simple way would be to use a Session variable.

When a user first accesses the site (or logs in...) set a Session variable
e.g.

Session["CanProceed "] = false;

Then, once the user has done what you want, set the Session variable to
true;

On any page which they shouldn't access unless they have done what you want,
simply check the value of the Session variable, e.g.

protected Page_Init (object sender, EventArgs e)
{
if (!(bool)Session["CanProceed "])
{
Response.Redire ct(MyOtherPage. aspx, false);
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 14 '08 #2
Thanks Mark.
Taught of that already.Thinkin g of doing some flagging in the DB
"Mark Rae [MVP]" wrote:
"Patrick.O .Ige" <Pa*********@di scussions.micro soft.comwrote in message
news:7E******** *************** ***********@mic rosoft.com...
I want users to complete a webform or edit a page before getting to
a specific page.
The pages need to do the following:
1)Check to see if they need to edit or complete a form if YES then until
they complete it they can get to a specific page or URL. If not i sent
them
to the page they need to get to
2)But the thing is if a user is smart they can copy the url and paste it
directly.
And if they do that i want to throw them out .
How can i let a user get to the url unless they have done what i wanted.

Several ways, probably...

However, an extremely simple way would be to use a Session variable.

When a user first accesses the site (or logs in...) set a Session variable
e.g.

Session["CanProceed "] = false;

Then, once the user has done what you want, set the Session variable to
true;

On any page which they shouldn't access unless they have done what you want,
simply check the value of the Session variable, e.g.

protected Page_Init (object sender, EventArgs e)
{
if (!(bool)Session["CanProceed "])
{
Response.Redire ct(MyOtherPage. aspx, false);
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 14 '08 #3
"Patrick.O .Ige" <Pa*********@di scussions.micro soft.comwrote in message
news:B6******** *************** ***********@mic rosoft.com...

[top-posting corrected]
>>How can i let a user get to the url unless they have done what i
wanted.

Several ways, probably...

However, an extremely simple way would be to use a Session variable.

Thought of that already.Thinkin g of doing some flagging in the DB
Like I said, there will be several ways of doing this. However, simplest is
often the best...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 14 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3422
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get sized strangely using the .RTFHeight property of the control. Specifically, lines of text get cut off the bottom of the control when I use the code provided in the sample report on the lebans.com site. It seems that when there is Chinese text,...
4
8394
by: Kevin Myers | last post by:
Hello, Please forgive my reposting of this note with hopefully a more relevant subject line. On an Access 2000 form under Windows 2000 I would like to use a Kodak Image Edit Control to display the contents of a TIFF image file. According to the very limited documentation that I have been able to locate so far, all I should need to do is to drop the Image Edit Control onto the form in design mode, set the control's Image property to...
0
2420
by: Sabine Oebbecke | last post by:
Hi Experts! I have several forms and reports where controls get their values with 'Forms!MainForm!Control' or 'Forms!MainForm!Subform!Control' resp 'Forms!MainForm!Subform.Form!Control' which works without any problem in Acc97, 2000 and 2002, but now in Access 2003 there seem to be a problem with this. A user is working with my app, and he uses an Access 2002 MDE in an Access 2003 environment.
2
5841
by: Neil | last post by:
Is there an editable RTF textbox control which allows the user to apply bold, italic, etc.? I tried the Microsoft Rich Textbox Control, but there doesn't seem to be a way to allow the user to change the formatting while typing text. Is there such a beast? Thanks, Neil
9
2641
by: the_grove_man | last post by:
I guess my question can go in two directions. I create applications that run multiple queries against a database. Generally speaking in the past I have used a Data Control (calling it dat1) making it invisible and have used this whenever i needed it. dat1.databasename = app.path & "mydatabase.mdb" dat1.recordsource = "my query" dat1.refresh
2
1939
by: Dan | last post by:
All, I have a windows form application. The form will host various user controls that will implement an interface so that was new controls can be added later without recompiling the hosting program. The various controls will be displaying data that is stored in a SQL database. My question is what is the prefered way of having the controls access the business layer that will in turn access the data layer? Does the control
3
2799
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different IDs. Thanks Vivek
3
1579
by: Nathan Sokalski | last post by:
I have a validator that I wrote by inheriting from BaseValidator. At certain points in the code, I need to access other controls on the page containing the validator. I have the IDs of these controls, so I use the following statement to access them: Me.Page.FindControl(ControlID) However, this is returning Nothing, even though the control can be accessed in the Load event of the Page containing the control and the validator. I also...
7
2917
by: robert.waters | last post by:
I have an Access database frontend linked via ODBC to a large (gigabytes) mysql database. I need to view a large amount of data in a a textbox (variable up to 300K), but I receive a 'there isnt enough memory' error whenever I scroll past N number of bytes in a textbox that has been filled with a lot of data. I am not sure what N is, but for a large chunk of data it occurs at about the halfway scroll, and smaller chunks might not throw...
7
2305
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using FindControl the only way to do it?
0
9956
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10871
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7139
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5808
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4627
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.