Session_start and end in ASP.NET [closed] - asp.net

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am building a website. In this website, when a user logged in successfully, how i start session for him and when he hit on log out button ,how i close the session.
Please help me. I am a beginner in Asp.net. So please help me with your answers in Details.
Thank You.

VB.NET
To Create
Session.Add("UserSession", MySession)
To Asign
Dim vUserSession As String = Session.Item("UserSession")
To Close
Session.Item("UserSession") = Nothing
C#
Check this link there is a good explain
http://forums.asp.net/t/1261964.aspx

Depending on how you're setting this up, there are .NET controls that provide this functionality mostly for free (you don't have to write a lot of code to get it to work). Look into the Login control.
You need to decide whether you're authenticating against a domain or a database. Most likely it's a database. Just mask sure you hash the password in the database, and hash the password in the app, and compare the hashes.

Related

How to implement a gamification system in ASP.NET Web Application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm building a Web Application using ASP.NET MVC and I'd like to implement a Gamification system to make the user experience more exciting.
I'd like to start with a simple score for each user and as they progress and get more points they get badges and unlock new features for themselves, something similar to how Stackoverflow does it.
What appears challenging to me is how to check in the entire application, whether a user has reached a score that can recieve a badge. I don't want to duplicate my code and perform this check in every place that I'm incrementing a user's score.
I'd like to know how can I start implementing such a system. I know it's a broad question but I'm just looking for some starting ground and some good practice to begin.

How do I stop connection string from showing on error in Internet Explorer in an Asp.net app? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Here is what is at the top of the view source page in IE... not good User Name and password showing...
Data Source=MySource;Initial Catalog=fdic;Persist Security
Info=True;User ID=username;Password=mypassword;User
Instance=False;Context Connection=False;Pooling=false;Connect
Timeout=4000; Exec usp_SYSTEM_CloseSaleSendEmail_db #id=14888 Invalid
object name 'dbo.vwWorkOrderAll'.
don't display it.... this is not displayed unless you write to it by either Response.Write or maybe setting a label/literal to the value of the connectionstring. ASP.NET or any other platform does not show connectionstring unless you show it yourself. seems like you have an exception not being caught and handled correctly either thus causing this output. you need to catch and handle the exception correctly.

Need help about ASP.net html code for my project i want to display data [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to display data when a user logged in to my website, it will display his/her only data that they added+ their user information in my sidebar, just see the picture.
Thanks for helping guys!
Hope you understand me,
I'm currently using VisualStudio 2010 because we are required to use it at the same time MS SQL but I have no problem with my database+ I'm not allowed to use datasource in designer my prof said I must do the code :)), just the code in this. Peace!
If you can't see the picture, you can click this: http://sdrv.ms/ZQyhxK
You can use:
cmd.Parameters.AddWithValue("#userid",lbluserid.value)
You can also use:
SqlParameter[] p = new SqlParameter[1];
p[0] = new SqlParameter("#userid",lbluserid.value);
Then
cmd.Parameters.Add(p);

Create report in ASPX.NET by passing value? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Can you please direct me to a tutorial or other resource for accomplishing the following:
Index page lists 50 states. Onlick of a state Y, the report page (report.aspx) will display info related to state Y, pulled from database.mdb, interspersed in HTML text.
I am not even sure what the terms and controls I need to be working with.
Thank you.
UncleJune
Do you know how to create the report? That is the first step. After that it is just a matter of passing the required parameter from one page to the next. Several methods can be used to do this: Response.Redirect/Request.QueryString, session variable, etc.
This tutorial might help you:
Using the ASP.NET 2.0 ReportViewer in Local Mode
Dynamic reports with Microsoft local report engine

How do you set up an API key system for your website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Let say that I have a website with some information that could be access externally. Those information need to be only change by the respected client. Example: Google Analytic or WordPress API key. How can I create a system that work like that (no matter the programming language)?
A number of smart people are working on a standard, and it's called OAuth. It already has a number of sample implementations, so it's pretty easy to get started.
Simple:
Generate a key for each user
Deny access for each request without this key
Currently, I use a concatenation of multiple MD5s with a salt. The MD5s are generated off of various concatenations of user data.
A good way of generating a key would be to store a GUID (Globally Unique Identifier) on each user record n the database. GUID is going to be unique and almost impossible to guess.
There are also infrastructure services that manage all this for you like http://www.3scale.net (disclosure I work there), http://www.mashery.com and http://www.apigee.com/.

Resources