ProgTalk - Your archive for all source code

How to create your own Auto Suggest textbox without any AJAX frameworks.

ProgTalk » Articles » .NET » How to create your own Auto Suggest textbox without any AJAX frameworks.
 
Author: Baps Ahmed
Page Views: 21429
Average Article Rating: rating starrating starrating starrating starhalf star
 



Looking for the VB.NET Version?  Click Here

Latest Features without the Latest Features?

As the web world introduces new styles and features, it is becoming more and more demanding for us developers.
Customers/clients along with managers and directors want the latest features without the latest features.  Confused by this? 
So was I.  You'll understand by the end of this article what that statement exactly means and how you probably face it everyday.

What Started it All
A few weeks ago, I had to implement a new project.  It was dealing with your typical requirements of fetching data and
presenting reports. It was pretty basic (or so I thought) and simple in the beginning.  I ended up on a section, where I had a
simple grid representing some data.  Here I had to implement a search feature based on a couple of their fields, which they
wished to type in.  It couldn't be drop down lists because they had over a few thousands (5+) various types of choices.  It
would just take way too long to load all those items.  To make it worse they had 6 different criteria's to search from being
able to mix and match. 

For the first client demo, I ended up putting 6 different textbox's, where the client can type between any of them, and get the
result they wanted.  To make it more friendly, I allowed like searches so they wouldn't even have to type the entire words of
say company names, or addresses, etc...  They loved this feature, but it would definately get me into more trouble. 

The management team had a meeting with the customers, and next thing I knew, I was fluttered with requests that each search
type should allow auto suggestions.  Now to make it a bit complicated, I had about 6 different textbox's (Isn't that a PAIN.)
and to have all of them having auto suggestions looking at different sources was just annoying.  But what can I do, I loaded the
AJAX framework, and quickly made this possible using some guidelines from http://asp.net/ajax/downloads/.  We went off to
do another demo, and they loved it.  So what was wrong?

Requirements Does Not Meet
Well as my luck would turn out, for some policy reason of the unnamed organization, we would not be allowed to use the
AJAX framework on the server?  Why you may ask?  Isn't it silly?  Well all I can say, was it was not something coming from
me, but something we all face and do, that is compromise even though it is not logical.

So, I set off to make my own auto suggest, using as limited code as possible, using the asynchonous calls the old fasioned
way without the frameworks.  For this example, I will show you how to do this, using a more basic case, allowing you to evolve
it as much as you wish.

What Is Needed?
All that is needed is two pages:
Page 1.  You main page where the user will be typing, and where the auto suggest will show up. 
              (For this example Default.aspx)
Page 2.  A data page that will retrieve the data to present as an auto suggest option. 
             (For this example LookUp.aspx)

The following Javascript functions (In this example in the JSFile.js):

//======================================
//======================================
//============DO NOT REMOVE=============
//======================================
// Created by Rajib Ahmed
// http://www.ProgTalk.com
//======================================
//======================================
//======================================

var req;
var
CurrentDIV;

//Set up to use javascript to call pages for data lookup
//YOU DO NOT NEED TO CHANGE ANYTHING BELOW
function
Initialize()
{

       try
      
{
              req = new ActiveXObject("Msxml2.XMLHTTP");
       }
       catch(e)
       {
              try
             
{
                     req = new ActiveXObject("Microsoft.XMLHTTP");
              }
              catch(oc)
              {
                     req = null;
              }
       } 
       if( !req && typeof XMLHttpRequest != "undefined" )
       {
              req = new XMLHttpRequest();
       }
}
 

//sends the query to desired page, and returns to div autocomplete
//based on what the user typed
//key paramater has what the user typed.
//div paramater states, which div to stick the data back to.

function SendQuery(key, MyDiv, url)
{
       if ( key == null || key.length == 0 )
       {
              document.getElementById(MyDiv).innerHTML = "";
              HideDiv(MyDiv);
              return;
       }
       CurrentDIV = MyDiv;
       Initialize();
       var url= url + "&k=" + key + "&MyDiv=" + MyDiv; 
       if( req != null)
       {
              req.onreadystatechange = Process;
              req.open("GET", url, true);
              req.send(null);
       }
}
 

//checks is status was good when calling url for data lookup

function Process()
{
       if (req.readyState == 4)
       {
              // only if "OK"
             
if (req.status == 200)
              {
                     if(req.responseText=="")
                           HideDiv(CurrentDIV);
                     else
                    
{
                           //alert(req.responseText);
                          
ShowDiv(CurrentDIV);
                           document.getElementById(CurrentDIV).innerHTML =req.responseText;
                     }
              }
              else
             
{
                     document.getElementById(CurrentDIV).innerHTML=
                           "There was a problem retrieving data:<br>"+req.statusText;
              }
       }
}
 

//Show Div Section in html
function
ShowDiv(divid)
{
       if (document.layers) document.layers[divid].display="block";
       else document.getElementById(divid).style.display="block";
}
 

//Hide Div Section in html
function HideDiv(divid)
{
       if (document.layers) document.layers[divid].display = "none";
       else document.getElementById(divid).style.display="none";
}

 
//Load selected value into textbox, and hide div
function SetTextbox( TextboxID, data, MyDiv )
{
    document.getElementById(TextboxID).value = data;
    if ( MyDiv.length > 0 )
    {
        HideDiv( MyDiv );
    }
}
 

C# Source Code, and How Our Sample Page Works
Now that we have the the javascript code, we will take a look at our Default.aspx page.
Here the main controls we will be concentrating on are the two textboxes. 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

If you go over to the html, you will notice that are two DIV's below each textbox.
This is what will load our auto suggestion options.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

How to sync which textbox with which div?
I didn't want to hardcode the div names with the textbox, and wanted to have it in a versatile way, where I can show any div
with suggestions from any textbox.  This got me to think, and I engineered the javascript functions above which will take
paramaters to know what to fill with which options. 

The code for the Default.aspx page is very simple.  Nothing else is necessary except what is below.
This will make life so much easier, when you know all you need to do to add another autosuggest textbox is to create the
textbox, and call some existing div, or just a new div with just one line of code (4 lines if you write it out like me ).

public partial class _Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            this.TextBoxCategory.Attributes["autocomplete"] = "off";
            this.TBShipmentName.Attributes["autocomplete"] = "off"; 
            //Add attribute to call js to fetch data
           
//using the JavaScript function: SendQuery
           
//Paramaters include
           
// 1.  The current typed text value
           
// 2.  Div ID where to show similar results
           
// 3.  URL to call by
AJAX passing Mode to so we know what to query
           
// 4.  Textbox where to return the data
           
this.TextBoxCategory.Attributes["onkeyup"] = "SendQuery(this.value, '" +
                this.DivAutoCompleteCategory1.ClientID +
                "', '/HowToCreateAnAutoSuggest/LookUp.aspx?Mode=Category&TB=" +
                this.TextBoxCategory.ClientID + "')"; 
            this.TBShipmentName.Attributes["onkeyup"] = "SendQuery(this.value, '" +
                this.DivAutoCompleteShipmentInfo.ClientID +
                "', '/HowToCreateAnAutoSuggest/LookUp.aspx?Mode=Shipment&TB=" +
                this.TBShipmentName.ClientID + "')";
          
        }
    }
}

Now we will see the LookUp.aspx page
The LookUp.aspx page will perform the lookup.  Here we do not have any html code, which can be observed in the html source code section.  You should not, I repeat, SHOULD NOT add any items to this page.  It will ruin what is returned to the Default.aspx page.  If you know what you are doing, then go for it.




Here we see what keys where typed into the textbox.  Using this information, we will lookup our database, which is the
Northwind database.  The two different textboxs actually look up two different tables in the same database.  One will look
up the Category table, while the other looks up the Orders table.  This page knows what query to run, by looking at the mode
which was passed to us:

public partial class LookUp : System.Web.UI.Page
{
    protected void Page_Load(object sender, System.EventArgs e)
    {

        //keyword checks what was type, mode sets the what query we do,
        //TB tells us where to enter the data, and MyDiv tells us which div we are working with

        //Modify this to a Stored Procedure for added security.
        //If you cannot or do not want to use stored procedures, then
        //make sure the query string does not pass a semicolon(;)
        //That is a simple way to block most sql hijacking.
        string keyword = Request["k"];
        string Mode = Request["Mode"];
        string ReturnTextbox = Request["TB"];
        string MyDiv = Request["MyDiv"]; 
        if (keyword != null && Mode != null && keyword.Trim().Length > 0)
        {
            //build div items based on what is in database, and what user typed.

            string sql = "";
            if (Mode == "Category")
            {
                sql = "SELECT distinct TOP 5 CategoryName from Categories Where CategoryName like '" +
                    keyword.Replace("'", "''") +
                    "%'";
            }
            else if (Mode == "Shipment")
            {
                sql = "SELECT distinct TOP 5 ShipName from Orders Where ShipName like '" +
                    keyword.Replace("'", "''") +
                    "%'";
            }
            else
           
{
                return;
            }
 

            //Here we will fetch the data from the database, and write it back to the default page
           
DataSet ds = new DataSet();
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
            conn.ConnectionString = "Data Source=YOURDATASOURCE;Initial Catalog=Northwind;" +
                "Persist Security Info=True;" +
                "User ID=YOURUSERID;" +
                "Password=PASSWORD";

            System.Data.SqlClient.SqlDataAdapter adapter =
                new System.Data.SqlClient.SqlDataAdapter(sql, conn);
          
            adapter.Fill(ds); 
            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dt = new DataTable();
                dt = ds.Tables[0];

                foreach (DataRow row in dt.Rows)
                {
                    string mydata = row[0].ToString(); 
                    if (ReturnTextbox != null && ReturnTextbox.Trim().Length > 0)
                    {

                        //Write to default page, with selection options.
                        if (MyDiv == null || MyDiv.Trim().Length == 0)
                        {
                            Response.Write("<div onmouseover=\"this.style.cursor='pointer';\"" +
                                "onmouseout=\"this.style.cursor='pointer';\"" +
                                "onclick=\"SetTextbox('" +
                                ReturnTextbox.Trim() + "','" +
                                mydata + "', '');\">" +
                               
"<font size='2' face='Tahoma'><B>" +
                                mydata +
                                "</B></font>" +
                                "</div>");
                        }
                        else
                       
{

                            Response.Write("<div onmouseover=\"this.style.cursor='pointer';\"" +
                                "onmouseout=\"this.style.cursor='pointer';\"" +
                                "onclick=\"SetTextbox('" +
                                ReturnTextbox.Trim() + "','" +
                                mydata + "', '" +
                                MyDiv + "');\">" +
                                "<font size='2' face='Tahoma'><B>" + mydata + "</B></font>" +
                                "</div>");
 

                        }
                    }
                    else
                   
{
                        Response.Write("<div><font size='2' face='Tahoma'><B>" +
                            mydata + "</B></font></div>");
                    }
                }
            }
        }
    }
}


Here is the sample in action:

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Typing C in the Category field:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Typing D in the Ship Name field:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Selecting Category from the Auto Suggest:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Selecting Ship Name from the Auto Suggest:
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

 

Notes

I worked very hard to make this article so it can be useful for others. Please leave me some feedback if you have any opinion, good or bad.
 

Tags

 

Ratings

Was this article helpful? Don't forget to rate it. Ratings helps community members identify top & useful articles.
Current Rating: rating starrating starrating starrating starhalf star
Rate this article:
(1-Poor, 2-Needs Improvement, 3-Average, 4-Good, 5-Excellent)
 

Feedback

Have a question, suggestion or feedback for this article? Leave your comments below.
Share your feedback:
Need to upload images with your comment. Upload your images here: Image Shack. Remember to copy the url of your uploaded image and insert it into the comment.
You can insert images by clicking on the following icon: insert comment image
(Members Only)
 

Latest Comments

Below are the latest comments from other ProgTalk members.
Posted on:
1/6/2010 5:37:44 PM
Posted by:
Do you know how after I have autosuggest for example
I have 3 textboxes. 1st textbox is name 2nd is age 3rd is address.
Then in my database name, age, address are in one table.
Then.. what i wanted was to have an autosuggest on the 1st textbox
then when i select an option in the autosuggest i will be able to get age and address of that name i selected (like passing the info of the one i selected in the 1st textbox and be able to show his/her (whoever the name is) age for the 2nd txtbox and for the third also. HELP!
Posted on:
12/10/2009 5:19:32 AM
Posted by:
it is good Article.
Posted on:
8/25/2009 12:00:00 AM
Posted by:
thanks you very muck it is good :) chat sohbet odalari kamerali sohbet forum
Posted on:
5/5/2009 12:00:00 AM
Posted by:
tx very much, but how to make this with Php?
Posted on:
2/17/2009 12:00:00 AM
Posted by:
Good Thx
Posted on:
1/16/2009 12:00:00 AM
Posted by:
Hey i have one more doubt.   
In the default.aspx file i am storing the selected value from the div in a hidden field . Now i need to access that value in the default.aspx.cs file to show the
data realated to the selected text.

The problem is that the control is not moving to the default.aspx.cs file after i am selecting a text from the div.
please tell me how can i achieve it. I am trying to do a search control.
Posted on:
1/16/2009 12:00:00 AM
Posted by:
here are the following steps I would take.
1.  Cache the data which is your source for the lookup values.
2.  I am not sure why a hidden control is needed.  If you have a search textbox, which is  a server side control, and the autosuggest populates under it, when a user clicks on the desired choice, it should populate on the textbox field.  Then when the user clicks on search, it should go to your code where you can access the textbox data by using a simple TextBoxSearch.Text if your textbox id is TextBoxSearch. 

Can you be more specific to where you are experiencing a problem?
Posted on:
1/17/2009 12:00:00 AM
Posted by:

actually i dont have a search button only one search textbox.

The requirement is that once you start typing suggestion should show and after one selects one text from the suggestion the related

data should show on the page. So as soon as a selection is made from the div the page should be submitted I think.

 

Posted on:
1/16/2009 12:00:00 AM
Posted by:
Hey i have one more doubt.   
In the default.aspx file i am storing the selected value from the div in a hidden field . Now i need to access that value in the default.aspx.cs file to show the
data realated to the selected text.

The problem is that the control is not moving to the default.aspx.cs file after i am selecting a text from the div.
please tell me how can i achieve it. I am trying to do a search control.
Posted on:
1/14/2009 12:00:00 AM
Posted by:

when i put req.status on alert its returning 404 instead of 200..
and the error
"There was a problem retrieving data" shows up.
i have coped the exact code.

please help me its urgent..

Posted on:
1/14/2009 12:00:00 AM
Posted by:
try to add an alert in the javascript to show the url it is trying to call.  once you have the url, try to see if you can directly call it to see if it is a valid url or not.  this should resolve your problem
Posted on:
1/14/2009 12:00:00 AM
Posted by:
put the alert in the SendQuery javascript function
Posted on:
1/15/2009 12:00:00 AM
Posted by:

thank u so much..

its working perfectly now..

Posted on:
1/13/2009 12:00:00 AM
Posted by:
does the code work only for IE? b''coz i m not getting the required output on firefox and opera..
thanks in advance..
Posted on:
1/14/2009 12:00:00 AM
Posted by:
this works for me on firefox and ie.  didn't try it on opera.  use firbug to see what is causing the problem in firefox.
Posted on:
1/9/2009 12:00:00 AM
Posted by:
Great job is Excelent. Thanks a lot!!!!
Posted on:
12/9/2008 12:00:00 AM
Posted by:
Don
Does this code work in vs 2003?  I tried different ways in vs 2003, but it does not work.  Can someone help?  Thanks
Posted on:
12/9/2008 12:00:00 AM
Posted by:
This shound definately work in Visual Studio 2003.  All the ajax is done using javascript.  All the controls can use framework 1.1.  There should be no issues.  This sample also uses the Northwind database which it assumes is on your local database.  If you do not have this database, just create one of your own, and you should be good.
Posted on:
12/9/2008 12:00:00 AM
Posted by:
Don

There error is "There was a problem retrieving data: Internal Server Error".  Even when I comment everything inside the Page_Load() under LookUp.aspx.vb, it's still show this error.  I think it's nothing to do with sql server. 

Posted on:
12/9/2008 12:00:00 AM
Posted by:
check the javascript function.  It probably can't find the url it is looking for.  Put some alert("hello");  statements inside the functions to see where it gets stuck.  most likely it is calling the lookup.aspx page which it cannot find.
Posted on:
12/9/2008 12:00:00 AM
Posted by:
bob
What error are you getting in vs2003? I had to create my own database just using access and got it to work just fine in vs2005. Try building a new solution and just add the files as existing files manually. If you still cant get it to work I can try to make it in vs2003 for you.
Posted on:
12/9/2008 12:00:00 AM
Posted by:
Hey Bob,

Glad you got this working.  I didnt' see your comments before, or else I would have replied.  This sample uses the MSSQL Northwind database. 
Posted on:
12/9/2008 12:00:00 AM
Posted by:
Don
Does this code work in vs 2003?  I tried different ways in vs 2003, but it does not work.  Can someone help?  Thanks
Posted on:
12/9/2008 12:00:00 AM
Posted by:
Don
Does this code work in vs 2003?  I tried different ways in vs 2003, but it does not work.  Can someone help?  Thanks
Posted on:
12/5/2008 12:00:00 AM
Posted by:
bob
I have no database on the download. Is it included in the app_Data.. also the C# link is dead.
Posted on:
10/21/2008 12:00:00 AM
Posted by:
HI

  req = new ActiveXObject("Msxml2.XMLHTTP");
  alert (req );

req value is empty for me. Plese help me for this problem Thank in advance

Posted on:
8/29/2008 12:00:00 AM
Posted by:
GOOD , 5 from me.
Posted on:
8/14/2008 12:00:00 AM
Posted by:
can we fix this div width = text box width
Posted on:
10/16/2008 12:00:00 AM
Posted by:
check the aspx page.  this is where the div is made.  You can set the width/height as desired there.
Posted on:
7/8/2008 12:00:00 AM
Posted by:

The article you have given is very good but it does not work in my project. When I type any character to search the string from the database the div in code does not show the expected result. It does not give any error but what''s the problem I don''t know. My code is also correct. It works in sample program, then what''s the problem in my project.

Posted on:
7/8/2008 12:00:00 AM
Posted by:

I set debug point in LookUp.aspx.cs file of the project and run the project with other file, it does not go for debug in LookUp.aspx. I had set the break point in Lookup.aspx.cs. It showed all the strings null.

Posted on:
7/8/2008 12:00:00 AM
Posted by:
Something is not right in the javascript.  Double check all paramaters are good when calling the js function, and also that the objects are not null prior to calling the LookUp.aspx page.
Posted on:
7/8/2008 12:00:00 AM
Posted by:
Please help me for this problem. Thank you...
Posted on:
7/8/2008 12:00:00 AM
Posted by:
Can you post your code for adding the attributes on the page load.  Also, is the aspx page which is calling the javascript method including the script and under the same directory as the Lookup.aspx page?  I am not sure why it not calling the lookup.aspx page, but usually this is something failing in the javascript function.  You may want to add a few alert statements in the js to see if everything executes properly.
Posted on:
7/16/2008 12:00:00 AM
Posted by:
My problem has been solved with the auto suggest textbox. But I have the question about selecting the desired results using up and down arrow keys. I want to select the desired result using keyboard's up & down arrow keys as well as mouse. What changes to be done in the coding? Please help me about this.
Posted on:
7/18/2008 12:00:00 AM
Posted by:
I was unable to do this when working with the code.  If you have found a way, please let me know so I can add it to the article.
Posted on:
7/3/2008 12:00:00 AM
Posted by:
Great work! I searched that exactly. Really thanks! :-)
Posted on:
6/30/2008 12:00:00 AM
Posted by:

This coding has given very much help to me. Thak you very much.

Posted on:
5/2/2008 12:00:00 AM
Posted by:
Hi Baps Ahmed,

I just discover your article and after one hour reading, i have doing a auto suggest who works very well because your article is well write with some comment for all people.
One words EXCELLENT EXCELLENT ..

Have a nice day
Christophe
Posted on:
4/22/2008 12:00:00 AM
Posted by:
I got ''Unknown Runtime Error''  in Javascript while Run this application .The Response.Write Statement in Lookup Page Will be retrived thru req.ResponseText using javascript it returns everything along with Tags.i used javascript alert to view contents using innerText but innerHTML is not working.i do not know why All the Tags are not truncated.I think There might be problem with using XMLHttpRequest with InnerHTML.

Thanks in Advance.
Posted on:
4/22/2008 12:00:00 AM
Posted by:
What type of browser are you using?  the innerHTML may not be working because it didn't find the div control using the javascript.  Try to put a debug point on the LookUp.aspx page to see if it gets triggered once you are typing.  This way you can see what it writes back.
In the Process Method after your alert, first check if the document.getElementById('THEDIVID') is null or not in javascript.  If it is not, it should work properly.  I tested this in IE, and the attached solution worked.
Also check that it is connection to the db correctly when it is doing the query in the LookUp.aspx page.  Let me know what happens...
Posted on:
4/22/2008 12:00:00 AM
Posted by:
i am using Microsoft.NET 1.1
Posted on:
4/26/2008 12:00:00 AM
Posted by:

Sridhar Go to the LookUp.aspx page and from there remove every thing except the first line.

The HTML code is the culprit in your case.Not an Browser issue.

Posted on:
4/11/2008 12:00:00 AM
Posted by:
thank you sir
Posted on:
4/11/2008 12:00:00 AM
Posted by:
Awaiting for the working Autosuggest.Thanks once again sir
Posted on:
4/11/2008 12:00:00 AM
Posted by:
Posted on:
4/10/2008 12:00:00 AM
Posted by:

I worked with the above sample.But its not retrieving the data in the div.But displayed the value of ''mydata'' in textbox.What is the actual use of Response.Write.Should the javascript be called in LookUp.aspx.Thanks in Advance

Posted on:
4/10/2008 12:00:00 AM
Posted by:
The javascript should be referenced from the .net (aspx page) where you have your textbox for which you would like an autosuggest feature.  When someone types into the textbox, it will call the LookUp.aspx page which will fetch relevant choices. 
It uses the Response.Write to create a div panel with a list of the choices to be displayed below the textbox. 

The javascript in the aspx page reads the div sent back and places it underneath the textbox.  Once the user clicks on the desired choice, it will replace it in the textbox. 

An example would be if you are typing a name which also exists in the database.  If I start to type J, then the choices will show up for Jack, Jacky, Jackeline, Jane, Jamie.  If I continues to type more letters after J, the options would filter more and more.
If I meant to type Jackeline, I would simple click on it, without typing the whole thing in.

Hope this helps.  Let me know if you have more questions.
Posted on:
4/10/2008 12:00:00 AM
Posted by:

In the function ''Process'' in the Javascript what does (req.status==200) denotes.If i keep alert there,it is not triggered.It is directly moving to the else part.It is throwing the error . "There was a problem retriving data : Internal Server Error".Need help.

Posted on:
4/10/2008 12:00:00 AM
Posted by:
It will return a status of 200 of it found your Lookup.aspx page.  It is not finding it for some reason.  Are both pages in the same directory?
Posted on:
4/10/2008 12:00:00 AM
Posted by:
Are you using the provided example, or a brand new once of your own?
Posted on:
4/10/2008 12:00:00 AM
Posted by:

In the function ''Process'' in the Javascript what does (req.status==200) denotes.If i keep alert there,it is not triggered.It is directly moving to the else part.It is throwing the error . "There was a problem retriving data : Internal Server Error".Need help.

Posted on:
4/10/2008 12:00:00 AM
Posted by:
I am using the provided example.I am using this in vb.net.Including the js file all the files are in same directory.The function ''SetTextbox'' is not triggered.If we write the code as response.write,will it go and call a function in js file from the previous page.Teach me out
Posted on:
4/10/2008 12:00:00 AM
Posted by:
I am using the provided example.I am using this in vb.net.Including the js file all the files are in same directory.The function ''SetTextbox'' is not triggered.If we write the code as response.write,will it go and call a function in js file from the previous page.Teach me out
Posted on:
4/10/2008 12:00:00 AM
Posted by:
I am using the provided example.I am using this in vb.net.Including the js file all the files are in same directory.The function ''SetTextbox'' is not triggered.If we write the code as response.write,will it go and call a function in js file from the previous page.Teach me out
Posted on:
4/10/2008 12:00:00 AM
Posted by:
The javascript ajax method will call the lookup.aspx page which will return the div.  That same javascript gets a status code of 200 and recieves back the information in div sections.  The div sections have a javascript onclick function which calls the SetTextbox method to place the selected text to the textbox.  I am not sure where you have the problem, but will make a vb.net version for you by tomorrow.
Posted on:
2/28/2008 12:00:00 AM
Posted by:
very good ahmed :)

i really like it.

get 4 from me.
Posted on:
11/28/2008 12:00:00 AM
Posted by:
hi