I am using Ajax enabled pages but i did't use any control in this page. eventhough SelectedIndexChanged Event is not firing. I have added items from database there is no repetation and also set autopost back propety="true". i want to add items from database when select one item from above dropdownlist.
it showing the fallowing javascript error: Object doesn't support this property or method
i am sending code for that..
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="rentals.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>AP-Adda::Everything for you</title><link href="../Styles/style.css" rel="stylesheet" type="text/css" />
</
head>
<
body>
<form id="form1" runat="server">
<div id="wrapper">
<div id="wrapper2">
<div id="header">
<div id="logo">
<h1>
APadda
</h1>
</div>
<div id="menu">
<ul>
<li><a href="index.aspx">Home</a></li>
<li><a href="e-zone.aspx">E-Zone</a></li>
<li><a href="e-books.aspx">E-Books</a></li>
<li><a href="rentals.aspx">Rentals</a></li>
<li><a href="gallery.aspx">Gallery</a></li>
<li><a href="contact.aspx">Contact</a></li>
</ul>
</div>
</div>
<div id="page">
<div id="content">
<div class="post">
<h2 class="title">
Searh for Rentals
</h2>
<div class="entry">
Rental-Type
<asp:DropDownList ID="drpsrentType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="drpsrentType_SelectedIndexChanged1" />
<br />
<br />
Range
<asp:DropDownList ID="drprentRangefrom" runat="server" Style="margin-left: 33px;">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList>
 To  <asp:DropDownList ID="drprentRangeto" runat="server"
Style="margin-left: 10px;">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList><br />
<br />
City
<asp:DropDownList ID="drpsCity" runat="server" Style="margin-left: 46px;" AutoPostBack="True" />
<br />
<br />
Location
<asp:DropDownList ID="drpsLocation" runat="server" Style="margin-left: 19px;">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList><br />
<br />
<strong>Note:</strong><br />
<br />
House Rent for one Month.
<br />
Incase of Car, Bike and Function hall rent period is one day.
<br />
<br />
<asp:Button ID="btnRental" runat="server" Text="Search" CssClass="button" OnClick="btnRental_Click" />
</div>
</div>
<div class="post">
<h2 class="title">
Submit Rentals
</h2>
<div class="entry">
<p>
Name
<asp:TextBox ID="TextBox1" runat="server" CssClass="control"></asp:TextBox><br />
<br />
Contact-No
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<br />
Rent
<asp:TextBox ID="TextBox3" runat="server" Style="margin-left: 37px;"></asp:TextBox><br />
<br />
Rental-Type
<asp:DropDownList ID="drpRentalType" runat="server" Style="margin-left: -2px;" />
<br />
<br />
City
<asp:DropDownList ID="drpCity" runat="server" Style="margin-left: 43px;" AutoPostBack="True"
OnSelectedIndexChanged="drpCity_SelectedIndexChanged">
</asp:DropDownList><br />
<br />
Location
<asp:DropDownList ID="drpLocation" runat="server" Style="margin-left: 16px">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList></p>
<br />
<asp:Button ID="btnSubmit" Text="Submit" CssClass="button" runat="server" />
</div>
</div>
</div>
<!-- end #content -->
<div id="sidebar">
<ul>
<li id="search">
<h3>
Search
</h3>
<form id="searchform" method="get" action="">
<div>
<input type="text" name="s" id="s" size="15" />
<input name="submit" type="submit" value="Go" />
</div>
</form>
</li>
<li>
<h3>
Latest New's
</h3>
<p><strong>APadda</strong> is going start a new website on Reddy community. It has
been developing since last month. I am requseting you people to help through providing
info about Popular Reddy's
<a href="#">More…</a></p>
</li>
</ul>
<h3>
Real Estate
</h3>
</div>
<!-- end #sidebar -->
<div style="clear: both;">
</div>
<div id="widebar">
<div id="colA">
<h3>
E-Books (To download Login)
</h3>
<dl class="list1">
<dt>C#-Cook book</dt>
<dd>
<a href="#">William</a></dd>
<dt>Asp.Net-vb</dt>
<dd>
<a href="#">Balaguruswami</a></dd>
<dt>Java</dt>
<dd>
<a href="#">Jamesford</a></dd>
<dt>CSS</dt>
<dd>
<a href="#">Krishna</a></dd>
<dt>HTML-Tips</dt>
<dd>
<a href="#">Margarate</a></dd>
</dl>
</div>
<div id="colB">
<h3>
Rent a House, Car or Bike
</h3>
<p>Apadda is providing valuble service to the visitos. Here you can search for
a rent house, car, bike or function hall. As same you can submit your rent house,
bike, car detials to the visitors. We are providing a efficient service to get or
submit rentals..
<a href="#">More…</a></p>
</div>
<div id="colC">
<h3>
Visit Gallery Now
</h3>
<ul class="list2">
<li><a href="#">
<img src="../images/img12.jpg" alt="" width="50" height="50" /></a></li>
<li><a href="#">
<img src="../images/img13.jpg" alt="" width="50" height="50" /></a></li>
<li><a href="#">
<img src="../images/img14.jpg" alt="" width="50" height="50" /></a></li>
<li><a href="#">
<img src="../images/img15.jpg" alt="" width="50" height="50" /></a></li>
<li><a href="#">
<img src="../images/img16.jpg" alt="" width="50" height="50" /></a></li>
<li class="nopad"><a href="#">
<img src="../images/img17.jpg" alt="" width="50" height="50" /></a></li>
</ul>
</div>
<div style="clear: both;">
</div>
</div>
<!-- end #widebar -->
</div>
<!-- end #page -->
</div>
<!-- end #wrapper2 -->
<div id="footer">
<p>
(c) 2007 Ap-Adda. Design by
<a href="#">Sathya Websolutions</a></p>
</div>
</div></form>
</
body>
</
html>
using
System;
using
System.Data;
using
System.Configuration;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
Common;
using
BusinessFacade;
#endregion
public
partial class _Default : System.Web.UI.Page
{
#region "common variable declaration "
Common.
UserInfo uinfo = new UserInfo();
BusinessFacade.
BAUserInfo binfo = new BAUserInfo();
#endregion
#region "page load "protected void Page_Load(object sender, EventArgs e)
{
location();
rentType();
}
#endregion
#region "To add cities to the ddList "public void location()
{
DataTable objtable = null;
objtable = binfo.BALocation(uinfo);
string city="Select,";for (int i = 0; i < objtable.Rows.Count; i++)
{
city=city+objtable.Rows[i]["cityName"].ToString()+ ",";
}
if (city.Length > 0)
{
city = city.Substring(0, city.Length - 1);
}
city.TrimEnd(',');string[] cities = city.Split(',');
drpCity.DataSource = cities;
drpCity.DataBind();
drpsCity.DataSource = cities;
drpsCity.DataBind();
}
#endregion
#region "To add Rent type to ddList "public void rentType()
{
DataTable objtable = null;
objtable = binfo.BArentType(uinfo);
string rent = "Select,";for (int i = 0; i < objtable.Rows.Count; i++)
{
rent = rent + objtable.Rows[i]["rentType"].ToString() + ",";
}
if (rent.Length > 0)
{
rent = rent.Substring(0, rent.Length - 1);
}
rent.TrimEnd(',');string[] renttype = rent.Split(',');
drpRentalType.DataSource = renttype;
drpRentalType.DataBind();
drpsrentType.DataSource = renttype;
drpsrentType.DataBind();
}
#endregion
#region "To add Locations to ddList on select "public void Address()
{
DataTable objtable = null;
uinfo.cityName = drpCity.SelectedItem.Value.ToString();
objtable = binfo.BAAddress(uinfo);
string address = "Select,";for (int i = 0; i < objtable.Rows.Count; i++)
{
address = address + objtable.Rows[i]["rentType"].ToString() + ",";
}
if (address.Length > 0)
{
address = address.Substring(0, address.Length - 1);
}
string[] addresses = address.Split(',');
drpLocation.DataSource = addresses;
drpLocation.DataBind();
}
#endregion
#region "dropdown list to select location "protected void drpCity_SelectedIndexChanged(object sender, EventArgs e)
{
Address();
}
#endregion
#region "To search for the rental "protected void btnRental_Click(object sender, EventArgs e)
{
}
#endregion
#region "To get the Rent Range to dropdownlist "protected void drpsrentType_SelectedIndexChanged1(object sender, EventArgs e)
{
DataTable objtable = null;
uinfo.rentType = drpsrentType.SelectedItem.Value;
objtable = binfo.BArentRange(uinfo);
if (objtable.Rows.Count != null)
{
for (int index = 0; index < objtable.Rows.Count; index++)
{
drprentRangefrom.Items.Add(new ListItem(objtable.Rows[index]["rentRangeFrom"].ToString()));drprentRangeto.Items.Add(new ListItem(objtable.Rows[index]["rentRangeTo"].ToString()));
}
}
}
#endregion
#region "To add location to the list in search "protected void drpsCity_SelectedIndexChanged(object sender, EventArgs e)
{
DataTable objtable = null;
uinfo.cityName = drpsCity.SelectedItem.Value.ToString();
objtable = binfo.BAAddress(uinfo);
string address = "Select,";for (int i = 0; i < objtable.Rows.Count; i++)
{
address = address + objtable.Rows[i]["rentType"].ToString() + ",";
}
if (address.Length > 0)
{
address = address.Substring(0, address.Length - 1);
}
string[] addresses = address.Split(',');
drpsLocation.DataSource = addresses;
drpsLocation.DataBind();
}
#endregion
}