I am performing the search event on the button click and showing the result in datalist inside the model popup on same button simultaneous. but when i am clicking the button it vill not showing the model popup. so kindly me...
<asp:Button ID="btnsearch" Text="Search Property" runat="server" class="btn btn-deault" OnClick="btnsearch_Click" />
<!-- ModalPopupExtender -->
<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btnsearch" OkControlID="btnsearch_Click"
CancelControlID="btnClose" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" align="center" Style="display: none">
<asp:DataList ID="dlallproperty" runat="server" RepeatDirection="Vertical">
<ItemTemplate>
<article class="hentry">
<div class="property-featured">
<span class="featured"><i class="fa fa-star"></i></span>
^ <a class="content-thumb" href="properties-details.aspx?propertyid=<%#Eval("propertyid") %>">
<img src="<%#Eval("propimage") %>" alt="logo">
</a>
<span class="property-label">Hot</span>
<span class="property-category"><a href="#">
<asp:Label ID="lblcomname" runat="server"><%#DataBinder.Eval(Container.DataItem,"propname") %></asp:Label>,
<asp:Label ID="Label1" runat="server"><%#DataBinder.Eval(Container.DataItem,"location") %></asp:Label></a></span>
</div>
<div class="property-wrap">
<h2 class="property-title">
<a href="properties-details.aspx?propertyid=<%#Eval("propertyid") %>" title="">
<asp:Label ID="Label2" runat="server"><%#DataBinder.Eval(Container.DataItem,"propname") %></asp:Label>,
<asp:Label ID="Label3" runat="server"><%#DataBinder.Eval(Container.DataItem,"location") %></asp:Label></a>
</h2>
<div class="property-excerpt">
<p>
<asp:Label ID="Label6" runat="server"><%#DataBinder.Eval(Container.DataItem,"prodesc") %></asp:Label>
</p>
</div>
<div class="property-summary">
<div class="property-detail">
<div class="size">
<asp:Label ID="Label4" runat="server"><%#DataBinder.Eval(Container.DataItem,"areasqft") %></asp:Label>
</div>
<div class="bathrooms">
<span>2</span>
</div>
<div class="bedrooms">
<asp:Label ID="Label7" runat="server"><%#DataBinder.Eval(Container.DataItem,"proptype") %></asp:Label>
</div>
</div>
<div class="property-info">
<div class="property-price">
<span>
<span class="amount"><i class="fa fa-inr"></i>
<asp:Label ID="Label5" runat="server"><%#DataBinder.Eval(Container.DataItem,"price") %></asp:Label></span>
</span>
</div>
<div class="property-action">
<a href="properties-details.aspx?propertyid=<%#Eval("propertyid") %>">More Details</a>
</div>
</div>
</div>
</div>
<div class="property-action property-fullwidth-action">
<a href="properties-details.aspx?propertyid=<%#Eval("propertyid") %>">More Details</a>
</div>
</article>
</ItemTemplate>
</asp:DataList>
<asp:Button ID="btnClose" runat="server" Text="Close" />
</asp:Panel>
<!-- ModalPopupExtender -
public void btnsearch_Click(object sender, EventArgs e)
{
string connstring = "Data Source=208.91.198.59;Initial Catalog=tecwork;Persist Security Info=True;User ID=supporttm;Password=$V8hy49h";
string query = "SELECT * FROM [dbo].[tblPropertyMaster] where location like '" + txtLocation.Text + " %' or sublocation like '" + txtSubLocation.Text + " %' or proptype like '" + ddlproptype.SelectedItem.Value + " %'";
SqlCommand cmd = new SqlCommand(query);
using (SqlConnection con = new SqlConnection(connstring))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
dlallproperty.DataSource = ds;
dlallproperty.DataBind();
mp1.Show();
}
}
}
}