Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hii,
I install the XSLTsearch package for umbraco, everything allright..
But, i need to implement in my header ( masterpage) the search, but i don't wanna show the results on the same page..
I have one form and two buttons, one of them, it's login, and the other it's the search.. just search must jump to other page..
Any idea?
Cheers
B.
Put the searchbox and the searchbutton in their own form. Post that form to the page with the search results (XsltSeach page).
Example:
<form id="theID" action="{umbraco.library:NiceUrl(SearchPage/@id)}" method="post">... form stuff</form>
I try that before, and in my template i put <form runat="server" action="/search.aspx" method="post"> ...
and in a source code appears <form method="post" action="/home.aspx?" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
this form doesn't need to be runat="server"
just remove the search elements out of your main 'runat' form and put them into the regular html form.
Note that 2 forms can't nest so put them in completly seperate forms.
Something like this:
<form id="searchForm" action="{umbraco.library:NiceUrl(theidofyourresultpage)}" method="post"> <input id="searchfor" name="search" type="text"></input> <input type="button" name="searchbutton"></input></form>
Berts method is probably the better way to do it, but if you are using other .NET controls, and thefore have a form around everything already, try adding a script block at the top of your master page such as:
<script runat="server"> protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect(string.Format("/search.aspx?search={0}", HttpUtility.UrlEncode(txtSearch.Text))); } </script>
And then create your search box something like:
<asp:Panel ID="pnlSearch" runat="server" DefaultButton="btnSearch"> <asp:TextBox ID="txtSearch" runat="server" /> <asp:Button id="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" /></asp:Panel>
Matt
Thanks Matt and Bert, I used the Bert´s method however the Matt´s solution must be work operating.
Cheers.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Search in Header
Hii,
I install the XSLTsearch package for umbraco, everything allright..
But, i need to implement in my header ( masterpage) the search, but i don't wanna show the results on the same page..
I have one form and two buttons, one of them, it's login, and the other it's the search.. just search must jump to other page..
Any idea?
Cheers
B.
Put the searchbox and the searchbutton in their own form. Post that form to the page with the search results (XsltSeach page).
Example:
I try that before, and in my template i put <form runat="server" action="/search.aspx" method="post"> ...
and in a source code appears <form method="post" action="/home.aspx?" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
this form doesn't need to be runat="server"
just remove the search elements out of your main 'runat' form and put them into the regular html form.
Note that 2 forms can't nest so put them in completly seperate forms.
Something like this:
Berts method is probably the better way to do it, but if you are using other .NET controls, and thefore have a form around everything already, try adding a script block at the top of your master page such as:
And then create your search box something like:
Matt
Thanks Matt and Bert, I used the Bert´s method however the Matt´s solution must be work operating.
Cheers.
B.
is working on a reply...