Passing URL parameters in asp.net [closed] - c#

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 8 years ago.
Improve this question
I'd like to have a webpage where I enter certain details, and then submit and send a user a URL which takes them to another webpage where they fill in other details that are not the details I entered initially, but the values I entered are passed to their page, so I can access those values in code that I don't want them seeing or modifying. The URL I would want them to see would always be the same URL. What are my options here? The important things is that the parameters I pass cannot be modified.

If you have more than a few fields to pass, you should probably send the client some kind of ID (like a GUID) and use a database to look them up.
If you're dealing with a maximum of three or four fields, you could pass them as a querystring. Keep in mind as you're designing this that querystrings are visible to the end user - if they want to play with it, they can. You may be able to encrypt the data before you append it to the QS, but if you're going to go through that much trouble, you may as well just store it in a database and look it up. (It'll be a lot easier)

Related

How to create a different user type in windows form application with c# [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 6 years ago.
Improve this question
I will develop a system in C# wherein there are different types of user and these are: admin, cashier and clerk. My question is, where should I start and what are the things needed in order to do this project? Hope to have an answer with you guys! thank you!
First thing is the privilages.
You need to start with creating login screen upon there you should decide the user type that which user type is trying to logging in.
Now you have to show form to different level users.
So what I recommend is that make separate dashboard for each role or create a form but disable the controls that are out of privileges of some user.
But in my case first one would be preferable as it sounds more professional.!
So just start with it. If you need some more query than please do comment!
Well, you start with a 'user' object, and inside that user object, you define a 'role' property. Make a Global instance of the user object. And once you have that, you can code every page/form against 'user.role' to see if it should be shown/enabled. For logins, make a database with a users table where you store the name, password, and role....and anything else you feel like collecting about users. Then check logins against the table.
That's about as specific as I can be given how generic this question was!

Storing data in mvc project [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 6 years ago.
Improve this question
I am pretty new to mvc projects, and I have such an issue:
I have a page where is represented list of projects this is main page where user is redirected after logging in, and he has to click "choose" button to go to other pages which will be related to selected project, for example employees who work on that project, list of managers, users and so on. User should not be able to access these pages while he did not select project. So i have to store somewhere ProjectId which is selected, and on each his attempt to go to another page check whether this id is set or not.
Is there any special way to store this id and check is it set or not, and redirect user, not just by writing pretty strange method and use it in the beginning of each get request?
You can store the selection in the Session object when the user makes the selection. When the user tries to go to any URL, you can check the value in the Session object, and deny if it's not set.

how to insert an array of values into a database using C# winForms [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 8 years ago.
Improve this question
I am creating a application that tracks time. A user inputs his or her user ID and clicks clock in. The application allows for multiple users to be logged in at the same time. I want to clock all users out when they exit the application and insert user ID, username and Time Out for each user that is clocked in into my database. Clocking all users out when the application is close will hopefully provide better time reporting if a user forgets to clock out. My question is how would this be accomplished, would I use arrays or is using a list better for this problem?
Thanks
How you structure you store data for each user is up to you. One acceptable method would be to use a List that contains an entry for each user. You could also use a Dictionary with the user ID as the key for each entry. I would stay away from arrays here because they are best if you have a fixed number of entries, which you clearly don't.
To insert the values into the database, simply use a foreach loop to iterate over each item in the list and insert it (unless you are using EntityFramework or something similar; then everything is different).

Store data at client browser [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 8 years ago.
Improve this question
I have a scenario for some data need to store at client side I dont want to use server memory. I need to store data like resultset.
For exmp I have shopping site and when the user is to do add to basket I need to store that basket information to the browser cookie.
In short I need to store a list object in the web browser cookie.
I had use the cookie but it only store the string object.
I think the problem can be solve by serialize the list object to json string or xml string but I didnt get the right way for the same.
Can any one suggest me a right way to achive this.
I most appriciate your solution.
You can use localStorage, but it is limited to 5mb and not supported by IE7 and less.
Alternatively, for cross-browser compatibility you can use 3rd party libraries like Store.js.

What if user deletes cookies while navigating 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 8 years ago.
Improve this question
Suppose there is page which asks for user's name,age etc. and save it into cookie. Now user is navigating on your website and in between he/she deleted all the cookies and then navigates to the other page which uses these cookies. According to me the next page will get blank values right? How to handle this drawback? I don't want user to fill those details again.
Solution 1: You can use Query String (For Client Side Working)
Plus Point: very easy alternate of cookies.
Drawback : user can remove query string also.
Solution 2: You can use Session (For Server Side Working)
Plus Point : If user delete the cookies ...session value will be saved.
Drawback : Session store value on server so It's little time consuming work.
Solution 3 :You can save value direct into database.
Plus Point: all data stored will be saved permanently in your database.in future If user come on your site ...not required again user info.

Categories