.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

Silverlight - Textbox on focus wait till a Asynchronous process is complete

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :WCF


I have a textbox, where i call its lostfocus event when the value changes.

In lost focus i do a Asynchronous process to update a grid with the text entered. 

I have a scenario in which immediately after changing the value in textbox i hit a button, though the button click event raises i want it to wait till the asysnchronous process in lost focus of the textbox is complete. i want to do this as i use the result from lostfocus in button click event.

Please let mt know if there is a way to make the lost focus wait till it completes the asynchronous call.



View Complete Post

More Related Resource Links

WebBrowser control, wait till all request complete?


I was creating WebBrowser control that auto navigate list of urls, but when I set DocumentComplete events it raised only when main DOM document downloaded (not include image, javascript, iframe, etc.) Is there any point that I can check from WebBrowser properties that the browser have completely load all element related to the page, e.g page images, domready javascript event, iframe, etc.


Windows 2000: Asynchronous Method Calls Eliminate the Wait for COM Clients and Servers


Windows 2000 is the first version of COM to support asynchronous method calls, which permit clients to make nonblocking calls to COM objects and objects to process incoming calls without blocking the calling threads. COM clients benefit from asynchronous method calls because they can continue working while waiting for outbound calls to return. Objects benefit because they can queue incoming calls and service them from a thread pool. Our SieveClient and SieveServer sample apps demonstrate how to create and use asynchronous clients and servers in COM-based distributed applications.

Jeff Prosise

MSDN Magazine April 2000

Wait for an activity to complete?

I have the following scenario:My workflow (Workflow1) has a custom activity which inserts data into the database.My program creates an instance of WorkflowApplication (passing an instance of Workflow1) and runs the instance.Thereafter, it reads the data that has been inserted in the execute method of my custom activity. How do I know that the execution of the activity is complete? I am running in issues as the workflow instance seems to run on its own thread.Code snippet:Program.cs  // create the WF instanceActivity wf = new WorkflowTests.MicroLoanOrignation(); WorkflowApplication instance = new WorkflowApplication(wf){                PersistableIdle = OnIdleAndPersistable,                Completed = OnWorkflowCompleted,                Idle = OnIdle}; instance.Run(); //Gets data here..//Enters into this code block before the Execute method of the lst activity of the workflow is complete How do I make it synchronous. I have have tried BeginRun and EndRun methods on the WorkflowApplication - but the Run method merely schedules the workflow to run as per https://connect.microsoft.com/VisualStudio/feedback/details/509928/workflow

How to create auto complete textbox

Hello I saw many examples from google. But there are nothing that the textbox is automatically completed by data from database. How can I do this. I like this example http://flux88.com/blog/jquery-auto-complete-text-box-with-asp-net-mvc/  but how can I modify it. 

How come I can't set focus to a textbox in DetailsView?

Here's the first part of a DetailsView control definition:          <asp:DetailsView ID="DetailsView1" runat="server" DefaultMode="Edit" AutoGenerateRows="False" Width="100%" BorderColor="Silver">            <RowStyle Height="25px" />            <Fields>              <asp:TemplateField HeaderText="Name" SortExpression="Name">                <EditItemTemplate>                  <asp:TextBox ID="textBoxName" runat="server" Text='<%# Bind("Name") %>' CssClass="detailsTextBox" onclick="SelectText2(this)" onKeyUp="EnableSubmit()" />                </EditItemTemplate>                <InsertItemTemplate>        &nb

why isnt the focus being set to a textbox in the gridview?

Hi, i have a gridview with textboxes in. a barcode reader is used to enter data in the textboxes in the grid. when something is scanned in the page does a full postback. so after a postback and after something has been scanned in, i want the focus to be moved to the next textbox in the row inside the gridview.  i have some code, but it doesnt seem to work. after the postback the focus is set to one of the textboxes outside the grid. i need it to recognise one of the textboxes in the grid. i have tried to use the findcontrol property to do this still doesnt work. please can anyone see where i am going wrong. what i wanted to do is for it to automatically tab to the next textbs in the gridview after a postback. please any advise on this would be much appreciated. thank you very muchprotected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { WebControl wcICausedPostBack = (WebControl)GetControlThatCausedPostBack(sender as Page); int indx = wcICausedPostBack.TabIndex; var ctrl = from control in wcICausedPostBack.Parent.Controls.OfType<WebControl>() where control.TabIndex > indx select control; ctrl.DefaultIfEmpty(wcICausedPostBack).First().Focus(); } } protected Control GetControlThatCausedPostBack(Page page)

SSIS Script Task wait for remote process completion - WMI & C#

Hi All: I have a C# script task that uses WMI to create a process on a remote machine. What is the best way for me to make the script task wait until the remote process has completed before moving to the next task in SSIS? TIA!

How to Catch and Process Client Side When a TextBox Changes


VWD 2008 Express.  Visual Basic.  JavaScript.

I have a gridview control that is populated with lesson grades (GradeTextBox) and lesson completion dates (GDateTextBox), both of which are in textboxes.  I want to do the following on the client side:

When a grade is entered or changed in the grade textbox, I want to detect (trap) the change and run some javascript code that automatically updates the lesson completion box.  Since the text control clientIDs are assigned dynamically for each row of the gridview, I also have the problem of determining the clientID for the lesson completion date textbox associated with the grade textbox.  

(1) How do I trap the event of the grade textbox changing?, and

(2) How do I determine the clientID for the lesson completion date textbox associated with the grade that just changed, so that I may automatically set the date?

I have tried adding an "afteredit=" to the grade textbox, but it never reaches the code.  Here is the HTML for the gridview with the two textboxes in red:

                    <asp:GridView ID="GradesGridView" runat="server"  
                        DataSourceID="SqlDataSourceGrades" Width="96%" AutoGenerateColumns="Fals

textbox focus problem


I have a textbox (txtMaiden) and a radio button list (rblGender) in two separate User Controls that I'm using for a registration site. The txtMaiden control appears or disappears depending on whether Male or Female is designated on the radio button. This all works fine but I want the textbox to have focus when it becomes visible. As of now, it only gets focus when the page refreshes. Code follows. Any ideas?

<Prf:gender ID="GenderE" Gender='<%#Bind("Gender")%>' runat="server" />
<Prf:maiden ID="MaidenE" Maiden='<%#Bind("MaidenName")%>' Maiden_Disp='<%#Bind("MaidenName_Disp")%>'
    runat="server" />

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="gender.ascx.vb" Inherits="userControls_profile_gender" %>
<asp:Panel ID="pnlGender" Visible="true" runat="server">
    <div class="label">
        <asp:Label ID="lblGender" Text="Sex:" runat="server" />
    <div class="ctrl">
                <asp:RadioButtonList ID="rblGender" AppendDataBoundItems="True" AutoPostBack="True"

How can I process a triple-click event on a TextBox?


I've tried the MouseClick and MouseDown events, but the clicks arg in MouseClick is always 1 and in MouseDown is always 1 or 2.

How can I process a Triple-click?

keep focus on textbox on textchange event



How can I keep focus on caller textbox on textchange event or set focus on a given textbox according to a given value?

How can I know which textbox triggered the event if I need to use the same textchange method?

thanks in advance

codebehind set focus textbox field in ajaxtoolkit : Tab


Hi all ,

I am stuck in the set focus field in field in ajaxtoolkit : Tab  at codebehind when button click.

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

    If StringUtil.IsStringEmpty(Me.ddlSex.SelectedValue) = True Then

       Page.ClientScript.RegisterStartupScript(Me.GetType, "ErrMsg", 
            JScriptUtil.ErrorMsg("Jantina (Sex): "

    End if

   End Sub

How to prevent Loss of Focus if there is Validation error on a textBox?

Hi i have a TextBox displayed as a TreeViewItem and when the user enters text and Tabs away or clicks somewhere else i want the control to retain focus if there is any validation error.Is there anyway i can do that? I am adding the ValidationRule to the TextBox created dynamically in code..I do see the default redborder when there is a validation error.I just want to force the user to correct the error and not go anywhere else in the app until its fixed..
Thanks in advance...

MaskedEditExtender, text removed if you lose focus and set focus back on textbox


I have a MaskedEditExtender with Mask="(999) 999-9999".

Now my problem is, if someone goes into the textbox and enters


Then they leave the textbox, and then see that they forgot to enter the area code, if they go back in there to enter the area code, it starts overwritting the other numbers instead of just adding to them. 

How to set focus to UserName textbox in Login Control ?



can you please tell how to focus cursor to UserName TextBox in Login control when page is loaded for the first time in browser ? 

setting focus to a textbox


using vb.net/asp.net 2005

after the user clicks on a button in the buttonClick event I am trying to set the focus at the end of the function simply as follows:


However the focus is instead going to another button.  The tabIndex property is not set on any controls on the page.  Has anyone experience this?  thanks


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