Forcing The User To Type Just Numbers?

Jun 15, 2010

I have a TextBox and I want that the user type just numbers, not other format.

How can I do that ?

View 4 Replies


Similar Messages:

AJAX ::Forcing A User To Use Autocomplete?

Mar 12, 2011

I have a textbox that the user is supposed to enter "City, State". I also have a geoIP lookup that enters that information in for them. If that fails, they would enter it in, and autocomplete will suggest the city and state.The problem:

[code]...

View 4 Replies

AJAX :: MaskedEditExtender Forcing User To Enter Decimal Point?

Oct 14, 2010

I have a MaskedEditExtender set for a TextBox that will receive a fee amount. I want the user to be able to type the "." decimal when the amount contains a decimal value (123.45). But if the amount has not decimals (123) I want the mask to automatically fill the 2 decimal with zeroes and also enter the "." decimal point (123.00).With the following mask I'm able to enter a full number (999) and get the zeroes but when user enters 85.85 it will be 850.85 so I change the direction RightToLeft but I'm not even able to type the first character.

<cc1:MaskedEditExtender ID="txtFee1ME" runat="server" PromptCharacter=" " Mask="999.99"

View 2 Replies

State Management :: Forcing A User To LogOut On Closing The Browser?

Jan 19, 2011

writing code for Session_Start() and Session_End() such that whenever a user closes the browser without logging out he is automatically forcely logged out......And too when a user logs out normally he is re-directed to the LogOn page....

View 7 Replies

How To Read The Numbers Entered By User For An Array

Mar 29, 2010

In Console App what is the correct syntax to read n numbers from the User for a int Single dimension Array?

View 4 Replies

Web Forms :: Dynamically Loading Different Numbers Of User Controls?

Nov 15, 2010

The web page I am trying to (slowly) build should allow users to add whichever user controls they want on their page, and order them whichever way they like. This is saved in a database.

So each user could have a different number of controls on the page.

This is the design code, at the minute the user controls are fixed and are not loaded dynamically. They user controls are stored in 'blocks' which look like widgets on the page and can be dragged about to different columns. For each user the layout is stored in the DB i.e. which blocks are in column 1 and which blocks in column 2 etc.

How could I change this so that it can create a 'block' div for each user control returned from the database and put the user control in that block and in the right column?

[Code]....

View 15 Replies

MVC :: Validate The User Have Entered Only Numbers For A Field On Server Side ?

Feb 4, 2010

If i use DataAnnotations on my Model and my model have something like this:

[Code]....

and in my View, i have a textbox WITHOUT client side validation. If the user enter non-numbers caracters in this field, i would like to validate on the server side that the user have entered non-authorized caracters and message him back on that. But since that my Model's Days property is a INT, the ModelBinder can't parse the string in the int property and generate an error in the ModelState with no message at all. And if the user doesnt enter anything on this field, the ModelBinder also try to put an empty string in a int property and generate an error in the ModelState with the message "a value is required". This is not the message that is written within the DataAnnotation. I have no control on the message that is generated.

So my question is:how can i valide the users input for int properties (or DateTime, etc...) and if the user enter a bad value i can put in the ValidationSummary something like this: "You can't only enter a numeric value for Days".

View 11 Replies

How To Make A UI With A Panel Of Numbers / Highlighted Numbers

Feb 15, 2011

I would like to to make a UI with a panel of numbers, and when hovered above one of them ten the number becomes larger. something like that:

[URL]

I want that when I press a numbers it shows it's value in some other textbox. In which .NET technology is it possible to do it? Windows Forms? WPF? other?

View 6 Replies

AJAX :: Allow User To Enter Only Digits And Numbers Using FilteredTextBoxExtender In GridView EditItemTemplate

Jan 27, 2013

How can I validate a Boundfield in gridview that changes to textbox dynamically?the boundfield is
 
<asp:BoundField DataField="quantity" HeaderText="quantity" />
and it chenges to textbox in code belowI want only number (1,2,3,...) in it not text.
protected void CartGrid_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

[Code]....

View 1 Replies

Forms Data Controls :: Don't Like Is When The User Hovers The Numbers For The Paging, The Autoformat Is Classic?

Sep 27, 2010

inserted a data grid view control with paging.What I don't like is when the user hovers the numbers for the paging, the autoformat is classic, when the user hovers, there is a white box and the number dissapears because the box and the number have the same color,

View 3 Replies

User Controls :: Disable Or Enable Menu Items Based On Login Type Of Logged In User

Jun 6, 2013

I have table called ROLE with fields (id,name,permission) example values (1001,madhu,hr)

I have another table called LOGIN with fields(id,DOB,password) example values(1001,24101989,madhukumar)

What i want is , if i login using the LOGIN table ,it  check the  id and permission in the ROLE table , if the permission is 'hr' it enable to access the menu , or if the permission is any other it just print the error message ("no permission")

Note: menu is placed in master page , but login is not in the master page ...

View 1 Replies

User Controls :: Show Hide Specific Section Of Page Based On User Type Or Role

May 7, 2015

I have LOGIN PANEL for student, and I want to disable it in different page. And only the admin can enable and disable it. I dont know the logic behind here.

View 1 Replies

User Controls :: How To Prevent User To Type URL Of Website Before Signup

Jun 16, 2015

I have a signup page and Main page in my web site. i want to prevent an user to type directly the Main page URL, user should have access after signup/login.

View 1 Replies

C# - Forcing A Postback Asp.Net

May 12, 2010

Please take a look at the following click event...

Protected Sub btnDownloadEmpl_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDownloadEmpl.Click
Dim emplTable As DataTable = SiteAccess.DownloadEmployee_H()
Dim d As String = Format(Date.Now, "d")
Dim ad() As String = d.Split("/")
Dim fd As String = ad(0) & ad(1)
Dim fn As String = "E_" & fd & ".csv"
Response.ContentType = "text/csv"
Response.AddHeader("Content-Disposition", "attachment; filename=" & fn)
CreateCSVFile(emplTable, Response.Output)
Response.Flush()
Response.End()
lblEmpl.Visible = True
End Sub

This code simply exports data from a datatable to a csv file. The problem here is lblEmpl.Visible=true never gets hit because this code doesnt cause a postback to the server. Even if I put the line of code lblEmpl.Visible=true at the top of the click event the line executes fine, but the page is never updated. How can I fix this?

View 4 Replies

AJAX :: Forcing A Postback From An Asp.net Extender

Mar 12, 2010

I have been trying to figure out out to force a postback from an asp ajax extender. The closest post that I can find is

http://forums.asp.net/t/984558.aspx

However I am pretty sure this was at least one migration ago. Additionally I am using VB as my programming language so some of the conversion may be the problem.

I think I am pretty clear on what needs to be done.

If I am correct the steps are...

Create a new property in the extender to hold the postback command for each target control that is using the extender.

Then in the Onload populate that property (Use GetPostBackEventReference to get the ASP valid target ID ) so it can be called from the Clientbehavior.js

My problem is the syntax in the for-each loop that allows me to iterate through the target controls.

Protected Overloads Overrides Sub OnLoad(ByVal e As System.EventArgs)

View 1 Replies

Visual Studio Forcing Indentation?

Feb 23, 2010

I am having a problem editing VB.NET .aspx pages in Visual Studio 2008. If I edit a line that is flush against the left margin, Studio automatically indents it 4 spaces, and there is no way to undo it! I am forced to save the file with that 1 line I edited indented differently than all the other lines!

Edit: How do I turn this off?

View 1 Replies

C# - Forcing A Dropdown List For An Entity Property?

Jan 22, 2011

I'm trying to keep track of employees in my database. I have two tables, Employees and Departments. The Employees table contains a foreign key relationship with Departments through a column named DepartmentID.

Here's my entity:

[code]....

I have a page that contains a form to add an employee. I'm passing the entity to my view page, and calling <%: Html.EditorForModel() %>

The problem is that the view creates a textbox for the DepartmentID.

How can I force the view to display a dropdown for DepartmentID that contains all the Departments in my database as the dropdown's list items? Is there a way to do this by just adding a metadata attribute to the property in my entity?

View 1 Replies

LinqDataSource Dynamic Parameters - Forcing An Or With WhereParameters?

Jul 22, 2010

In my "selecting" statement I need to add two dynamic parameters when using the LinqDataSource's WhereParameters collection:

e.WhereParameters.Add(param, True)

However, the system adds these parameters as AND, but I want to perform an OR where either parameter 1 OR parameter 2 is true.

View 2 Replies

AJAX :: Forcing Full Postback In UpdatePanel

Apr 19, 2010

I have basically the following structure set up :

[Code]....

I am aware that a FileUpload requires a full page postback. I read the article http://www.4guysfromrolla.com/articles/090209-1.aspx[^]I tried to install a PostBackTrigger programmatically to get a full postback only on the ImageButton1 control. All other postbacks must be partial. (GridView sorting, paging, ...)In code behind I do :

[Code]....

The above code does not seem to install a full postback only for the ImageButton1, so the file upload fails. How can I make this work ?

View 6 Replies

Web Forms :: Forcing Postback Of IFrame Form

Jan 6, 2010

I'm trying to solve a problem and am open to any suggestions. Here's the situation:

I have a checkout page that has an iFrame that contains a credit card form. The credit card form resides on an external site that is PCI compliant (and it is a requirement that we are PCI compliant so having the credit card form on our domain is not an option). When the user submits the checkout form, I need a way to force the submission of the iFrame form on the server side. This is because I need to wait for the credit card form's site to send back a reply via a web service on my end, which will be passing a token that I save and use later on when the order is submitted. I also will display any validation errors that are reported from the credit card form site, also via the web service.

This all worked just fine in a simulation, but I'm getting permission errors trying to access the form in the iFrame across domains (and after researching this, apparently it's not possible to access an iFrame's document across domains). I need a way to force the submit of the iFrame form on the server side without having access to the form itself. Can this be done? Can anyone suggest an alternative to what I'm trying to accomplish?

View 1 Replies

Web Forms :: Forcing An Asp:Button To Display An Image?

Feb 18, 2010

Before you say use an ImageButton, this is not an option. I only have access to the client side right now.

View 1 Replies

AJAX :: Forcing Postback On Textbox - Update Not Working

Mar 8, 2010

Hoping I have placed my question in the correct forum.

I am writing an application that simply updates a text box (contained in a AJAX UpdatePanel) via a thread. the eventual idea being that the textbox will be placed in the master page, and a thread will poll a table to check for status messages. 90% of the code works as it should, the only side that is not working, is physically updating the textbox. The value of the textbox is being updated, but it is not being reflected on the screen. When the text is updated in the textbox, the OnChange event is not firing (as it shouldn't), but I still need the textbox to be updated. The textbox is being updated prgramatically, and not by the user.

When the thread triggers, it just fires an event, which right now just updates the textbox with the current date time. I've tried a million and one different ways, but still no luck :( Anyone know where I am going wrong?

Here is my code:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Always" runat="server">
<ContentTemplate>
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell>
<asp:Label ID="lblThread1" runat="server" Text="Thread1"></asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtThread1" AutoPostBack="true" runat="server"></asp:TextBox>
</asp:TableCell>
<asp:TableCell>
<asp:Button ID="btnstartThread1" runat="server" Text="Start Thread 1" onclick="btnstartThread1_Click" />
</asp:TableCell>
<asp:TableCell>
<asp:Button ID="btnStopThread1" runat="server" Text="Stop Thread 1" onclick="btnStopThread1_Click" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel>

public partial class _Default : System.Web.UI.Page
{
private static clsThread1 _objObject1 = new clsThread1();
private static Thread _objThread1;

//****************************************
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
_objObject1.UpdateThread1Time += new EventHandler(UpdateThread1TimeEvent);
}
}
//****************************************
private void UpdateThread1TimeEvent(object sender, EventArgs e)
{
this.txtThread1.Text = System.DateTime.Now.ToString();
}
//****************************************
protected void btnstartThread1_Click(object sender, EventArgs e)
{
_objThread1 = new Thread(new ThreadStart(_objObject1.StartProcess));
_objThread1.Start();
while (!_objThread1.IsAlive) ;
}
//****************************************
protected void btnStopThread1_Click(object sender, EventArgs e)
{
if (_objThread1 != null)
{
_objThread1.Abort();
_objThread1.Join();
}
}
//****************************************
}
public class clsThread1
{
public event EventHandler UpdateThread1Time;
public void StartProcess()
{
while (true)
{
UpdateThread1Time(this, EventArgs.Empty);
}
}
}

View 6 Replies

Web Forms :: Wizard Control - Forcing NextButton Click?

Mar 29, 2010

I have a problem at the moment that I cannot figure out how to solve. I have an asp:Wizard control on my page, which contains a google map. Now, for google maps, you need to specify what html will be put into the info windows (the little bubble that comes up when a marker is clicked).

What I want is for my info window to have a 'Select and Continue' button in it, which would act the same way as if the user clicked the next button on the Wizard at that time.

So when I create the html for the info window, I have the following:-

[Code]....

However, the page just seems to reload, and the wizard doesn't move on to the next step.

View 1 Replies

JQuery - Forcing Page To Halt Until Data Is Finished Loading

Oct 25, 2010

I might be wrong about what is actually happening here but i have 3 Html.dropdownlists. And im using jquery to handle filtering which does actually work. However, there is some odd behaviour which i think might be because data isnt finished loading before the next function is called. For instance: Some background. Company: Owns several field offices Field Office: Owns several facilties So logically, when you change company, field offices should change, which then changes facilities.

$(function () {
$(document).ready(function () {
var cid = $("#CompanyId").val();
$.post("/ManifestSearch/GetFilteredFieldOffices", { id: cid }, function (data) {
$("#FieldOfficeId").loadSelect(data);
});
var fid = $("#FieldOfficeId").val();
$.post("/ManifestSearch/GetFilteredFacilities", { id: fid }, function (data) {
$("#FacilityId").loadSelect(data);
});
});
});
Now, when the page loads, everything looks fine. All the dropdownlists have the correct data.
When i change company, this calls.
$(function () {
$('#CompanyId').change(function () {
var cid = $(this).val();
$.post("/ManifestSearch/GetFilteredFieldOffices", { id: cid }, function (data) {
$("#FieldOfficeId").loadSelect(data);
});
var fid = $("#FieldOfficeId").val();
$.post("/ManifestSearch/GetFilteredFacilities", { id: fid }, function (data) {
$("#FacilityId").loadSelect(data);
});
});
});

This changes the field offices to the correct list, however facilities changes to whatever field offices was set to before the company change occured. I dont know enough about jquery to figure out exactly what is going on, but my instinct tells me that the two posts are happening at the same time, and the second post happens before the first one is finished.

View 1 Replies

Forcing Child / Container Events To Fire Before Parent Onload?

May 12, 2010

I'm working on a questionnaire type application in which questions are stored in a database. Therefore, I create my controls dynamically on every Page.OnLoad.This works like a charm and ViewState is persisted between postbacks because I ensure that my dynamic controls always have the same generated Control.ID.

In addition to the user control that dynamically populates the questions, my questionnaire page also contains a 'Status' section (also encapsulated by a user control) which represents the status of the questionnaire (choices are 'Complete', 'Started' or 'In Progress'). If the user changes the status of questionnaire (i.e. from 'In Progress' to 'Complete'), I need to postback to the server because the contents of the dynamic portion of the questionnaire depend on the selected status.

Some questions are always present regardless of status, and yet others may not be present at all for the selected status. The point is, when the status changes, I have to postback to the page and render the right set of questions. Additionally, I need to preserve any user entered values for those questions which are 'always available'.

However, due to the page life cycle in ASP.NET, the 'Status' user control's OnLoad, which contains the correct status needed to load the right questions from the DB, doesn't get executed until after the 'dynamic questions' user control has already been populated (with the wrong/stale values).

To get around this, I raise an event from my 'Status' user control to the main page to indicate that the Status has changed. The main page then raises an event on the 'dynamic questions' user control. Since by the time this event bubbles up, the 'dynamic questions' user control has already loaded the 'wrong' questions from the DB, it first calls Controls.Clear. It then happily uses the new status to query the database for the 'correct' questions and does a Control.Add() on each. FYI, Control.IDs are consistent across postbacks.

This solution works...sorta. The correct set of questions for the selected status do get rendered; however ViewState is getting lost for those 'always available' questions. I'm guessing this is because the 'dynamic questions' user control calls Controls.Clear when responding to the status changed event. This must somehow kill the association between ViewState and my dynamic controls, even though the Control.IDs are consistent.

This seems like such a common requirement, I'm virtually certain there is a better, cleaner and less error prone approach to accomplish this. In case its not plainly obvious, I haven't been able to grok the ASP.NET page life-cycle despite working with it for the last year.

View 4 Replies







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