.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

TextBox style="border:none" is not working :(

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

Hi everyone,

I have a ASP.NET form which have several textboxs.

I wanted to show this as non-edit mode (just displaying)

So I did :

<b>  Phone:</b>                 
                <asp:TextBox ID="TextBoxPhone" style="border:none; width:150px" runat="server">

All to my textboxs.

The problem is, it does not show in my Internet Explorer 7 browser,

but the box shows and someone could edit in Internet Explorer 8 browsers.  :(

How could I fix this? oh I have something in my 'html' tag which is:

<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />




I would appreciate any help!!! Laughing

View Complete Post

More Related Resource Links

SqlDataSource ControlParameter textBox:Not Working

I have a stored procedure that returns 3 searches1) ALL records2) Records staring with something3) Records containing somethingThe stored Proc works finehere is the proc header:CREATE PROCEDURE [dbo].[procGetOHLCSymbolReferenceQuick](@SearchContains VARCHAR(20)='X1234',@SearchStartsWith VARCHAR(20)='X1234')THE ISSUEI have a gridview on a user control, with two texboxes. The gridview is supplied by a SQLDataSource. The textboxes provide that Users Filter demands. The TEXT BOXES<asp:TextBox ID="txtNameStartsWith" runat="server" Width="75px" TextMode="SingleLine"  BackColor="#FFF6CD" /><ajaxtoolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtNameStartsWith" FilterType="LowercaseLetters,UppercaseLetters,Numbers,Custom"  ValidChars=" @$.^!" /><asp:TextBox ID="txtNameContains" runat="server" Width="75px" TextMode="SingleLine"  BackColor="#FFF6CD" /><ajaxtoolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="txtNameContains" FilterType="LowercaseLetters,UppercaseLetters,Numbers,Custom"  ValidChars=" @$.^!" />THE SQLPARAMETERS<SelectParameters&g

What is wrong with this TextBox style ???

Why doesn't this simple Style work for a TextBox? I expect the background/foreground colors to change when I change the text between "0" and "1" ...       <Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">            <Setter Property="Background" Value="Gray"/>                <Style.Triggers>                                <!-- If the Textbox holds a value of 1, then update the foreground/background -->                 <DataTrigger Binding="{Binding Path=Text}" Value="1">                     <Setter Property="Foreground" Value="Black"/>                     <Setter Property="Background" Value="White"/>                 </DataTrigger>                                  <!-- If the Textbox holds a value of 0, then update the foreground/b

TextBox AutoPostBack not working when handling other DHTML event


I have to format a number in a TextBox while it is being typed. Right after the TextBox looses focus, I need to do other processing on server side, including some database queries.

I'm doing the formatting by handling the onkeyup event, client side. But when I add the handler, the onTextChanged event stops firing on the server. I've tried different return values for the handler but unfortunatelly I'm stuck.

To reproduce the problem, here is a sample where the formatting function was replaced by a simple "convert to uppercase" function. You'll see that, contrary to the expected, the Label doesn't get filled when the TextBox looses focus. It does get filled, however, if the user presses the ENTER key.

What can I possibly be doing wrong with such a simple task?


<%@ Page Language="VB" %>

<script language="VB" runat="server">

Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)

'' Adding the event handler like this has the same effect as adding it inline

'txtTextBox.Attributes.Add("onkeyup", "return(upperCase(this));")

End Sub

Protected Sub txtTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)

lblTextBox.Text = S

Elementid.style.display not working


hi guys,

Showimgdiv s the div whose Position:absolute and dislay:none... onclick of a linkbitton i want to show the div

var iid=document.getElementById('ctl00_body_Showimgdiv')

Tis code works in IE but not in FF.. so i decided to go wit jquery and im a beginner in tat

var iddd=$("#Showimgdiv");


Either of tis dint work

Could anyone help me solve tis 

RequiredFieldValidator not working for TextBox?


Hi there,

I've recently finished building one of my first websites (and CMS) in ASP.NET but have came across a problem where a RequiredFieldValidator isn't working as it should do? I originally created the admin page to not require the RequiredFieldValidator, but now that I do need it the page won't acknowledge it's there. I have even set the field in the database to not accept nulls, but the query will still insert a null value into the database (SQL Server 2008 Express).

Hopefully someone can tell me what I'm doing wrong! The TextBox that I'm referring to is "txtSectionTitle"

Thanks :)

<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Register TagPrefix="ThePines" TagName="Navigation" Src="includes/navigation.ascx" %>
<%@ Register TagPrefix="ThePines" TagName="AdminNavigation" Src="includes/adminNavigation.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml">

<title>Add New Section - <%= ConfigurationManager.AppSettings["Web_Name"] %></title>
<meta http-equiv="Content-Type&quo

textchange event not working from textbox on formview


Hello guys.  I have a formview which in insertmode is required to assign a value to a textbox from another on textchange event.  I can't get it working.

here's formview code (in bold:  event call:

<asp:FormView ID="fvPrecios" runat="server" AllowPaging="True" DataSourceID="OdsPrecios"
        Style="position: relative" CellPadding="4" ForeColor="#333333"
        DataKeyNames="precnume" >
            <table style="position: relative" width="400">
                    <td style="width: 62px; height: 26px">
                        <asp:Label ID="lblEditNombre" runat="server" Text

Copy text into textbox and preserve font, style, etc.


Hi, I have a textbox on my page for users to enter input.  If they were to type text outside of the box, and then copy it into the textbox, how can I make the textbox able to preserve the style of the text copied into it: italics, bold-faced, etc.?

It currently will convert anything copied into it as plain text.

Thanks for your help. 

Trying to validate a textbox not working


I have a bunch of validation on my page and I have a summarygroup attached which works fine. I have a drop down that when "other" is chosen will place a textbox for the user to enter in information. I need to make this "other textbox" required. I added a custom validator however it never seems to fire?  Can someone give me some insite as to why just this one validation does not fire ?


<%@ Page Title="" Language="C#" MasterPageFile="~/SBSBRightBar.Master" AutoEventWireup="true"
    CodeBehind="Profile.aspx.cs" Inherits="SBSB.Profile" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <asp:Panel ID="Panel1" runat="server">
                <asp:MultiView ID="mvTopText" runat="server">
                    <asp:View ID="vwJoin" runat="server">
                        <asp:Panel ID="pnJoin" runat="server">

textbox in the form but text_changed not working correctly



I got a textbox in my form and I want to when a user start typing in the textbox the listbox below the textbox will select the item that starts with that string

for example, it i type I

than in myserver side code will call that SearchString method which will go through that listbox and do the rest...

protected void CountryTxt_TextChanged(object sender, EventArgs e)
        string s = CountryTxt.Text;

the problem is it only stops in the textchanged after I press the enter key; it doesn't seem to work just by typing the characters in the textbox...

<asp:TextBox ID="MachineTxt"
         runat="server" Width="42px"
         ontextchanged="CountryTxt_TextChanged" AutoPostBack="True"> </asp:TextBox>

Can someone give me some indications whether I'm doing something wrong ?



Dynamic TextBox Validation not working on dynamic DataGrid on PlaceHolder



I have a placeholder to which I programmatically add DataGrids... In the DataGrids, I programmatically add TextBoxes along with dynamic validations. Somehow, the DataGrids show up, but the dynamic validations don't work. If I set them to static, the blank space for them appears, but still, they wont work.

I'd appreciate your help on this.



Dynamic Filling of TextBox AutoComplete not working


Hi guys,


i would like to fill the textbox autocomplete stringcollection "on the fly" while typing. i don't want to fill the collection while initializing, 'cause it's too much data: the sql server-table has about 100.000+ rows. the filling takes too much time and the "autocomplete-popup-find-something-box" itself is getting too slow, too.

my configuration:
.NET-Framework: 2.0.50727, System.Windows.Forms.TextBox

TextBox-Properties: AutoCompleteSource: CustomSource; AutoCompleteMode: Suggest

i tried several different things...

1. i did put this code in the "TextChanged"-event, but i think it's 'too late' there:

private void

javascript textbox clear not working



i have javascript to clear the textbox but its not working and js called asshipping.js

below the code i have in asshipping

function clear() {
function clearfields() {
    O('TextBox1').value = '';
    O("TextBox2").value = '';
    O('TextBox3').value = '';

function O(id)
  return document.getElementById(id);

default.aspx page

<!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>Untitled Page</title>

   <script src="Script1/asshipping.js" type="text/javascript"></script>
<body  >
    <form id="form1" runat="server"  >

        <asp:Button ID="Button1" runat=&q

Firefox and google chrome textbox wrap is not working


Hi there, i have did some research on this topic. But what i have try to search still cannot solve my problem in Firefox.

 I have a textbox with textmode= multiline. i put a wrap= true is becoz i wan to display the address line by line and same as how the users input. I have tested in IE,Google Chrome and Firefox, two browser is not working except the IE.


<asp:TextBox ID="txtContactAddress" runat="server" CssClass="txtbox"

AutoComplete textbox and combobox not working


I am using a textbox and when I provide custom source from collection at design time it works but when i use custom source in code and fill data from a datatable it doesnot works.

Here is the code ...


 Dim dt As New DataTable
        dt = DataClass.getList("select cust_name from Customer").Table

        Dim cs As New AutoCompleteStringCollection
        For Each r As DataRow In dt.Rows

        TextBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
        TextBox1.AutoCompleteCustomSource = cs




validating is not working when I put HTML.TextBox instead of HTML.TextBoxFor


hi guys,

I have a comment form inside the blog posts. in the form, if the user is authenticated, I will assign the values of the user into textboxes. that part is as follows;

        @if (!User.Identity.IsAuthenticated) {
            <td class="td-field-name">@Html.LabelFor(model => model.Comment.CoommenterName)</td>
            <td class="td-field-separator">:</td>
            <td class="td-field">@Html.TextBoxFor(model => model.Comment.CoommenterName, new { @class = "input-text-1" })</td>
            <td class="td-field-name">@Html.LabelFor(model => model.Comment.CommenterEmail)</td>
            <td class="td-field-separator">:</td>
            <td class="td-field">@Html.TextBoxFor(model => model.Comment.CommenterEmail, new { @class = "input-text-1" })</td>
            <td><span class="font-9px italic">will not be displayed ! (but will show your <a href="http://gravatar.com">Gravatar</a>)</span></td>
        } else {

            <td class="

How to set a Label style when the target TextBox has focus?

I would like to highlight a label when the associated textbox has focus. This works:

<Label Grid.Row="1" Grid.Column="0" Target="{Binding ElementName=CountryCode}">
    <Style TargetType="{x:Type Label}">
          <DataTrigger Binding="{Binding ElementName=CountryCode, Path=(IsFocused)}" Value="True">
              <Setter Property="Foreground" Value="Blue" />
   <AccessText Text="{Binding Path=CountryCodeLabel}" />
<TextBox Grid.Row="1" Grid.Column="1" Name="CountryCode" Text="{Binding Path=CountryCode}" />

But I have a bunch of these textboxes, so I'd prefer to template the style. This works:

<Style x:Key="HighlightOnFocus" TargetType="{x:Type Label}">

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend