.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How Restrict and Allow user to Pages of Website.

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net

i have 4 pages of website

2 pages are authorized to used by USER and 2 pages are restricted for user

admin can authorized to go all 4 pages


i need coding for Login window from which Admin/User Login



View Complete Post

More Related Resource Links

Creating a user friendly alias for the website path


 Hello mates,

I am hosting my ASP.NET application on a Windows 2003 Server.

To browse to my application one has to type the path :http://serverName/applicationName

I want users to only type  applicationName on the web adress area.I believe there is something to do with alias and CNAME on DNS records that can adress this.

Any help on how to go about doing this will be highly appreciated.

Generating and storing html pages in User Directories on the server



I come from corporate asp.net development, and I am now working on a public website which will get a lot of traffic, perhaps a million users a day.  So I am faced with a ton of performance and scalability questions.

I would like to share some thoughts and see if my approaches resonate with any good practices, or perhaps I am heading down the wrong path...  Either way, I want to hear opinions.

(My number one concern is the fact that I am using asp.net for a public website.  I don't know of a lot of websites using asp.net)

I am using asp.net 2.0 (I know, its not the latest technology but I don't need any advanced features of asp.net 3.5 or 4, unless there are significant improvements geared towards what I am doing) 

On launch date, this will be running on a dedicated Windows Server 2008 running on Intel ATOM 330 1MB L2 Cache 1.6Ghz Dual-Core with 2GB DDR RAM.  Its fully managed by a full service hosting company which gives me an option to upgrade to a bigger server within a few hours.  I can even move the site to a webfarm if the traffic demands it.

So I have a User Dashboard, where users can create albums and upload pictures.  So what I am doing

How can i restrict the user to login only from the system which he registered from the Computer.

Hi,I am Kartheek. ASP.Net Web developer. I got one requirement regarding security.In my website, if one user registered from a computer, we have to allow  that user to be able to access the site from that computer only. If he try to login from another system even in LAN, we have to deny the access.Please help me with this. Thanks in advance,Kartheek Challagundla.kartheekchk86@gmail.com

Long execution times for Search pages even after 4th or 5th user has accessed the same page.

Hi Guys We have a Sharepoint 2010 farm with two NLB web fronts ends, a Index server and a two box SQL cluster. The same problem also occurs on a dev box which has Sharepoint 2010 and SQl server running on the same single box. When a user access the search or advanced search page we get long execution times of between 15 and 30 seconds.  The strange thing is that the user will have a slow response the first time, then they are fine for a period of an hour or two and then they hit the slow response again.  Below i have copied info from the developer dashboard.  Does anyone have a suggestion of where to start tackiling this issue. Thanks 1st Run.  (Note this site was accessed by 3 other users first) BeginRequestHandler (0.05 ms) PostAuthenticateRequestHandler (0.06 ms) PostResolveRequestCacheHandler (18.48 ms) GetWebPartPageContent (16.87 ms) GetFileAndMetaInfo (15.57 ms) GetWebPartPageContent (35.25 ms) GetFileAndMetaInfo (34.99 ms) GetWebPartPageContent#1 (89.27 ms) GetFileAndMetaInfo (89.06 ms) Add WebParts (3975.17 ms) Search Box (3974.54 ms) SearchBoxEx.OnLoad (15426.56 ms) SearchBoxEx.HandleContextualScoping (0.01 ms) UserPreference.GetUserPreference (15418.52 ms) UserPreference.GetFromCache (0.04 ms) SearchServiceApplicationProxy.GetUse

User control or sub-form inside tab-pages? Best practice?

I've got a Windows Forms application with numerous tab-pages within a tab-control. Each tab-page is a diffirent user entry form with different controls of varying types. As the application is fairly large it is important that more than one developer can work on it simultaneously. Thus we decided to create a form for each tab so that different developers could work on different forms at the same time without overwriting each other's code. Each of these "sub-forms" are then assigned its relevant container tab-page as its parent. This works well but I was wondering if this is good practice or not, after another colleague commented that we are making forms look like user controls and that we should rather be creating a user control for each tab. I've converted two of the forms to user controls with relative ease and it does work nicely as well but with one draw back. On the main parent form, e.g. frmMain, where the tab control lives, there is one single button the clear the current display. When you click "Clear display" it clears various others items displayed on the main from, finds the current selected tab and clears its contents. The latter is easy to do with sub forms as I can simply close and dispose the sub form inside the selected tab, and load a new instance. I don't have to write custom logic to go and reset/clear each control on that form. Thi

Insert and Edit Pages with Web User Control Template for another table

Hi, I have an Address template(web user control) which holds the fields of the Address table.  The Address template is embedded in the School Insert Page.  I want to insert a new school together with its address(which means I have to insert a record into the address table).  Can you let me know how I can pass the newly generated addressId to update school table?  Also, how can I associate the Address.cs in the App_Code with the Address template?  I want it to be able to scaffold columns which needs to be hidden from user in the address table.  When I click on Insert School, the Address template shows in "insert" mode, I just need to link the two together. Thanks for your help! CC  

How to Provide Security at User level base in asp.net for certain pages

 Hi I have a site We have different Pages under one folder. we have stored these pages information in a database table with pageid. Then we have User access table. there we store userid and pageid , for which pages user has access. Now I need to provide access to that pages only . What to do. Could you please provide answer asap.   Thanks  

How do I allow some .net pages to be used from a login page before the user is authenticated?

Ok, I have a .net homepage (viewable and useable to everyone) which is "login.aspx".  There is a header with a menu and three columns under that.  The header has a "home" button which will display a page (standings.aspx) with data from a gridview control which gets its data from an access db in a directory called Access_DB from the root level of the site. The next menu in the header is "Schedules", which uses the same db and a set of .aspx files (i.g. MondaySched.aspx, ThursdaySched.aspx, etc) to populate NFL schedules in various formats, and the last column "About" is just some html files.  All of this data is placed in an IFRAME in the middle column of the page.  The left column is where the login textboxes/submit button reside, the last column is just some html.I am using form level authentication as follows:<authentication mode="forms"><forms name="BTGAppSec" loginUrl="login.aspx" protection="All" timeout="30" path="/" /></authentication><authorization><deny users="?" /></authorization>The problem is when you go to the site and it tries to load the "standings.aspx" into the IFRAME on page load, it sees that as an unauthorized user and sends the IFRAME back to login.aspx.  So what you get is a &qu

Accessing a public property of a nested user control in a master page from a pages' user control

Hi  I've got a web site that has a master page and that master page (mpMaster that has a user control (ucControl1) which has a sub user control (ucControl2), this user control has a property which accepts a value. Now, I have a page that uses the master page and on this page I have another user control (ucPageControl), I need to  find a way of setting the value in ucControl2 from ucPageControl. Is this possible at all? Many thanks Ed

Pass values between user controls on 2 different aspx pages

I have 2 user controls that is hosted by 2 different aspx pages.example: srcpage.aspx --> hosts the --> sourceusercontrol.ascxanddestpage.aspx --> hosts the --> destinationusercontrol.ascxI would like the values in the text fields of the sourceusercontrol.ascx to be passed on to the labels in the destinationusercontrol.ascx. I have gone through the MSDN ASP.Net examples and i was able to successfully pass values between two aspx page using the postback URL functionality, but cannot do the same thing with the usercontrols on 2 different aspx pages. Any suggestions would be helpfull....! Thanks..! 

Can I have an SQL Express database open in VS2010E along with the website? "Login failed for user ..

Hi, as the topic says..Whenever I have my database open in Visual Studio 2010 Express, I get this error:Cannot open user default database. Login failed.Login failed for user 'IIS APPPOOL\DefaultAppPool'.Cannot open user default database. Login failed.Login failed for user 'IIS APPPOOL\DefaultAppPool'.

I need a static music player on my website that continues to play music when the user navigates to d

I'm not sure if this is the right area, but I'm needing to have a music player on my website that stays static when the user navigates through my site, and continues to play without interruption.  Currently I have a Flash player that works great, but obviously it stops playing when the user goes to a different area of the site.  Make sense??  Thanks in advance!!

how to detect the IP position of my website user ?


Hello all , 

how to detect the IP position of my website user ?

thanks in advance 

logging out users when user opens website in two browsers or two tabs of same browser.



We have the implement the following scenario in our application:

  1. We use windows authentication. User opens our website in tab1 and does some action but with out clicking on save he opens a new tab tab2 and opens the same website again.
  2. Now, if the user session in tab1 is active i need to warn users that the he is already logged on to application in some other browser and go to some log out page. But if the user session in tab1 is timed out then he must be able to continue with the website in tab2 as usual, but if he tries to do anything in tab1 he should go to session expired page.

I tried implementing it in following way.

  1. I have a hidden field in each page which will be set to unique Id using GUID.NewID().
  2. when user requests for a page the following code is executed.
  3. if (Request.Headers["Cookie"] == null)
                    //this means user is requesting hte page for first time.
                    //Generate a new GUID store it in session and also in the hidden variable on page.
                    Session["DefaultPage"] = Guid.NewGuid().ToString();
                    ((TextBox)page.FindControl("hiddenGUID")).Text = Session["DefaultPage"].ToString();
                else if (Reque

user login & secured access pages via web part?

The client wants to have certain sharepoint-driven pages available only to their end customers who login to the site via secured login (to the site content, not the sharepoint CMS).  Can this be done via a web part somehow?  We're not a sharepoint house, and have been asked to take over management of this sharepoint driven site! Normally we'd write an ASP chunk to validate against a database but not sure how to do this (or by some other method) in the Sharepoint CMS. Thanks...

question about multi user website and security



i am developing a multi-user website using Dynamic Data and wondered if someone could answer the following or provide advice:

what is the best way of protecting data so someone (who has a login to the site) cannot see records intended ONLY to be viewable by another valid user?

as far as i can see a user can simply tamper with querystring or url values (if using routing) and bring up the details of records they should not.


any help qould be gratefully appreciated. i am drawing a blank so far and the easiest option may be to back to a traditional asp.net site where i can control things simply by use of a Session variable (UserID)



how to get user name in window login and show in our website


if any one login how to get user name and show in our web page

and how to get location of client side (Physically Ex-India -Delhi-Anand Vihar)

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend