.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

Loading AutoCompleteExtender is too late!

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

Hi genius!!

Always getting great help from here.

I posted a question about  using AutoCompleteExtender. It simply shows users all available email addresses when they type in a letter(prefix).

It works, but the problem is it loads to late :( takes around 5 seconds to pull out the list.

So I would like to optimize this, (Might be a algorithm problem) please analze my code and give me some advices.

Any advices would be really great. Thank you genius!!

The part I would like to optimize speed is:

        public static string[] GetCompletionList(string prefixText, int count)
            List<string> items;

            items = new List<string>(500);
            //Pull out all email addresses from our active directory
            DirectorySearcher dSearch = new DirectorySearcher();
            string str = dSearch.SearchRoot.Path;
            DirectoryEntry entry = new DirectoryEntry(str);
            dSearch.Filter = "(objectClass=user)";
            foreach (SearchResult sResultSet in dSearch.FindAll())
                if (sResultSet.Properties["mail"].Count > 0)

View Complete Post

More Related Resource Links

loading generic types with late binding




  I'm trying to late bind a generic datatype at runtime.  Basically the assembly for this generictype is in a different directory (not a sub directory).  So I can't use private probing.  Its not reliably in the GAC either, so I can't depend on that.  I can load several other types from this assembly but not this generic type.


So in the assembly the datatype is of the form MyGenericDataType

and at runtime I want the type of MyGenericDataType.


Any idea how to do that?  I tried:


Code Block

Assembly MyAssembly = Assembly.LoadFile("Path to assembly DLL");


Type MyType = MyAssembly.GetType("MyGenericDataType<MyRegularDataType>");




MyType always equals null.


Do I need to load MyGenericDataType first and then somehow convert it to MyGenericDataType ?



JQGrid Loading deleted values



This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.

Here is the code:

function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {

On page loading or executing all CSS flags are ignored and website is plain without formatting


 My problem is whenever i execute my app the first page that loads is the login page pointed to by my web.config file forms authentication, this page is meant to show CSS formatting for the info i am displaying but it is not. Any help with this problem would be great. A cut and paste of my problem is shown below as you can see there is no CSS.

jsfdnjldfngjfg here it is

Account Login
User Id:
Forgot Password?

I have inserted all the link as in:




Foundations: Loading Workflow Models in WF


When building workflows, you must consider the developer experience, available tools, long-term maintenance, and future versioning.

Matt Milner

MSDN Magazine May 2008

COM: Handle Late-bound Events within Visual Basic Using an ATL Bridge


Since a Visual Basic client doesn't handle events directly from late-bound COM objects, it needs some way to capture all the events and parameters launched by any COM object server instantiated at runtime and not known at design time. This article explains how to build a bridge component that does just that. The bridge component transmits the intercepted event data back to the Visual Basic client using another supporting COM object that is capable of holding event data and attributes. The Visual Basic client receives the notification from the bridge and extracts all the information relative to the event from the supporting object.

Carlo Randone

MSDN Magazine March 2001

Prevent loading big images ..



i need to prevent loading big images e.g max 100KB

but i only store url

1. user put url with image (i remember this string in database not image itself)

this cause that i can not check image size before store url in database

because user can store url and after this operation put bigger file at that location)

2. my web page generate some different image based on first image

and i need to load portion of image 

to stream and set buffer size to 100KB + 1 Byte

if stream is larger than 100KB that user put bigger file 

how can i accomplish that?

FileStream can not use URI as location only disc location

what should i use instead?

please help,

Karol Bieniaszewski

contextKey in AutoCompleteExtender


How can I use the contextKey of an AutoCompleteExtender ? 

When I had a search, I got to know that using javascript we can fire the contextkey to the webservice. Could some one help me out in writing this script and how to use it in webservice ????

Using Ajax AutoCompleteExtender on dynamic fields



I have quite a problem with a form that contains an autocomplete function. The page is an aspx page with c# codebehind.

On the form there is an address field that the user can type in any string address. This field is using an Ajax autocomplete extender, which suggests roadnames to the user. This works fine.
Furthermore the user has the option to add multiple address fields when clicking a button. This works fine now with Jquery. Jquery copies the table which contains, besides other fields, the address field, and "paste" it underneath the existing adress field.

Problem is, how do I attach the Ajax autocomplete extender to the address fields that gets added? Or is there another workaround to make all these fields have this autocomplete function?

Here is my simplfied code:

aspx page:

<td width="200">
  <asp:TextBox ID="TextBoxStopRoadName" runat="server" Width="200"></asp:TextBox>
      <asp:AutoCompleteExtender runat="server"

Passing Textbox Value to ContextKey in AutoCompleteExtender



I'm trying to use the contextKey in the AJAX AutoComplete tool but there is a problem with regards to passing the contextKey value to the method located in the web service file.

Let me describe how my web form is organised.

There are two textboxes. One of them has the AutoComplete tool. The user enters a word in Textbox1 (which does not have the AutoComplete tool). Afterwards, when he clicks in TextBox2 (which has the AutoComplete tool) and starts to type, the AutoComplete tool will show him the close matches. Now, the items in the AutoComplete menu are retrieved from a SQL database. The Select command (of the AutoComplete which is in the web service file) returns values based on the the value of TextBox1 in the main forum.

This is the client-code of AutoComplete 1:

<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" 

asynchronous loading user controls


I have 3 user controls that I have to load at the same time.  They each contain a gridview that pulls data from the database.  They are doing a "delay" load of the data so there is a progress bar template that shows that the data is loading however the first gridview fires and loads, then the second, then the third and I need them to all fire at the same time.  Any ideas? 

Debugger not loading properly and exiting


I am attempting to debug my Visual Studio 2005 project. I have Internet explorer 8 and it's running on IIS.

When I hit the "debug" button, a new Internet Explorer browser window opens and my ASP VB .NET application loads normally. However, Visual studio returns back to regular editting mode and I can hit the "debug" button again. No break points hit but my web page still runs and loads normally.

The Output screen use to show Web.Server(exit 0) but now it doesn't show anything.

Any help would be greatly appreciated, I've been trying to find a solution for a while...


InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


Invalid web service call, missing value for parameter: \u0027prefixo\u0027 (AutoCompleteExtender)


Good afternoon.

I'm trying to put an AutoCompleteExtender working, but i'm having an error, that i discovered with Fiddler, that is the reason that the autocomplete doesn't work:

> **{"Message":"Invalid web service call,
> missing value for parameter:
> \u0027prefixo\u0027."**,"StackTrace":"
> at
> System.Web.Script.Services.WebServiceMethodData.CallMethod(Object
> target, IDictionary`2 parameters)\r\n
> at
> System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object
> target, IDictionary`2 parameters)\r\n
> at
> System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext
> context, WebServiceMethodData
> methodData, IDictionary`2
> rawParams)\r\n at
> System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext
> context, WebServiceMethodData
> methodData)","ExceptionType":"System.InvalidOperationException"}

This is the webservice code:

    Imports System.Web.Services
    Imports System.Web.Services.Protocols
    Imports System.ComponentModel
    Imports GcpBE750
    Imports ErpBS750
    Imports StdBE750
    ' To allow this Web Service to be called fro
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