Architecture :: Limit User Input Options?

Jan 19, 2011

I'm building a web app (VS2010, C#, .NET 4.0) and am aiming to make heavy use of objects. One particular object will be a 'user' object. One of the properties I am exposing for the object is the users Status (e.g. Pending, Active, Suspended, Expired). In the front end this status will be editable and I don't want users of the app to enter invalid statuses (Pendong, New, etc.). I could hard code the valid statuses in the front end making use of a radiobutton list or dropdownlist, but that isn't logically where the valid values should be defined, I would have thought that the objects class would be a better place.Now this leave me with two problems:

Which is the best place to define the valid values? If I add them to the class, how do I read and present them in the front end?I'm hoping that you guys can put me straight here. Are any of my ideas architectually correct, or if not then what would be better.

View 4 Replies


Similar Messages:

Web Forms :: How To Generate Rtf File Based On Input Field (textbox Input By User) C#

May 27, 2010

how can i generate rtf file based on input field(textbox input by user) c#

View 3 Replies

VB.NET Web Application Input Box / Input Box That Comes Up When A User Clicks 'Find' Button?

Aug 4, 2010

I would like to program an Input Box that comes up when a user clicks 'Find' button. It asks 'Please enter an employee number'. Then it takes the employee number typed into a text box and searches a dataset for that specific employee record.

I know that it should be server side because the client may not have the proper javascript installed or diabled. Therefore, can someone give me some code to put in code behind that can pop up an input box and use the input after, if this can be done?

View 1 Replies

Architecture :: Search Input Box For Searching Inside Website

Nov 22, 2010

Does anyone has a idea how to write code for a search box to look for keywords,etc inside the website or sitemap?

View 11 Replies

How To Set A Limit For User To Signup

Nov 24, 2010

How do i set a limit for user to sign up in ASP.NET ?

For example, I'm creating a web application using Microsoft Visual Studio 2008 to make it available for users to sign up for the event. But i only wish to allow 10 people to sign up for that particular event.

So what code/thing i need to do to able to set the limit?

View 1 Replies

C# - Limit Only One Session Per User?

May 27, 2010

Is there anyway to detect when a user logins if there is already another session with the same username, and block him from logging in again or send him a message?

View 6 Replies

Web Forms :: Treeview / SiteMapDataSource - Get Tree Layout That Matches The Numbers Of Options But No Text On Any Of Options To Click

Jan 18, 2011

I have a Default.aspx program that contains a Treeview with a SiteMapDataSource. I also have a web.sitemap loaded up with urls. When I run the deafult app I get the tree layout that matches the numbers of options but no text on any of the options to click.

View 1 Replies

C# - Setting Private Memory Limit For Application Pool In IIS 7 Increased Page Faults Before Crossing The Limit

Aug 16, 2010

I have set Private Memory limit of 200mb in IIS 7 for an application pool. The Private Working Set memory(Task Manager) for the application is always below 125mb but the number of page faults have increased a lot and application cache is getting cleared frequently after setting the limit.

I haven't set any limit on Virtual Memory.why the cache is getting cleared even when the Private memory used is below the allocated memory?

View 1 Replies

Web Forms :: Image Resize According To User Options?

Sep 14, 2010

i want to provide user to select images to upload, maximum images is 4.

the overall size is 1024px width and 500px height.

within this 4 or 3 or 2 images will have to fit.

if the user upload 4 images it has to calculate the overall width and height and resize the 4 images as equal width and height for each.

if the user upload 2 images it has to calculate the overall width & height and fits.

i want to do through code. iam using c# asp.net

View 1 Replies

Web Forms :: How To Restrict A User Not To Select More Then 4 Options In A ListBox

Aug 5, 2010

I am using a listbox

<asp:ListBox ID="ListBox1" runat="server" DataSourceID="_dsOccTypes" DataTextField="ListDisplay"
DataValueField="ListValue" Rows="6" SelectionMode="Multiple" Width="450"></asp:ListBox>

There are 10 options in the list box but I want the user only to select a maximum of 4. If user selects more then 4 then I want to display a message to user that they cannot select more then 4 options.

How can I achieve the above using some custom validator control?

View 2 Replies

Web Forms :: Way To Check/limit User For Email Body?

Aug 18, 2010

I've got a form that will be used to send an email from a site. I'm using regular expression validators to limit the input to only appropriate characters in all of the fields. There are two things I want to protect against with the body portion of the email, sql injection attacks and the user entering too much text. The body portion of the email is entered using a text box with text mode set to multi line.

What is the best way to prevent the user from entering too much text and to guard against characters I don't want? I assume a regular expression validator will be ok for this. Will there be performance issues with this? Will the regex validator work well enough for this situation? Is there a better way of doing this?

View 1 Replies

SQL Reporting :: Give The User 3 Options In The Form Of Radio Buttons

Jan 8, 2010

I have a report that I would like to give the user 3 options in the form of radio buttons. How do I implement this?

View 2 Replies

Authentication - How To Limit .net Control Actions Based On User Role

Mar 12, 2010

I have several pages or views in my application which are essentially the same for both authenticated users and anonymous users. I'd like to limit the insert/update/delete actions in formviews and gridviews to authenticated users only, and allow read access for both authed and anon users.

I'm using the asp.net configuration system for handling authentication and roles. This system limits access based on path so I've been creating duplicate pages for authed and anon paths.The solution that comes to mind immediately is to check roles in the appropriate event handlers, limiting what possible actions are displayed (insert/update/delete buttons) and also limiting what actions are performed (for users that may know how to perform an action in the absence of a button.) However, this solution doesn't eliminate duplication - I'd be duplicating security code on a series of pages rather than duplicating pages and limiting access based on path; the latter would be significantly less complicated.I could always build some controls that offered role-based configuration, but I don't think I have time for that kind of commitment right now.Is there a relatively easy way to do this (do such controls exist?) or should I just stick to path-based access and duplicate pages?

Does it even make sense to use two methods of authorization? There are still some pages which are strictly for either role so I'll be making use of path-based authorization anyway.Finally, would using something other than path-based authorization be contrary to typical asp.net design practices, at least in the context of using the asp.net configuration system?

View 3 Replies

Security :: How To Limit User To Access Database And Web.config File

May 6, 2010

I know I can use [assembly: FileIOPermission(SecurityAction.RequestRefuse, Unrestricted = true)] to limit user to access disk files, now I hope to limit user to access database and web.config file, how can I do?

View 2 Replies

User Controls :: Unable To Get User Input In Required Format In Console Application

Apr 27, 2016

Create a class Employee which will implement the below interface: IEmployee. The application should accept the function to invoke and its parameters from the console in the Format:

[MethodName]:[Parameter1]:[Parameter2]
Ex: SetProperty:Age:44

The implemetation shold have the necessary checks on whether the input is in correct format by handling like FormatException.And the program should be able to continuously accept the input and print corresponding output until the input given as "Exit".

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1

[CODE]..

Issue: I am unable take the user input in the corresponding format.in the above code everytime I have to give the user input in the format "Set:Age:33" but this is not I m looking for .Actually firstly the expected input and output should be given in the format as per the screenshot I have attached.

View 1 Replies

Custom Server Controls :: Save User's Input In User Control?

Mar 28, 2011

I have a user control (ascx file) that contains an interface for users to change the data retrieved from the db. So, I am displaying data and most of this data can be edited by the user. When the user enters text into a textbox, and clicks "Save Changes", the value they typed in is lost and not persisted to the database. I realize now this is because the SaveChanges button does a postback, and the user control gets reloaded with its original valuesbefore the code within my SaveChanges button gets executed. I'm not sure if there are properties I need to set to save the input data, or if I need to write my own code to do it. What is the generally accepted method to do this? (Also, all of the controls in the ascx file are wrapped in an Update Panel.)

View 8 Replies

MVC :: Save Previous Filter Options, When User Clicked On Back To List Button?

Jun 25, 2010

Introduction:In modified list page I have html controls to filter data in table. By default data in main table is not filtered. This page can view and filter data authenticated && non-authenticated users. For storing membership information I use ASP.NET membership.

Question: My Simple Grid table:

<table>
<thead>
<tr>[code]...

Also have simple html elements to filter data in upper table after button click. After user click on "City name" page redirrects to Details Page. And in Details page user can click on button Back to List. How to save previous filter options, when user clicked on back to list button. Now in when user clicked on btn "back to List",

table loaded with default data (it is bad).

Aim: How to realize saving previous post for registered and unregistered users, if this tables more in other pages (not one).

Also, how to realize saving optional parameters registered users.

Notes:
I use SQL Server 2008.

View 3 Replies

How To Generate User Friendly Page Name With User Input

May 12, 2010

for example, the following url is generated

[URL]

based on the title: How to Install a Copy of Windows XP on a MacBook With Boot Camp.

Is there any .NET code generating the user friendly url out of user input?

View 9 Replies

Vb.net Vs Input - Sending An Email To User Input Email. VB

Feb 24, 2011

I have 2 pages, one is HTML and the other is ASPX. In the HTML I am able to get input from a user and then process a return email to them

The HTML looks like this:

<input type="text" class="input" value="e-mail" id="txtEmail" name="contactEmail" onclick="SelectAll('txtEmail');" >

and I'm using the following in the method

Dim sResponseToName As String = Request.Params("contactEmail").ToString

This part of my page works perfect as someone sends me a request I am about to direct an email to their "contactEmail"

However, in my aspx page it looks like this:

<asp:TextBox ID="contact_Email" CssClass="inputtext1" runat="server">

and the method used is:

Dim sResponseToName As String = Request.Params("contact_Email").ToString()

but no email is sent to the input email address.... If I hard code a random email instead of Request.Params("contact_Email").ToString() it works fine. But for some reason I can not get to the inputted user address.

kinda stumped, I've tried a few things but no luck. How do I get the Request.Params to work in an aspx, and do I need to add something in <asp:TextBox....> to reference it.

View 2 Replies

Use Gmail Or Live Service To Login In The Website But Limit Only One User (admin) To Login?

Dec 24, 2010

I've a Gmail account, assume that me@gmail.com. Now I want to login (as admin) in my website through this account. I know I can use OpenID etc. for that purpose but I want to limit it for just me only. Can I do this? I don't let anyone else to know which service I used to login and what is my address and etc. (Note: My website contains just one and only one login form, for just me, only!)

View 1 Replies

Validating A User Input

Oct 13, 2012

I want to prompt the user to enter up to four specific months as an input on my page. Should I use a textbox control and just apply validators to it? or a check list box? which would control what the user puts it and would make it easier to iterate through the selected items? The only concerns I have are the looks of the list box. Can I make it look and feel like a drop down box? Also, how do I limit the selection to 4? If I use a text box, how do I validate that "up to" 4 items are entered let's say separated by a comma?

View 5 Replies

Localization :: Cannot Fix Or Limit User To Setting PC Regional Setting To UK

Dec 23, 2010

I have develop a web application. I have put my web application in my server and user can access from any location.

My server regional and setting is English (US). Now my problem is

1) When user access to my system and his pc setting is English (UK), it will prompt and error

and after i debug i suspect it is because of Datetime conflict (dd/MM/yyyy and MM/dd/yyyy)

2) I cannot fix or limit my user to setting his/her pc regional setting to UK

So what can i do in my web application solve this issue?

(Can i write any code in my client side (.aspx) to convert or do standardization to US)

View 2 Replies

Getting User Input From Google Maps?

May 22, 2010

If you map a google maps application and want to store every location the user clicks on, how can you store that data in vb.net/asp.net in a collection, with the intention of putting it in a database later.

I'm pretty sure I know how to store it in javascript, perhaps with an array, but I'm unsure of how to transfer that into the application (Without sticking it in visible text that the user sees or adding it to a form).

View 7 Replies

MVC :: How To Retain User Input After Validation

Apr 25, 2010

I am making some change to my MVC app to allow user to modify their existing email address contained in the profile. I have 'email' and 'confirm email' fields both which load the existing email address when the user enters the edit page (both textboxes are loaded from the same database field). The issue I am having is that when the user edits the 'email' text field and forgets or enters a different address into the 'confirm' field, validation occurs and instead of retaining what the user entered it loads what's contained in the Model when it tried to save into both fields once again (to the user it would appear that validation should not have occurred). I would like validation to fire and retain what the user initially entered in the text boxes.

For example, if the original email address is [URL] and the user enters [URL] for the 'email' address and forgers or enters a different address into the 'confirm' field, validation fires and loads [URL] into both because that's what was captured during the attempted Save. I would like for [URL] to remain in the 'confirm' textbox, or if the user entered something that never matched that would remain.

How can I get around this but still have the existing email address load into both fields when the user initially enters the 'Edit' area?

View 3 Replies

AJAX :: Getting User Input From A ComboBox?

Sep 9, 2010

What is the most reliable way to get the current user input from a ComboBox? I've noticed that SelectedItem.Text, SelectedValue, and Text all contain the wrong result when the user deletes everything in the box and then immediately does something to cause a postback without clicking outside the box first (e.g. the user presses Backspace to delete the current contents and then presses a Submit button without clicking on anything else in the form first).

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved