Search Results

Search found 3025 results on 121 pages for 'textbox'.

Page 9/121 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How can I create a finger scrollable Textbox in WM 6.5?

    - by Papajohn
    Hi everybody. I just noticed something weird in WM 6.5 emulators. Unlike 6.1 where finger panning kind of worked, the only way to scroll a Textbox appears to be through scrollbars. This behaviour is in contrast to what they have done for comboboxes: they are now gesture-friendly without the programmer's intervention. I.e. the user can select a choice from a standard drop down menu by panning and scrolling. Previously, you had to use the embedded scrollbar. The combobox's case implies that MS took some measures to provide standard gesture support for classic finger gestures, yet I cannot see something similar for textboxes. This makes me ask the following: Is there anything that can be done to make textboxes finger scrollabe easily? Note that I refer to managed .NET CF development. It is my understanding that in native development I could use the new Gestures API to achieve the scrolling effect. Yet, I am not sure if there is an easier and more straightforward method that I have missed.

    Read the article

  • Getting TexBox's ID's .... to Calculate

    - by jjj
    i have : vb code: Private Sub Calculation() Dim txt1 As Decimal txt1 = (CS_Incoms_done.Text / CS_Incoms_target.Text) * 100 CS_Incom_Result.Text = "%" + FormatNumber(txt, 2, TriState.False) Dim txt2 As Decimal txt2 = (CS_GovernmentService_done.Text / CS_GovernmentService_target.Text) * 100 CS_GovernmentService_Result.Text = "%" + FormatNumber(txt2, 2, TriState.False) Dim txt3 As Decimal txt3 = (CS_RentBox_done.Text / CS_RentBox_target.Text) * 100 CS_RentBox_Result.Text = "%" + FormatNumber(txt3, 2, TriState.False) Dim txt4 As Decimal txt4 = (CS_ServiceAdvertising_done.Text / CS_ServiceAdvertising_target.Text) * 100 CS_ServiceAdvertising_Result.Text = "%" + FormatNumber(txt4, 2, TriState.False) Dim txt5 As Decimal txt5 = (CS_ServiceCatogray_done.Text / CS_ServiceCatogray_target.Text) * 100 CS_ServiceCatogray_Result.Text = "%" + FormatNumber(txt5, 2, TriState.False) End Sub i just show you 5 textbox's of 100 textbox's .... and don't want to complete all the textbox's like this ... i want a simple code to do it.. ... as you notice , every three textbox's are look a like on the first two parts of their id's..~ for example -- CS_ServiceCatogray _Result.Text, CS_ServiceCatogray _done.Text and CS_ServiceCatogray _target.Text... ~..and the last part is the same in all textbox's for geving the Result .. _Result.Text , _done.Text and _target.Text So... i had an idea to take the id and put the Similar two parts in an array... and use For Each something like: Dim allItems As Array For Each item As Control In panel4.Controls Select Case item.[GetType]().Name Case "TextBox" 'here just be sure that this item is not saved in the allItems array ,if it is not do >>' allItems[Last_Item_Saved_Index+1] = DirectCast(item, TextBox).ID ', but i want to save just the two Similar parts of the textboxs ids' 'i am not sure if this completely correct, but i wanted to do something like it[' Dim partOFtxt As String = allItems[Last_Item_Saved_Index] Dim txt As Decimal = (partOFtxt + "_done.Text") / (partOFtxt + "_target.Text") (partOFtxt + "_Result.Text") = "%" + FormatNumber(txt, 2, TriState.False) ']' 'end condition' Exit Select Case Else Exit Select End Select Next i hope that you get the idea.. if you have a better idea ... it would be nice.. Thanks in advance..

    Read the article

  • How to use this json string with jquery autocomplete?

    - by Pandiya Chendur
    I have two textboxes in my page, <asp:TextBox ID="TxtClientName" runat="server"></asp:TextBox> <asp:TextBox ID="TxtClientMob" runat="server"></asp:TextBox> and i have a json string, {"Table" : [{"ClientName" : "Pandiya","ClientMobNo" : "9566643707"}, {"ClientName" : "Bala","ClientMobNo" : "9994403569"}]} Is it possible to use this json string to autocomplete in two textboxes seperating keys ClientName and ClientMobNo in jquery..... Any suggestion....

    Read the article

  • C++ Windows Forms application unhandled exception error when textbox empty

    - by cmorris1441
    I'm building a temperature conversion application in Visual Studio for a C++ course. It's a Windows Forms application and the code that I've written is below. There's other code to of course, but I'm not sure you need it to help me. My problem is, when I run the application if I don't have anything entered into either the txtFahrenheit or txtCelsius2 textboxes I get the following error: "An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll" The application only works right now when a number is entered into both of the textboxes. I was told to try and use this: Double::TryParse() but I'm brand new to C++ and can't figure out how to use it, even after checking the MSDN library. Here's my code: private: System::Void btnFtoC_Click(System::Object^ sender, System::EventArgs^ e) { // Convert the input in the Fahrenheit textbox to a double datatype named fahrenheit for manipulation double fahrenheit = Convert::ToDouble(txtFahrenheit->Text); // Set the result string to F * (5/9) -32 double result = fahrenheit * .5556 - 32; // Set the Celsius text box to display the result string txtCelsius->Text = result.ToString(); } private: System::Void btnCtoF_Click(System::Object^ sender, System::EventArgs^ e) { // Convert the input in the Celsius textbox to a double datatype name celsius for manipulation double celsius = Convert::ToDouble(txtCelsius2->Text); // Set the result2 string to C * (9/5) + 32 double result2 = celsius * 1.8 + 32; // Set the Fahrenheit text box to display the result2 string txtFahrenheit2->Text = result2.ToString(); }

    Read the article

  • manipulating textbox value

    - by chameios
    hello All, I am new to the programming world of dojo and web applications. I am trying to acomplish a task where I want to manipulate the textbox value with some text. I tried everything including some code from dojocampus, but even this code doesnot do anything. I have also tried to create an instance , with dojo.widget.byId and dijit.byId and then tried the instance.value = 'newtext' and everything that I could find but for some reason , the textbox is not updating. Please help me. <html> <head> <title>Dojo example</title> <style type="text/css"> @import "pathtodojo/dijit/themes/nihilo/nihilo.css"; </style> <style type="text/css"> </style> <script type="text/javascript" src="pathtodojo/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug: true"></script> <script> dojo.require("dijit.form.TextBox"); function init() { var box0 = dijit.byId("value0Box"); var box1 = dijit.byId("value1Box"); box1.attr("value", box0.attr("value") + " modified"); dojo.connect(box0, "onChange", function(){ box1.attr("value", box0.attr("value") + " modified"); }); } dojo.addOnLoad(init); </script> <body class="nihilo"> A textbox with a value: <input id="value0Box" dojoType="dijit.form.TextBox" value="Some value" intermediateChanges="true"></input> <br> A textbox set with a value from the above textbox: <input id="value1Box" dojoType="dijit.form.TextBox"></input> <br> </body> </html> regards C

    Read the article

  • Chrome : type in textboxes instead of selecting them

    - by rlb.usa
    Hi guys, not sure what is happening but quite often i go to highlight/doubleclick text in a textbox in Google's Chrome browser, and somehow the textbox itself gets selected. I have to redo my selection so it selects the text inside... It is hard to explain but is it possible that whenever I have a textbox selected, when I type, the text I type goes in the box (instead of nowhere)? It seems like a rather uh, silly/stupid question, but it would save me time and make my browsing more efficient. I can work a mouse and type just as well as anyone else, Chrome is the only browser I have trouble in where it likes to select the textboxes instead of the text inside the textboxes. I love Chrome.

    Read the article

  • ValidationProperty not returning entered value for textbox in custom ontrol

    - by nat
    hi I have a custom control, (relevant code at the bottom) it consists of some text/links and a hidden textbox (rather than a hidden input). when rendered, the user via another dialog and some JS sets the value of the textbox to an integer and clicks submit on the form. i am trying to assure that the user has entered a number (via the JS) and that the textbox is not still set to its default of "0" the requiredfieldvalidator works just fine, if i dont change the value it spots it on the client and fills the validation summary on the page with the appropriate message. unfortunately when i do fill the textbox, the validator also rejests the post as the controls textbox text value is still set to "0", even though on the form it has changed. clearly i am doing something wrong.. but cant work out what it is? could someone enlighten me please, this is driving me potty if i step through the code, when the get of the mediaidtext is hit,the findcontrol finds does not the textbox, if i inspect the controls collection however i can find the textbox, but its value is still "0" it also seems that when findcontrol is called, the createchildcontrols is called again - thus resetting the value back to "0" there.. ! how can i ever assure the control realises that the textbox value has changed? many thanks code below nat [ValidationProperty("MediaIdText")] public class MediaLibraryFileControl: CompositeControl { private int mediaId = 0; public int MediaId { get { return mediaId; } set { mediaId = value; } } public string MediaIdText { get { string txt = "0"; Control ctrl = this.FindControl(this.UniqueID+ "_hidden"); try { txt = ((TextBox)ctrl).Text; MediaId = Convert.ToInt32(txt); } catch { MediaId = 0; } return txt; } } protected override void CreateChildControls() { this.Controls.Add(new LiteralControl("<span>")); this.Controls.Add(new LiteralControl("<span id=\"" + TextControlName + "\">" + getMediaDetails() + "</span>")); TextBox tb = new TextBox(); tb.Text = this.MediaId.ToString(); tb.ID = this.UniqueID + "_hidden"; tb.CssClass = "hidden"; this.Controls.Add(tb); if (Select == true) { this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}','{2}')\" class=\"select\">{3}</a>]", dialog, this.UniqueID, this.categoryId, "select"))); this.Controls.Add(new LiteralControl(string.Format("&nbsp;[<a href=\"javascript:{0}(this,'{1}')\" class=\"select\">{2}</a>]", clearDialog, this.ID, "clear"))); } this.Controls.Add(new LiteralControl("</span>")); } protected virtual string getMediaDetails() { //... return String.Empty; } } this is the code adding the validationcontrol the editcontrol is the instance of the control above public override Control RenderValidationControl(Control editControl) { Control ctrl = new PlaceHolder(); RequiredFieldValidator req = new RequiredFieldValidator(); req.ID = editControl.ClientID + "_validator"; req.ControlToValidate = editControl.ID; req.Display = ValidatorDisplay.None; req.InitialValue = "0"; req.EnableClientScript = false; req.ErrorMessage = "control cannot be blank"; ctrl.Controls.Add(req); return ctrl; }

    Read the article

  • ASP.net MVC How to change the Textbox Class upon validation failure?

    - by Harry
    I notice in the default MVC template project that the Account registration fields are highlighted via a class change. I can't seem to get the same behavour out of my own code (in the same project - same CSS etc) What might be stopping this from occuring? Update I believe this relates to one of my other questions Because I was having trouble with NullReferenceExceptions I have changed the Html.ValidationMessage fields to have different names than the target fields. So really, I need to resolve this question

    Read the article

  • datagrid binding

    - by abcdd007
    using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class OrderMaster : System.Web.UI.Page { BLLOrderMaster objMaster = new BLLOrderMaster(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { SetInitialRow(); string OrderNumber = objMaster.SelectDetails().ToString(); if (OrderNumber != "") { txtOrderNo.Text = OrderNumber.ToString(); txtOrderDate.Focus(); } } } private void InsertEmptyRow() { DataTable dt = new DataTable(); DataRow dr = null; dt.Columns.Add(new DataColumn("ItemCode", typeof(string))); dt.Columns.Add(new DataColumn("Description", typeof(string))); dt.Columns.Add(new DataColumn("Unit", typeof(string))); dt.Columns.Add(new DataColumn("Qty", typeof(string))); dt.Columns.Add(new DataColumn("Rate", typeof(string))); dt.Columns.Add(new DataColumn("Disc", typeof(string))); dt.Columns.Add(new DataColumn("Amount", typeof(string))); for (int i = 0; i < 5; i++) { dr = dt.NewRow(); dr["ItemCode"] = string.Empty; dr["Description"] = string.Empty; dr["Unit"] = string.Empty; dr["Qty"] = string.Empty; dr["Rate"] = string.Empty; dr["Disc"] = string.Empty; dr["Amount"] = string.Empty; dt.Rows.Add(dr); } //GridView1.DataSource = dt; //GridView1.DataBind(); } private void SetInitialRow() { DataTable dt = new DataTable(); DataRow dr = null; dt.Columns.Add(new DataColumn("RowNumber", typeof(string))); dt.Columns.Add(new DataColumn("ItemCode", typeof(string))); dt.Columns.Add(new DataColumn("Description", typeof(string))); dt.Columns.Add(new DataColumn("Unit", typeof(string))); dt.Columns.Add(new DataColumn("Qty", typeof(string))); dt.Columns.Add(new DataColumn("Rate", typeof(string))); dt.Columns.Add(new DataColumn("Disc", typeof(string))); dt.Columns.Add(new DataColumn("Amount", typeof(string))); dr = dt.NewRow(); dr["RowNumber"] = 1; dr["ItemCode"] = string.Empty; dr["Description"] = string.Empty; dr["Unit"] = string.Empty; dr["Qty"] = string.Empty; dr["Rate"] = string.Empty; dr["Disc"] = string.Empty; dr["Amount"] = string.Empty; dt.Rows.Add(dr); //Store DataTable ViewState["OrderDetails"] = dt; Gridview1.DataSource = dt; Gridview1.DataBind(); } protected void AddNewRowToGrid() { int rowIndex = 0; if (ViewState["OrderDetails"] != null) { DataTable dtCurrentTable = (DataTable)ViewState["OrderDetails"]; DataRow drCurrentRow = null; if (dtCurrentTable.Rows.Count > 0) { for (int i = 1; i <= dtCurrentTable.Rows.Count; i++) { //extract the TextBox values TextBox box1 = (TextBox)Gridview1.Rows[rowIndex].Cells[1].FindControl("txtItemCode"); TextBox box2 = (TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl("txtdescription"); TextBox box3 = (TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl("txtunit"); TextBox box4 = (TextBox)Gridview1.Rows[rowIndex].Cells[4].FindControl("txtqty"); TextBox box5 = (TextBox)Gridview1.Rows[rowIndex].Cells[5].FindControl("txtRate"); TextBox box6 = (TextBox)Gridview1.Rows[rowIndex].Cells[6].FindControl("txtdisc"); TextBox box7 = (TextBox)Gridview1.Rows[rowIndex].Cells[7].FindControl("txtamount"); drCurrentRow = dtCurrentTable.NewRow(); drCurrentRow["RowNumber"] = i + 1; drCurrentRow["ItemCode"] = box1.Text; drCurrentRow["Description"] = box2.Text; drCurrentRow["Unit"] = box3.Text; drCurrentRow["Qty"] = box4.Text; drCurrentRow["Rate"] = box5.Text; drCurrentRow["Disc"] = box6.Text; drCurrentRow["Amount"] = box7.Text; rowIndex++; } //add new row to DataTable dtCurrentTable.Rows.Add(drCurrentRow); //Store the current data to ViewState ViewState["OrderDetails"] = dtCurrentTable; //Rebind the Grid with the current data Gridview1.DataSource = dtCurrentTable; Gridview1.DataBind(); } } else { // } //Set Previous Data on Postbacks SetPreviousData(); } private void SetPreviousData() { int rowIndex = 0; if (ViewState["OrderDetails"] != null) { DataTable dt = (DataTable)ViewState["OrderDetails"]; if (dt.Rows.Count > 0) { for (int i = 1; i < dt.Rows.Count; i++) { TextBox box1 = (TextBox)Gridview1.Rows[rowIndex].Cells[1].FindControl("txtItemCode"); TextBox box2 = (TextBox)Gridview1.Rows[rowIndex].Cells[2].FindControl("txtdescription"); TextBox box3 = (TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl("txtunit"); TextBox box4 = (TextBox)Gridview1.Rows[rowIndex].Cells[4].FindControl("txtqty"); TextBox box5 = (TextBox)Gridview1.Rows[rowIndex].Cells[5].FindControl("txtRate"); TextBox box6 = (TextBox)Gridview1.Rows[rowIndex].Cells[6].FindControl("txtdisc"); TextBox box7 = (TextBox)Gridview1.Rows[rowIndex].Cells[7].FindControl("txtamount"); box1.Text = dt.Rows[i]["ItemCode"].ToString(); box2.Text = dt.Rows[i]["Description"].ToString(); box3.Text = dt.Rows[i]["Unit"].ToString(); box4.Text = dt.Rows[i]["Qty"].ToString(); box5.Text = dt.Rows[i]["Rate"].ToString(); box6.Text = dt.Rows[i]["Disc"].ToString(); box7.Text = dt.Rows[i]["Amount"].ToString(); rowIndex++; } dt.AcceptChanges(); } ViewState["OrderDetails"] = dt; } } protected void BindOrderDetails() { DataTable dtOrderDetails = new DataTable(); if (ViewState["OrderDetails"] != null) { dtOrderDetails = (DataTable)ViewState["OrderDetails"]; } else { dtOrderDetails.Columns.Add(""); dtOrderDetails.Columns.Add(""); dtOrderDetails.Columns.Add(""); dtOrderDetails.Columns.Add(""); dtOrderDetails.Columns.Add(""); dtOrderDetails.Columns.Add(""); dtOrderDetails.AcceptChanges(); DataRow dr = dtOrderDetails.NewRow(); dtOrderDetails.Rows.Add(dr); ViewState["OrderDetails"] = dtOrderDetails; } if (dtOrderDetails != null) { Gridview1.DataSource = dtOrderDetails; Gridview1.DataBind(); if (Gridview1.Rows.Count > 0) { ((LinkButton)Gridview1.Rows[Gridview1.Rows.Count - 1].FindControl("btnDelete")).Visible = false; } } } protected void btnSave_Click(object sender, EventArgs e) { if (txtOrderDate.Text != "" && txtOrderNo.Text != "" && txtPartyName.Text != "" && txttotalAmount.Text !="") { BLLOrderMaster bllobj = new BLLOrderMaster(); DataTable dtdetails = new DataTable(); UpdateItemDetailRow(); dtdetails = (DataTable)ViewState["OrderDetails"]; SetValues(bllobj); int k = 0; k = bllobj.Insert_Update_Delete(1, bllobj, dtdetails); if (k > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Login Denied", "<Script>alert('Order Code Alraddy Exist');</Script>", false); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Login Denied", "<Script>alert('Record Saved Successfully');</Script>", false); } dtdetails.Clear(); SetInitialRow(); txttotalAmount.Text = ""; txtOrderNo.Text = ""; txtPartyName.Text = ""; txtOrderDate.Text = ""; txttotalQty.Text = ""; string OrderNumber = objMaster.SelectDetails().ToString(); if (OrderNumber != "") { txtOrderNo.Text = OrderNumber.ToString(); txtOrderDate.Focus(); } } else { txtOrderNo.Text = ""; } } public void SetValues(BLLOrderMaster bllobj) { if (txtOrderNo.Text != null && txtOrderNo.Text.ToString() != "") { bllobj.OrNumber = Convert.ToInt16(txtOrderNo.Text); } if (txtOrderDate.Text != null && txtOrderDate.Text.ToString() != "") { bllobj.Date = DateTime.Parse(txtOrderDate.Text.ToString()).ToString("dd/MM/yyyy"); } if (txtPartyName.Text != null && txtPartyName.Text.ToString() != "") { bllobj.PartyName = txtPartyName.Text; } bllobj.TotalBillAmount = txttotalAmount.Text == "" ? 0 : int.Parse(txttotalAmount.Text); bllobj.TotalQty = txttotalQty.Text == "" ? 0 : int.Parse(txttotalQty.Text); } protected void txtdisc_TextChanged(object sender, EventArgs e) { double total = 0; double totalqty = 0; foreach (GridViewRow dgvr in Gridview1.Rows) { TextBox tb = (TextBox)dgvr.Cells[7].FindControl("txtamount"); double sum; if (double.TryParse(tb.Text.Trim(), out sum)) { total += sum; } TextBox tb1 = (TextBox)dgvr.Cells[4].FindControl("txtqty"); double qtysum; if (double.TryParse(tb1.Text.Trim(), out qtysum)) { totalqty += qtysum; } } txttotalAmount.Text = total.ToString(); txttotalQty.Text = totalqty.ToString(); AddNewRowToGrid(); Gridview1.TabIndex = 1; } public void UpdateItemDetailRow() { DataTable dt = new DataTable(); if (ViewState["OrderDetails"] != null) { dt = (DataTable)ViewState["OrderDetails"]; } if (dt.Rows.Count > 0) { for (int i = 0; i < Gridview1.Rows.Count; i++) { dt.Rows[i]["ItemCode"] = (Gridview1.Rows[i].FindControl("txtItemCode") as TextBox).Text.ToString(); if (dt.Rows[i]["ItemCode"].ToString() == "") { dt.Rows[i].Delete(); break; } else { dt.Rows[i]["Description"] = (Gridview1.Rows[i].FindControl("txtdescription") as TextBox).Text.ToString(); dt.Rows[i]["Unit"] = (Gridview1.Rows[i].FindControl("txtunit") as TextBox).Text.ToString(); dt.Rows[i]["Qty"] = (Gridview1.Rows[i].FindControl("txtqty") as TextBox).Text.ToString(); dt.Rows[i]["Rate"] = (Gridview1.Rows[i].FindControl("txtRate") as TextBox).Text.ToString(); dt.Rows[i]["Disc"] = (Gridview1.Rows[i].FindControl("txtdisc") as TextBox).Text.ToString(); dt.Rows[i]["Amount"] = (Gridview1.Rows[i].FindControl("txtamount") as TextBox).Text.ToString(); } } dt.AcceptChanges(); } ViewState["OrderDetails"] = dt; } }

    Read the article

  • Have VB.Net 2010 ErrorProvider Fire on Tabbing Out of BindingSource TextBox on a WinForm

    - by OneSource
    I have a TextBox control on a Windows Form that uses a DataSource custom object as its BindingSource. I have associated an ErrorProvider with the BindingSource like so: Dim dobExample As New DOExample ExampleBS.DataSource = dobExample epExample.DataSource = ExampleBS The ErrorProvider fires if I type a blank space in the TextBox and then press Tab to move to the next control, which is correct. But it doesn't fire if I just press Tab without entering anything. I want the ErrorProvider to show the Error, even if the TextBox is empty and not just validate when there is text in the TextBox. How do I accomplish this? As an additional bit of info, when I execute the following statement: epDOContact.GetError(TextBox) an empty string is returned even though the TextBox is empty when it is required to be present.

    Read the article

  • How to update textbox value

    - by Thomas
    I have a textbox in my View. I input a number into the textbox, and then i want the controller to multiply the number and put the result into the textbox. How can I do that? This is what i have done already. Let's start with the View: <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Index</title> </head> <body> <div> <h2>Please enter a number</h2> <% using (Html.BeginForm()) { %> <%=Html.TextBox("number")%> <input type="submit" value="Index" name ="Index" /> <% } %> </div> </body> </html> As you can see I have a simple textbox and button. This is my controller: using System.Web.Mvc; namespace MvcApplication1.Controllers { public class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { return View(); } [HttpPost] public ActionResult Index(int number) { number = number * 2; ViewData["id"] = number; return View(ViewData); } } } But nothing really happens. Yeah, I see the Post is being done, and the coded steps into public ActionResult Index(int number). I see that the number is taken from the textbox, it's multiplied correctly. I've tried using ViewData as you can see. I've also used TempData. This is another code for the textbox in the View I've tried: <%=Html.TextBox("number", ViewData["number"])%> But it doesn't matter. The textbox doesn't get updated with the new value. How can I do that?

    Read the article

  • Using now() in a <asp:textbox>

    - by Anthony
    Can anyone help. I am using a formview in VS 2005. I have different elements in my form databound to a database and I am performing an INSERT SQL statement. No problem. The problem is that I am trying to enter the current date into the SQL statement and I am having a problem. I can add <%now()% to the "Text" property of the asp:Textbox. But when I do, then I can't bind the textbox to a specific database column. How do I do both???? I can do this: <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Initiate_Date") %>' ></asp:TextBox> Or this: <asp:TextBox ID="TextBox2" runat="server" Text='<%# now() %>' ></asp:TextBox> But I don't know how to do both.

    Read the article

  • VBA : Obliger une saisie numérique dans une TextBox - Approche d'une résolution de besoin en VBA niv

    Bonjour, Ci-dessous, le lien vers un nouveau tutoriel : « Approche d'une résolution de besoin en VBA - niveau débutant - Obliger une saisie numérique dans une TextBox » Le but de ce tutoriel est : De présenter une bonne approche de la résolution d'un problème simple en VBA. D'expliciter en détail la démarche employée pour arriver à la solution voulue. D'expliciter les instructions VBA retenues à cette fin. De proposer un fichier téléchargeable qui présente une solution à un problème qui est source de fils de questions récurrentes. Lien vers ce tutoriel Vo...

    Read the article

  • How to perform an event on Textbox focus in ASP MVC?

    - by NewbieProgrammer
    I have three textboxes A, B and C in create user view. When user enters some text in textbox A and B, and then when he enters textbox C, I want to display the text of textbox A + text of textbox B in C with "-" in between. For example, He enters "ABC" in textBox A and then he enters "123" in textBox B. Now upon entering textBox C (focus event), I want to display "ABC - 123 - " in textBox C. "-" are added through code. How do I do that in MVC ?

    Read the article

  • WPF creating custom control - creating control like SpinBox extending TextBox

    - by veedoo
    Hi, What is the best way to extend a control? Lets choose for example SpinBox - we want to extend TextBox to SpinBox - just to add two buttons on the right side, which each one on click checks if Text property is a valid number and if it is increases or decreases the value by 1. Suposse that we have a lot of code using TextBox (Text, IsReadOnly properties and bindings etc.) so we want to replace TextBox by SpinBox without touching rest of the code. 1) we can inherit TextBox - so we have exactly the same interface, but how to add the buttons ?? 2) we can inherit from some layout control - eg. DockPanel - we can add buttons, but we lose TextBox interface. 3) after quick read about ControlTemplates I'm not sure, but I believe that we can add buttons and their logic using ControlTemplates 4) like about templates I'm not sure, but I hope we can inherit decorator class to create decorator with the buttons - we lose interface, but can add TextBox as a child I think that the best solutions is to combine 3) and 4) - create a decorator class and use it in a control template for TextBox. I would be grateful for your ideas and simple code how to implement 3 and 4, especially with code (c#), not xaml. Regards

    Read the article

  • ScreenManagement better practices ?! Textbox not focusing

    - by xykudyax
    I saw a question here using DataTemplates with WPF for ScreenManagement, I was curious and I gave it a try I think the ideia is amazing and very clean. Though I'm new to WPF and I read a lot of times that almost everything should be made in XAML and very little should be "coded behind". My questions resolves about using the datatemplate ideia, WHERE should the code that calls the transitions be? where should I define which commands are avaiable in which screens. For example: [ScreenA] Commands: Pressing B - Goes to state B Pressing ESC - Exits [ScreenB] Commands: Pressing A - Goes to state A Pressing SPACE - Exits where do I define the keyEventHandlers? and where do I call the next screen? I'm doing this as an hobby for learning and "if you are learning, better learn it right" :) Thank you for your time. Yes the Q/A I was talking is: What's a good way to handle game screen management in WPF? What I've done so far was to create a Screen class (derived from UserControl) and create some virtual methods: - one for Initializing stuff (like focus a given component by default) - another for inputHandling I handle it by using a switch case and by listening to the PreviewKeyDown event from the parent container (MainWindow) Im not able to do it another way! Help?!. - and a finally one that removes the keyEvent method (when the screen is terminated) Parent.PreviewKeyDown -= OnKeyDown; am I doing okay? I face a problem. When I add a new screen (userControl) containing a TextBox I'm not able to give it autofocus :/ The Caret is there but is not blinking and I have to hit "TAB" before being able to input anything at all :/

    Read the article

  • Disable pasting in a textbox using jQuery

    - by Michel Grootjans
    I had fun writing this one My current client asked me to allow users to paste text into textboxes/textareas, but that the pasted text should be cleaned from '<...>' tags. Here's what we came up with: $(":input").bind('paste', function(e) { var el = $(this); setTimeout(function() { var text = $(el).val(); $(el).val(text.replace(/<(.*?)>/gi, '')); }, 100); }) ; This is so simple, I'm amazed. The first part just binds a function to the paste operation applied to any input  declared on the page. $(":input").bind('paste', function(e) {...}); In the first line, I just capture the element. Then wait for 100ms setTimeout(function() {....}, 100); then get the actual value from the textbox, and replace it with a regular expression that basically means replace everything that looks like '<{0}>' with ''. gi at the end are regex arguments in javascript. /<(.*?)>/gi

    Read the article

  • WPF TextBox DataBind on EnterKey press

    - by Jobi Joy
    The default DataBinding on TextBox is TwoWay and it commits the text to the Property only when TextBox lost its focus. Is there any easy XAML way exists to make the DataBinding Happens when I press Enter Key on the TextBox?. I know it is pretty easy to do in the code behind, but imagine if this textBox is inside some complex DataTemplate.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >