I am currently working on a mapping application using ASP.net C#.
Within my application, I have implemented a textbox and button that searches a database based on postcode and displays the results in a Grid view on my aspx page...
public partial class _Default : System.Web.UI.Page
{
// SDE connection string to extract postcode from ADDRESS (sde) table.
private SqlConnection m_sqlConn;
protected void Page_Load(object sender, EventArgs e)
{
}
private void ShowMsg(string strMessage)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
if (txtPostCode.Text.Length > 0)
{
// Code for fetching data from database and displaying in gridview
}
else
{
ShowMsg("Error - No Postal Addresses Returned");
}
}
catch (Exception ex)
{
ShowMsg("Error - " + ex.Message);
}
}
private bool CloseDB()
{
try
{
// Code to close database connection
return (true);
}
catch (Exception ex)
{
return (false);
}
}
}
Now, I am looking to enhance the user experience by implementing a Modal PopUp where the search results are displayed modally when the user clicks the search button. I tried setting it up with a fake ControlID button but encountered some issues...
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button id="BtnFake" runat="server" Style="display: none"/>
<table id="ModalGrid">
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
<asp:Button id="Button2" runat="server" Text="OK" />
</table>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="BtnFake" PopupControlID="ModalGrid" DropShadow="false"
BackgroundCssClass="ModalBackground"
CancelControlID="BtnOK" BehaviorID="ModalGrid" RepositionMode="RepositionOnWindowScroll">
</cc1:ModalPopupExtender>
Any suggestions or ideas? I feel like I might be missing something obvious. Thank you.