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

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

watermark disappears after lost focus - using asp.net ajaxcontroltookit

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
i am having trouble keeping the watermark on the textbox. its very first time when the page loads i see the watermark and if i focus the textbox and move away from textbox than the watermark disappears. how do i make sure that watermark is there after i lost focus from the textbox?<asp:TextBox ID="txtSubject" runat="server" Width="280px"  CausesValidation="false"></asp:TextBox>  <ajaxToolkit:TextBoxWatermarkExtender ID="TBWE1" runat="server" Enabled="true" TargetControlID="txtSubject"   WatermarkCssClass="watermark" WatermarkText="Find by Subject">  </ajaxToolkit:TextBoxWatermarkExtender>  

View Complete Post

More Related Resource Links

Controls in a WPF UserControl don`t raise lost focus



I have a MainWindow with 3 main buttons at the top and below a MainUserControl.

In the MainUserControl I have at top 3 UserControls with ButtonBars and at the bottom a DataGrid.

When I enter data in a DataGridCell and I click into another cell a property change is fired in my ViewModel bound to the DataGrid.

When I enter data... and I click on one of the 3 main buttons again a property change is fired because of Lost Focus event.

When I ... and I click on one of the buttons in the ButtonBar in the UserControl no property change is fired because there seem to be no Lost Focus event.

How can I fix that?

Text box Lost focus and JSON


I am trying to make below form where I will put phone no text into text box and if it is existing in database then in lost focus corresponding customer name will automatically come in customer name field and if not exits then it should be I will show dialog box for inserting new   record for customer.

Kindly help for some tutorial or some URL which can help me.

watermark textbox using Ajax control

This is pretty simple compared to jquery. Since we need refer a dll only. we dont want any script for this. we just include that reference into our website.

lossing focus from model pop up window controls


hi i using a model pop up window with some textbox but when i click on textbox of model pop up focus move to back to page textbox control plz help me 

Memory Lane: Rediscover the Lost Art of Memory Optimization in Your Managed Code


Managed applications rely on the garbage collector in the .NET Framework to allocate and clean up memory. The little CPU time spent performing garbage collection (GC) is usually a fair trade-off for not having to worry about memory management. But for applications in which CPU time and memory are precious resources, minimizing the time spent garbage collecting can greatly improve application performance and robustness. Find out how to manage memory all over again.

Erik Brown

MSDN Magazine January 2005

Data lost on submit


Dear Experts,

I have a modal popup and a GridView in it. The GridView is populated programmatically, i.e. I use .DataBind(). I can enter data into some of the GridView's controls. After I press Submit, I expect to do something with the entered data. But in the button press handler, the GridView is empty. I realize that I have to DataBind() again in the handler, but how can I preserve the data the user enters?


session lost problem


hi there,

i have an application that uses sessions.

i have set at the web.config: 

<forms loginUrl="Default.aspx" protection="All" timeout="30" name=".ASPXFAUTH" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="Default.aspx" cookieless="UseCookies" enableCrossAppRedirects="true"/>

and at the global.asax.vb

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        Session.Timeout = 30

end Sub

and at default.aspx.vb

Protected Sub LoginButton_Click(ByVal sender As Object, ByVal e As EventArgs)
        Session("userName") = Login1.UserName
        Session.Timeout = 30 ' minutes of session '

    End Sub

At a local iis on windows xp works fine,

but when i publish it at the webserver i am redirected to the default page after about 30 sec!!!

any ideas?


Excel-like experience - gridview focus problem



I'm creating a page where people can order several items from a list without having to press "edit" and "save" in between like you normally would in a gridview. The user writes down the quantity, and finally presses a "submit" button that saves the order.

I want the user to have a windows form (or excel) like eperience, so once the user puts in the quantity and moves on to the next item, either by TAB or by clicking on the TextBox, i make some calculations without the user beeing bothered with a full refresh or having to press a buton to execute the event, so I place the controls inside an UpdatePanel and use TextBox.TextChanged. The event runs code that calculates the sum for the row (price * quantity) and shows that in a column called "Sum", and updates a label in a fixed position with the new order total ("Total").

Any ideas on how to achieve this?

Right now I use a GridView with a templatefield for the Quantity and set the TextBox.TextChanged event to fire to make the calculations. The problem is that the focus then changes.

By using SmartNavigation or the ScriptManager.SetFocus I manage to retain focus on the TextBox that executed the Postback, but the user might have moved on to a textbox far down the gridview (thus causing the postback by leaving the previo

WSS 3.0 Content Type - Lost data for Titles


We are running WSS 3.0 SP2 on server 2003.  Recently, we lost the "Titles" for all content types for documents.  Our system Content Type for Document is set up to require this field to be completed on all documents that is uploaded.  Our system would automatically enter in by default the name of the document in the "Title" field it no longer does this for the user.  The user must now enter in manually the "Title".  How do I get it to enter in the "Title" using the document file name automatically?

Below is the way the setting page for Site Content Type: Document looks like.  (I tried to recreate it since I could place a screen shot in the box)

Site Content Type Information
Name:  Document
Descriptiong:  Create a new document.
Parent:  Item
Group:   Document Content Types

Name, Description, and group
Advanced settings
Workflow settings
Delete this site content type

Name                 Type                     &nb

Contact Selector - Form tab index is lost after selector resolves names on blur


I'm working with an InfoPath2007 form developed to be filled-out through the browser on a SharePoint 2007 site, and I'm testing using Internet Explorer 7.  It's a straight-forward form, with a number of text fields and two Contact Selector controls.

The issue I'm encountering is with the Contact Selector control, where if the actor only enters a partial name into the text-field and then TABs away from the control the form will perform its auto-postback to look-up and resolve the partial name (showing the name resolution dialog is necessary), and afterward the actor's cursor is focused on the next field in the form.  The actor can type text into the focused field, but any subsequent pressing of the TAB key returns the actor's focus to the browser's ADDRESS bar, which is incorrect as it should proceed to the next field in the form.  I understand that the Contact Selector needs to perform its postback to perform the name resolution (so that there is no way through the InfoPath form designer to disable postbacks for the control), but why does the browser not know how to continue the TAB order of the fields on the form even when a field has focus?

Adding table to a page, but the format lost when I use clear border



I added a table to a page, by default, the table layout is the light border. So, I add my content and the vertical align seems to set to the top. But when I changed it to clear border, the content of the table will set vertical align to center. Is there a way to change this back to top align but with the clear border. I don't think I can do this by what is available in the ribbon. Please advice.

Modal Popup disappears after showing in IE7


Currently having problems with a modal popup. When you click its target control it will show up the hide itself again.  Thanks. Will try to add some more details later.

Generated controls - skipping focus event - C# + JS


Ok, here is my senario.

A random (6-15) amount of textboxes are generated. Each textbox represents only one character. From those textboxes, three of them (at a random position) are enabled and the rest disabled.


When I put a character in any enabled textbox, it must put the focus on the next enabled textbox.


Textbox IDs go from 'char0' to 'char15' OR 'char0' to 'char12' OR ...

All the textboxes are generated so I can't set up specific focus events for each textbox because the designated control is unknown at design time.

Here is my attempt:


<script type="text/javascript">
    function abc(nextfocus)


for (int i = 0; i < focusableControls.Length-1; i++)
focusableControls[i].ClientSideEvents.KeyDown = "abc(" + focusableControls[i + 1].ID + ")";


focusableControls is an array with all the textboxes in that can get focus. It is also in the right order.

Things I want to find out:

How will I send the textbox out of focus

Changing aspx page causes session data to be lost...


Strange but true. Any ideas what might be causing this?


Sharepoint farm lost a server... How to proceed?


Had a Sharepoint farm I inherited that was running on ____ hardware in a ____ setup- raid controller failed, and the rack was setup so that I have to down 15 servers that might not come back up, just to get at the server... Complete, unrecoverable failure. This server was a member of our Sharepoint 2007 farm, and had Reporting Services on it. There are a lot of little pieces that are still referenced in the Central Configuration. I removed the server forcibly, and need to know next steps, specifically:

1. I tried to move Reporting Services to another server, but I get an error in the Grant Database privileges that I cannot connect to the Report Server's WMI Provider. I created a SPN on a DC, forced a replication a few hours ago, and still no luck. Any Advice?

2. How do I fix all the little things that reference that server? Anytime Sharepoint initiates a web page to Central Administration, it tries to use that server address.

I think the failed server was running SQL 2008 or SQL 2008 R2, and the server I am moving this to is SQL 2005 SP2. I have installed the correct Reporting Services for Sharepoint. Have I missed something?

Time is of the essence because management relies on Reporting Services and I am under a great deal of pressure to fix this. I appreciate any help I can get.



Toast Popup Form is Stealing Focus

I have a Windows Form application that when it is running a process it displays a MSM type toast popup.  The problem is when we create this form in a second thread and display it.  The problem is when it is displayed it steals focus from other applications or even our own.  Anyone have any ideas on this and how to make it not steal focus. I create the popup in a thread pool. ThreadPool.QueueUserWorkItem( new WaitCallback( DisplayPopUp ), new PopUpParameters( BackgroundImage, ForeColor, Clicked, Delay, Message, ButtonText ) ); This is the code for DisplayPopUp: using (PopUp p = new PopUp((PopUpParameters)popUpParameters)) { p.ShowDialog(); } Inside the form it has 3 timers.  One for Pop, Pause, and UnPop.  The form Load event is where the position of form is set and the event pop timer is started.  The events for Pop and UnPop just change the form Top location.  The form is not set to TopMost. Any help would be great. Thanks, Eric
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