Tuesday, 21 June 2016
How to add Ajax Control Toolkit to Asp .Net Project
Step 1: First you need to download "AjaxControlToolkit.Binary.NET4.zip" .
https://ajaxcontroltoolkit.codeplex.com/downloads/get/608573
(If this link not working ,Search google "AjaxControlToolkit.Binary.NET4" and download it.File Size 7 MB approx)
Extract zip file.
Step 2: After downloading the file. Add reference to your project.
i)Right click the Solution Explorer and Add Reference.
ii) Browse extracted file and select "AjaxControlToolkit.dll".
iii) After open the project file adding automatically Bin folder if it is not exists.
iv) Add the toolbox menu. Right click and add new tab 'ajax'. Then right click the ajax tab select Choose Items.
v) An window will pop up . Select Browse.
vi) Browse the same extracted file and select "AjaxControlToolkit.dll".
vii) After adding it shows.And clik ok.
viii) Now the ajax tab in the tool box. Contains the options are.
Step 3:Add the new text box in your project.
Step 4:Right click the top right corner .Select Add Extender.An window will be open.And select the Auto complete Extender or Calender Extender like any.
Step 5: The code behind page seems.
Step 6: Differents below.
Normal Text Box.
Text Box with Ajax Extender.
Step 7 : Output.
Code Behind page:
C# page :
O/P :
Monday, 20 June 2016
Auto Complete Text box using Ajax Auto Complete Extender and Retrieve the Database Column Values:
Step 1 : In your code behind page add ajax register tag like below.
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
Step 2 :Add ajax tool kit reference both Solution Explorer and Tool Box in your project.
Step 3: Add the text box in your page.
<asp:TextBox ID="txtdepname" runat="server" Width="175px" Height="25px"></asp:TextBox>
<asp:AutoCompleteExtender ID="txtdepname_AutoCompleteExtender" runat="server" MinimumPrefixLength="1" CompletionSetCount="10"
DelimiterCharacters="" Enabled="True" ServiceMethod="GetCity" TargetControlID="txtdepname" ServicePath="">
</asp:AutoCompleteExtender>
step 4: You need to database and table with values .
step 5: C# page contains the code below.
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetCity(string prefixText, int count)
{
MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["constr1"].ConnectionString);
MySqlCommand cmdsur = new MySqlCommand("select distinct empname from empwork where " + "empname like '" + prefixText + "%'", con);
cmdsur.Connection = con;
con.Open();
List<string> name = new List<string>();
MySqlDataReader sdr = cmdsur.ExecuteReader();
while (sdr.Read())
{
name.Add(sdr["empname"].ToString());
}
sdr.Close();
con.Close();
return name;
}
Step 6: Output
Subscribe to:
Posts (Atom)
How to create a simple Hello World website in ASP.NET MVC using Razor Syntax: (Note: I am using Visual Studio 2012 ) Step 1: ...

-
Dynamic News and Events Displaying in the Website using Marquee for Home page: Setp 1: (Note : Mysql database ): Create a new datab...
-
Step 1 : Adding the two text box and one button and gridview like below in your page. Step 2: Add the code in aspx page. <%...