I am having nested dropdown list in my page, based on the selection in any of the dropdown list other dropdowns will also be changed(post back is handled in page load),But this affects the performance a lot .
I have also use update panel but i think it is not run properly.
Is there any work around to improve the performance??,
Help me with this,Thanks
Loading
Sukesh MarlaPosted Sep 7, 2012, 1:55 AM
same code works in other page but not in this means, this is the problem,
Try to minimize Viewstate you are maintaining
Check this is correct answer if it helepd
Tushar PawarPosted Sep 7, 2012, 12:26 AM
Here is my db code in LINQ and districts my be 20+
and when i write same code for dropdownlist on another page it work fine.
public IList
{
return db.Districts.OrderBy(o => o.DistrictName).Where(o => o.StateId==stateId).ToList();
}
Sukesh MarlaPosted Sep 6, 2012, 1:04 PM
How many Districts you are gettig in result,
By be your database script is slow,
if yes try to optimize that.
Check this is correct answer if it helped
Tushar PawarPosted Sep 6, 2012, 2:17 AM
Thanks for quick reply....
and my is here but it takes time when i publish my website on server..
SetFocusOnError="true" ToolTip="Please Select State">
--------------------------------------------------------------------------------------------
protected void ddlPatientState_SelectedIndexChanged(object sender, EventArgs e)
{
ddlPatientDistrict.Items.Clear();
ddlPatientDistrict.DataSource = objDataAccess.GetAllDistrictByStateId(Convert.ToInt32(ddlPatientState.SelectedValue));
ddlPatientDistrict.DataTextField = "DistrictName";
ddlPatientDistrict.DataValueField = "DistrictId";
ddlPatientDistrict.DataBind();
ddlPatientDistrict.Items.Insert(0, new ListItem("Please Select", "-1"));
ddlPatientTahsil.Items.Clear();
ddlPatientTahsil.Items.Insert(0, new ListItem("Please Select", "-1"));
}
Sukesh MarlaPosted Sep 6, 2012, 2:08 AM
Update Panel is more preferred,
Let me knw what error ur getting,
Go throgh this article to understand how to use updatepanel
http://www.c-sharpcorner.com/UploadFile/SukeshMarla/ajax-asynchronous-javascript-and-xml/
Check this is correct answer if it helped