No way to do with all drag and drop?
My button and textbox are on the master page. My results gridview is
on the child page.
so on the child page I have:
<SelectParameters>
<asp:ControlParameter ControlID="txtFreeSearch"
Name="keywordlist" Type="String"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
and on the masterpage I have
<asp:Button ID="Button1" runat="server" Text="GO!"
PostBackUrl="~/FreeSearch.aspx" /></td>
I press the button and the FreeSearch.aspx page is called. It just
doesn't populate the gridview, but the page loads. The second time
(with the FreeSearch.aspx already loaded) I hit the button, it works.
This tells me the first time I hit the button on the master page (where
default.aspx is the content page at that time), and it posts to the
child, the data is not being passed or the SelectParameters cannot see
it for some reason.
Chris Fulstow wrote:
Perhaps you could do a page redirect in your search button's click
handler that passes the keyword to your search page, e.g.
protected void btnSearch_Click(object sender, EventArgs e)
{
Response.Redirect("Search.aspx?keywords=" +
HttpUtility.HtmlEncode(txtKeyword.Text);
}
You could then get the keywords from Request.QueryString and build you
results in the GridView?
HTH,
Chris