Hi,
If i enter a 10 digit hall ticket number in a text box,automatically without pressing any button and any keys i will get the details of student...how can i do this...if anyone knows please provide me code for this...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi ShekharPosted Apr 26, 2013, 2:09 AM
Please gothrough with my new attachment.
Ravi ShekharPosted Apr 26, 2013, 12:06 AM
You want to perform event without any click. this is a best way to use which i said.
Please gothrough with my last attachment.
Satyapriya NayakPosted Apr 25, 2013, 10:58 AM
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace Textbox_gridview
{
public partial class _Default : System.Web.UI.Page
{
string strConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
string str;
SqlCommand com;
SqlDataAdapter sqlda;
DataSet ds;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bindgrid();
}
}
public void bindgrid()
{
SqlConnection con = new SqlConnection(strConnString);
con.Open();
str = "select * from employee";
com = new SqlCommand(str, con);
sqlda = new SqlDataAdapter(com);
ds = new DataSet();
sqlda.Fill(ds, "employee");
GridView1.DataMember = "employee";
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
protected void txt_empid_TextChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(strConnString);
con.Open();
str = "select * from employee where empid like '" + txt_empid.Text + "%'";
com = new SqlCommand(str, con);
sqlda = new SqlDataAdapter(com);
ds = new DataSet();
sqlda.Fill(ds, "employee");
GridView1.DataMember = "employee";
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Label3.Text = DateTime.Now.ToString();
}
}
}
SarithaPosted Apr 25, 2013, 8:38 AM
Hi,
I want same as the following link....http://schools9.com/apinter1g.htm...Here u enter the hall ticket number as 1322122819...then u observe how the output will be displayed....means after entering 10 digit hall ticket number immediately without pressing any button and any key it displays the output...if u know how to do..please provide me code...
SarithaPosted Apr 25, 2013, 8:38 AM
Hi,
I want same as the following link....http://schools9.com/apinter1g.htm...Here u enter the hall ticket number as 1322122819...then u observe how the output will be displayed....means after entering 10 digit hall ticket number immediately without pressing any button and any key it displays the output...if u know how to do..please provide me code...
Thanks,
Saritha
Ravi ShekharPosted Apr 25, 2013, 4:44 AM
Please find enclosed attachedment.
In this application I created a demo application. When you write 2 digit in a textbox.
A event will fire (client side).and the data comes from web service.
Now I am explaning what u want?
You want to call data when i enter roll number in a textbox .
You have to write a method in web service to get Data according to your roll no.
Note that It should give result in a collection type. Now you can easily get your data in a "res".
PFA attachment . Any query Please write.
If you satisfied with my answer and demo. please mark it as answer.
Regards ,
Ravi.
Anurag SarkarPosted Apr 25, 2013, 3:19 AM