Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Gridview from a button

$
0
0

I have a page with a searchbox (text), search button and a dropdown. 

The searchbox is references via the search button and the dropdown is populated when the page loads. 

I also have a Gridview which I have no problem pre-populating with the modules. However I am struggling to get the Gridview change once I make I click on the search button. 

Can you point me in the right direction? I have put the code below. I have looked at data rows and I have also seen the potential of pushing the filter into a temporary database and pulling that back in.  

 The code is not complex I believe all I need is a ‘trigger’ word!

In sumamry how do I populate a datagrid on click or select via a button and  a dropdown. (I am fairly sure I am missing something obvious!!!)

Code below.......

 

<%@ Page Title="" Language="VB" CodeFile="Module_details.aspx.vb" Inherits="Modules_Module_details" %><asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><!-- Search facilities --><p>
     Search Modules:<asp:TextBox ID="txtSearch" runat="server" Width="408px"></asp:TextBox>&nbsp;<asp:Button ID="btnSearch" runat="server" Text="Search" Width="108px" /></p><p>
        Search Modules (dropdown):<asp:DropDownList ID="ddSearchModules" runat="server" Height="17px"
            Width="458px" DataSourceID="Learn" DataTextField="ModuleName"
            DataValueField="ModuleID"></asp:DropDownList><asp:SqlDataSource ID="Learn" runat="server"
            ConnectionString="<%$ ConnectionStrings:LearnConnectionString %>"
            SelectCommand="SELECT [ModuleID], [ModuleName] FROM [tb.moduleID] ORDER BY [ModuleName]"></asp:SqlDataSource></p><p>Add New Module</p><p>List of Modules</p><p>Create a report from the selected Module</p><!-- // Search facilities --></asp:Content><asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"></asp:Content>

 


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>