Answered by:
dropdownlist doesnt trick on host

Question
-
User739596497 posted
while i use my local host dropdownlist's tricks work well
but when i try to use on my host , dropdownlist's Selected index change event doesnt trick
<asp:DropDownList ID="dropCountry" BackColor=White CssClass="libox" runat="server" AutoPostBack="True" OnSelectedIndexChanged="dropCountry_SelectedIndexChanged"> </asp:DropDownList>
protected void dropCountry_SelectedIndexChanged(object sender, EventArgs e) { lbl2.Text = "annen"; dropCity.Items.Clear(); cityService.GlobalWeather cityServ = new cityService.GlobalWeather(); string result = cityServ.GetCitiesByCountry(dropCountry.SelectedItem.Text); XDocument xdoc = XDocument.Parse(result); var citys = xdoc.Descendants("Table"); foreach (var tag in citys) { dropCity.Items.Add(tag.Element("City").Value); } }
Thanks..
Thursday, July 18, 2013 5:21 PM
Answers
-
User739596497 posted
Problem solved when i use form runat="server"
i click random button on the page then page postback and i see selected index change event.
but there have a new problem
Selected index change event only work when page postback and i cant postback the page with dropdownlist i have to use random button like thisprotected void Button1_Click1(object sender, EventArgs e) { lbl2.Text = "asd"; }
also i set true dropdownlist's autopostback options .
Anyone help me ?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, July 20, 2013 4:31 AM
All replies
-
User-1225287840 posted
Do you mean the dropCountry_SelectedIndexChanged event is not firing or the code written inside this event is not working, if so, which line is not working?Thursday, July 18, 2013 5:32 PM -
User739596497 posted
When i selected a country on dropCountry , dropCountry_SelectedIndexChanged event is not Firing with using HOST
When i selected a country on dropCountry , dropCountry_SelectedIndexChanged event is Firing with using LocalHost
My codes work at LocalHost(Visual Studio)
My codes Doesnt work at Host(www.mstkacar.com)
Thx for reply :)Thursday, July 18, 2013 5:45 PM -
User-1225287840 posted
May be the recent changes is not reflected on the host server that means not deployed properly to the host sever. Try to re-compile and release it again.Thursday, July 18, 2013 6:15 PM -
User739596497 posted
how i can re-compile it ?
i make build rebuild Use IIS7.5 express and upload to host again and still same problem..Thursday, July 18, 2013 6:23 PM -
User-1225287840 posted
Refer this, http://stackoverflow.com/questions/9787464/selectedindexchanged-not-firing-on-any-list-control-on-live-serverThursday, July 18, 2013 7:00 PM -
User739596497 posted
so its about to
<form action="" />
right ?
Thursday, July 18, 2013 8:05 PM -
User-801004448 posted
I see you try to populate city based on country drop down list.
Do you store cities in database?
Friday, July 19, 2013 1:02 AM -
User739596497 posted
kctt
I see you try to populate city based on country drop down list.
Do you store cities in database?
i just wanna to use Dropdownlist Event
Selected index Change event for Dropdownlist does not trigger on iss 7Friday, July 19, 2013 3:10 AM -
User-1225287840 posted
Have you tried as menstioned in the above link.
1. Try accessing the website including the page name. (http://www.mstkacar.com/youraspname.aspx)
2. Try including your asp file name in your form action attribute. <form action="youraspname.aspx" />
3. Have you double checked that selectedindex event is not firing. Just include Response.Write("selectedindex works") and find out the event is not firing or dropdownlist is not populating the values.
4. It could worth checking the above link in detail but before going into detail quickly check the scenario is applies to you.
Friday, July 19, 2013 5:02 AM -
User739596497 posted
sridhar_rs
Have you tried as menstioned in the above link.
1. Try accessing the website including the page name. (http://www.mstkacar.com/youraspname.aspx)
2. Try including your asp file name in your form action attribute. <form action="youraspname.aspx" />
3. Have you double checked that selectedindex event is not firing. Just include Response.Write("selectedindex works") and find out the event is not firing or dropdownlist is not populating the values.
4. It could worth checking the above link in detail but before going into detail quickly check the scenario is applies to you.
I tried but still same problem :)
Thx for repply :)
Friday, July 19, 2013 5:48 AM -
User739596497 posted
i found this entry while looking http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770154 and
http://forums.iis.net/t/1150606.aspx/1
other peoples have same problem with me :)Friday, July 19, 2013 5:59 AM -
User739596497 posted
Problem solved when i use form runat="server"
i click random button on the page then page postback and i see selected index change event.
but there have a new problem
Selected index change event only work when page postback and i cant postback the page with dropdownlist i have to use random button like thisprotected void Button1_Click1(object sender, EventArgs e) { lbl2.Text = "asd"; }
also i set true dropdownlist's autopostback options .
Anyone help me ?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, July 20, 2013 4:31 AM