Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I set autopostback propoerty of textbox as true.
and on textchanged event of text box, i'm binding a dropdown list. but it is taking time.
On localhost its fine. But using VPN, its taking more than 1 min. Plz help me to resolve this problem
Posted
Comments
Can you please share the code?
Dipali_Wagh 10-Jul-13 7:25am    
plz suggest me solution to reduce time.
Dipali_Wagh 10-Jul-13 7:17am    
ya sure.
Here is my code on aspx:
<asp:TextBox ID="txtPinCode" runat="server" AutoPostBack="True" ontextchanged="txtPinCode_TextChanged" >

code in aspx.cs:

protected void txtPinCode_TextChanged(object sender, EventArgs e)
{
txtPinCode.CssClass = "txtbox";
pd.PinCode = txtPinCode.Text;
pd.ID = 1;
DataTable dt = new DataTable();

dt = hd.GetPODetails(pd);

if (dt.Rows.Count > 0)
{
lblErrPinCode.Visible = false;
ddlPostOffice.DataTextField = dt.Columns["Description"].ToString();
ddlPostOffice.DataValueField = dt.Columns["ID"].ToString();
ddlPostOffice.DataSource = dt;
ddlPostOffice.DataBind();
ddlPostOffice.Items.Insert(0, new ListItem("---Select---", "0"));

pd.PinCode = txtPinCode.Text;
pd.ID = 3;
DataTable dtDist = new DataTable();

dtDist = hd.GetPODetails(pd);
if (dtDist.Rows.Count > 0)
{
txtDistrict.Text = dtDist.Rows[0]["DISTRICT_NAME"].ToString();
}
}
}

1 solution

Try this
XML
<asp:TextBox ID="datepickertxt" CssClass="form-text" runat="server" AutoPostBack="true"
                       ontextchanged="datepickertxt_TextChanged"></asp:TextBox>
Note:Property of textbox set ontextchanged event then it will work for u
 
Share this answer
 
Comments
Dipali_Wagh 10-Jul-13 7:59am    
same thing i'm doing. see my code
i want alternate solution for this.
bcoz its time consuming

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900