Hi Jeff,
You can expose the submit button and the search text to the content page.
The content page hooks up the submit button's click event and retrieves the
searched text:
MasterPage2.master:
<%@ Master Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public ReadOnly Property SearchButton() As Button
Get
Return btnSearch
End Get
End Property
Public ReadOnly Property SearchText() As String
Get
Return txtSearch.Text
End Get
End Property
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox><asp:Button
ID="btnSearch" runat="server" Text="Search" />
<div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
Default3.aspx:
<%@ Page Language="VB" MasterPageFile="~/MasterPage2.master"
Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPage2.master" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
AddHandler Master.SearchButton.Click, AddressOf SearchButton_Click
End Sub
Private Sub SearchButton_Click(ByVal sender As Object, ByVal e As
EventArgs)
Label1.Text = Master.SearchText
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:Label ID="Label1" runat="server"></asp:Label>
</asp:Content>
For more information about Master Pages, please see following article:
#ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps
http://www.odetocode.com/Articles/450.aspx
Hope this helps.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.