FormView control - change font color or back color

When a user modifies the value in a textbox in a "EditTemplate" of the Form View, I would like the font color or back color of the text box to change - even before the update is submitted.

How can I do that? Thanks.

2/29/2008 9:12:44 PM 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 3

You can add an onchange event to your textbox:


Or use the onkeyup event as well. You may need to add the handler for this if your textbox box is being created in the client side.

Please mark as "answer" if this helped you in anyway.
2/29/2008 10:11:02 PM

Thanks. here is how I did it:

Protected Sub FirstNameTextBox_OnTextChanged(ByVal sender As Object, ByVal e As EventArgs)

Dim t1 As TextBox

t1 = FormView1.FindControl("FirstNameTextBox")

t1.BackColor = Color.GreenYellow

End Sub

3/5/2008 9:26:07 PM

Similar Artilces:

Upload control / color chart control / calendar control
Does anyone know of an advanced upload control with all the bells and whistles available? The same for a color chart and calendar control. Thank you, Steve About a chart control you can try one I wrote: WebChart Control It is free. Chart FX for .NET is the most advanced charting control for ASP.NET. You can check it out at --- IG Software FX Yep. But Dundas isn't shabby either. DonDon Kiely, MCP, MCSDIn the Last Frontier, Interior AlaskaPlease post questions and replies to the forum! And remember to MARK AS ANSWER when someone defi...

back and font color, alignment of controls
1) I am using he below code for a button <mobile:Panel ID="srch" runat="server"  BackColor="#000000"><mobile:Command ID="btnSrch" Format="Button" Text="SEARCH" Font-Bold="true" In the design view, the back color is black and the font color is blue. But when I run this in IE, it is showing the default colors. What could be the problem? 2) I have 2 controls in a row. I want the first control aligned to the left and the second control aligned to the right. if i give 'breakafter=false' after the 1st control and 'alignment=right' for 2nd control, even though the alignment is pro...

More control over fonts and colors?
I used to develop my code in VS.NET 2003, but used Dreamweaver to write the html, mainly because VS would re-write hand-coded html and I'm picky. Now I've gotten VS 2005 and I am trying it out.  However, a really nice feature of the DW code view is that different tags get different colors (table is green, input is yellow, br is blue, etc).  I would really like to implement this in VS 2005. But when I look at the Fonts and Colors options, there are options to change the color for HTML Element Name, HTML Attribute Name, HTML Attribute Value, etc.  But I don't see a way of chan...

Cascading Dropdown error in formview controls and finding all controls in formview controls
can help with the following? Instantiate Cascading Dropdowns within Formview controls (this returns the error message "databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control".) Pass values between controls within master controls such as Textboxes within formviews (example: Pass the selected value in a dropdownlist to another textbox both WITHIN a formview control) Expose the public properties of a master page Hi arraybiz, 1) I need your code. See sample:

Possible to control color of bar in DW Graph control
This is related to my prior posting in that the same client (on the same bill format to be sent via email) wants a simple bar chart (like those displayed on most electric and gas bills). The problem I have is that he wants the BARS on this chart to be blue and NOT the default red color. I've looked everywhere and even exported the DW source and looked thru all of the text describing the graph control, but I can't find anyway to change the color of the bar from that default "red" color to anything else. Does anyone know of any way to control the color of the bars in ...

How to make template field control color same as row background color
This is really a two part thing:  1.)  I want to make a linkbutton control in a templatefield the same color as the row color. I have alternating row colors, so I can't just hard code it. 2.) I want to make the link button change colors when the mouse goes over the ROW. Then go back to row color onmouseout.  So basically, the link will be invisible until the row is moused over.  Thanks! Here are a couple of examples.  In GridView1, the HyperLink color is set to match the background color.  Note the RowStyle and AlternatingRowStyle do not override ...

Controlling fonts and font sizes in a menu control
Am building a menu programically (fragment below):Dim mnuTopics As New MenuItem("Lessons") For i As Integer = 1 To 10    Dim menuLesson As New MenuItem("Subject" & i, Nothing, Nothing, "~/Main.aspx?page=Subject&ID=" & i)    mnuTopics.ChildItems.Add(menuLesson)Next MainMenu.Items.Add(mnuTopics) Dim menuProfile As New MenuItem("Profile", Nothing, Nothing, "~/Main.aspx?action=profile")MainMenu.Items.Add(menuProfile)am unable to programically change menu font sizes. Don't want to access a theme/skin--just want to programmically change the font size ba...

Font color on a TButton or TBitBtn control
Hi, How can I set the font color on any of those button controls? In the IDE, I can set the color to whatever I want, but it doesn't colorize my button when I run it (or on the design page), while i.e. setting a bold font or the font size will work. I'm using C++ Builder 2009 TIA, Rutger Kars <Rutger Kars> wrote in message > How can I set the font color on any of those button controls? You cann't chang the color of a TButton. It is drawn by the OS, not the VCL. You need an owner-drawn button in order to draw the Font co...

Setting Back Color of Rating Control
I have a Rating control. I have set its back color. but when i am running that. Back color is not reflecting....If you found this post helpful. Please mark it as answer. Hi Intelligents, As far as I know, no build-in functions can achieve this unless you change its implementation by modify its source code.  By researching its source code, // _initializeLayout    _initializeLayout : function() {        // Element for the slider's rail.        this._railElement = document.createElement('DIV&#...

Setting font/color properties for Treeview control??
Hi Does anybody know how to set the font/color for the Treeview control. I suspect it will have to be done with an xsl sheet, but what I have tried thus far hasn't worked. Any suggestions welcome. Cheers KKKK You can use the DefaultStyle, SelectedStyle, and HoverStyle properties of the treeview and treenodetype tags: <ie:TreeView id="tvFunction" runat="server" BackColor="#bbddff" ChildType="Root" Width="220px" Height="100%" DefaultStyle="font-family:verdana; font-size: xx-small;" SelectedStyle...

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

How do I control parameter a control that is inside a formview that has another formview in it?
I have a formview2 within another formview1 but I want to control parameter from a sqlDataSource3 outside the formview a control that is in formview2<asp:SqlDataSource ID="SqlDataSource1" SelectCommand='SELECT "USER,UID" FROM "TUSERS"'><asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1">    <ItemTemplate>        <asp:Label ID="Label1" runat="server" Text='<%# Bind("USER") %>'></asp:La...

How access controls in formview control?
I have a Lable control inside of a Formview control Empty Template. How do I access the lable control in the empty tamplate in the databound method? Try:if (FormView1.Row.RowType == DataControlRowType.EmptyDataRow) { Label l = (Label)FormView1.FindControl("Label1"); if (l = !null) { l.Text = "Found a label"; } }  Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET vinz:Try:if (FormView1.Row.RowType == DataControlRowTy...

Formview control with in Wizard control
I have a wizard control in which it promts the user if he is a delaer or customer. on next step it displays the result. Results are almost same for both dealer and customer but for customer I need to remove few things. How can I take care of this? one thing I can do is create unique steps for dealer and customer. There shoud be a work around just to hide few items. With in formcontrol I am using table? How can I have different color for each row and column within form to make is easy for user to read? Is there some template property I need to use for form? you can use wizard step events...

How to find the TextBox control in a panel and asign back color
Hi, I have 10 textbox and 10 labels inside a panel. on page load i have asigned backcolor of each text box to silver and readonly=true. when user clicks on edit button i need to change the text box color to white or any other color and chage readonly to false. Can any one tell me how can i find textbox in a panel and change those properties. thanks in advance Hello, suppose you have a textbox called txt1, then use this: Control ctrl = Page.FindControl("txt1"); TextBox TempTxt; TempTxt = (TextBox)ctrl; TempTxt.Text = "Hello World !!"; regar...

Web resources about - FormView control - change font color or back color -

Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta
In this article, Scott discusses the recently released beta version of Visual Studio 2008 and .NET Framework 3.5 Service Pack 1. He starts with ...

Visual Studio 11 Beta in Context
... data controls. I blogged about this before in my Elegant Web Forms post . There's two way data-binding in controls like the FormView now instead ...

Visual Studio General Questions Forum
Sign in Home Samples Languages Extensions Documentation Community Forums CodePlex User Voice File a Bug Get started for free Visual Studio Developer ...

Advanced Residential Search

Keep, share, and discover the best of the Web using Delicious, the world's leading social bookmarking service.

ASP.NET Web Forms DynamicData FieldTemplates for DbGeography Spatial Types
... - 10 Tutorials Mixing Razor Views and WebForms Master Pages with ASP.NET MVC DbGeography FieldTemplates for ASP.NET Web Forms Here's a FormView ...

Resources last updated: 12/28/2015 12:39:46 PM