hello i am using the web.config to store the connection to the SQLServer. but when i do so ..i get a error msg saying "UNRECOGNIZED CONFIGURATION SECTION appsettings" the code is IN WEB.CONFIG and on the click of the LOGIN BUTTON of the login screen i create
the SQLConnection Dim conn as SQLConnection conn=new SQLConnection(configurationSettings.appsettings("cn") but this doesn't work. Appreciate ur help
deepti Your code in both web.config and on the login button click event looks fine. (except for the missing bracket behind ("cn"), but I expect that just got missed on the copy and paste.) From the error I would guess that the appsettings configsection is not
defined correctly in your machine.config file. Check the machine.config file for the following (5000 can be replaced by 3300 if you're using an version 1.0 of .net fx instead of 1.1): This should appear somewhere between and in machine.config file (which is
normally located in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG, or at least it is on my machine) If it does not, then you could just paste it in there (make sure you use the correct version number), or you could add it to your web.config file, once
again between the and tags. You may want to also try reinstalling the .Net Framework to make sure you have all the standard stuff in the machine.config (unless of course you have made some specific changes to machine.config) Good luck
hi Thank u so much. But i have solved the problem.It was a very small problem. Since this is the first time i am working on ASP.net/ASP or XML files i din't realise that the tags in the XML file are case sensitive unlike HTML. but now the code is just working
fine. thanks again.
I have another Doubt. The Application that i am building is for a stores management will be used thro intranet. There is a StoreIncharge & Stores Manager AND all other users just view the items available in the stores. other than the stores manager & stores
incharge al the other user login as Guests. my question is while logging in i want to check if the person loogged in is a guest or stores manager. if he is a GUEST he had to be directed to Form1.aspx and if he is a Stores Incharge &stores manager he has to
be directed to form2.aspx. how do i do this.
I would say there are two options (depending on what you really want to do). For both options I would put two buttons on the login screen. One for logging in with a user name and password (btnLogin), the other for logging in as a guest (btnGuest). I assume
you already have this, or something similar. Option 1 is very easy and simple, but has obvious limitations. It basically assumes that you actually have two seperate applications for guests and known users that just look at the same DB. This approach should
really only be followed in very simplistic apps, and even then I don't think it has any real advantage other then saving a little bit of dev time. Option 1: On btnGuest_Click redirect the user to Form1.aspx. On btnLogin_Click redirect the user to Form2.aspx
(after authenticating of course). Option 2 is still quite simple, but involves a bit more logic and provides you with the opportunity to make the solution really elegant. It involves saving the user name or some form of indicator telling you the user is a
guest to a session variable. Option 2: On either of the two click events, save the user name to a session variable. The code would look something like this: Session("UserName") = lblUserName.Text Whenever you call a form for which there are two alternatives
for the two types of user, do a simple check as below. If Session("UserName") = "Guest" Then Response.Redirect = "Form1.aspx" Else Response.Redirect = "Form2.aspx" EndIf You could of course make this a lot neater by declaring the values like "UserName" and
"Guest" as constants, but the way in which you choose to implement it is really up to you. I would recommend that you actually store a boolean value in a session variable based on the logic that you define (e.g. which button is clicked) that indicates the
user is not a guest, or is a guest. You therefore wouldn't ever work with a 'user name' Guest. Hope that's what you're looking for...
You may want to check out this tutorial on managing application and session state: http://samples.gotdotnet.com/QuickStart/aspplus/default.aspx?url=/quickstart/aspplus/doc/stateoverview.aspx And these two msdn articles on session state: http://msdn.microsoft.com/msdnmag/issues/01/11/cutting/toc.asp?frame=true
http://msdn.microsoft.com/msdnmag/issues/01/12/cutting/toc.asp?frame=true
I have one more suggestion... Authentication in ASP.NET is in three ways. 1. Windows Based [IIS's Basic, NTLM, certificated based] 2. Forms based (you write your own code for authorization. Basically a couple of .aspx and probably one table in database and
few session variables) 3. Passport - You can use Microsoft Passport for the authorization. Now since you are using a simple intranet you can go for the first authentication method. How to do this? You can start windows authorization using tag.... as . You
can add users list and their group in autherization... as the following Here in the above tag... you can pass NT Users list in users attribute. NT groups name to roles attribute. Others please suggest if this approach is correct or not. I didn't used this.
syamd I don't see why not. Haven't used it myself, but it should work. I would still rather go for "2. Forms based" for the following reasons: 1. It gives you full control over design for authentication in your system. Anything where you want to customise look/feel
per user or usergroup would be easier. 2. You're not limiting the application to its current use. If it is a simple intranet based thing today, tomorrow they may want to allow customers to login as guests over the internet. My experience is of the forms based
method, and I've found that it works well, is easy to implement and offers excellent flexibility. Point 1 above to me is the real strength of this approach, because it allows you to implement an authentication design that will be perfect for your application
(and once you've done it a few times you'll find that there are actually very few decisions to make, but those decisions can have a very large impact on your development). Having said that there probably are situations where windows based authentication would
be the more suitable approach, but I don't know enough about it... Perhaps someone with experience of using it can share an opinion here?
Well thank u all for the Help. This has surely given me a big picture of how to go about things. BUt i was wondering which way to go about . Cos my organisation is a huge one with more that 2000 employees.
deepti I'm not sure exactly what you're looking for? I would suggest based on the information you've given that forms-based authentication is the best option. The following MSDN article contains enough info to get you going: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconthecookieauthenticationprovider.asp
The following article will also provide you with info on the other two types that syamd mentioned: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconASPNETAuthentication.asp In addition to the code and config settings described
in the aforementioned articles you will probably need to create a few tables. At the very least you'll need a table to store user names and passwords (encrypted of course). Hope that helps
deepti
Member
25 Points
5 Posts
appsettings in Web.config
Jul 23, 2003 10:46 AM|LINK
notsocleverd...
Member
305 Points
61 Posts
Re: appsettings in Web.config
Jul 23, 2003 03:38 PM|LINK
deepti
Member
25 Points
5 Posts
Re: appsettings in Web.config
Jul 24, 2003 03:52 AM|LINK
deepti
Member
25 Points
5 Posts
Re: appsettings in Web.config
Jul 24, 2003 04:03 AM|LINK
notsocleverd...
Member
305 Points
61 Posts
Re: appsettings in Web.config
Jul 24, 2003 08:58 AM|LINK
notsocleverd...
Member
305 Points
61 Posts
Re: appsettings in Web.config
Jul 24, 2003 09:33 AM|LINK
syamd
Member
25 Points
5 Posts
Re: appsettings in Web.config
Jul 25, 2003 04:13 AM|LINK
notsocleverd...
Member
305 Points
61 Posts
Re: appsettings in Web.config
Jul 25, 2003 08:26 AM|LINK
deepti
Member
25 Points
5 Posts
Re: appsettings in Web.config
Jul 25, 2003 09:41 AM|LINK
notsocleverd...
Member
305 Points
61 Posts
Re: appsettings in Web.config
Jul 28, 2003 02:14 PM|LINK