June 21st, 2012, 03:50 PM
Searchbox doesn't work on HomePage
I'm a newbie to Asp.net. Here is my website: nicegesture.com
The problem is the searchbox at header (right at the navigation menu) doesn't work just only at HomePage.
It works on all of the page except homepage. When click search at homepage, it doesn't submit anything and also not redirect to search page. There's a weird thing is it's working perfect at local host even for homepage, but not on the real server.
I've been spending 1 week finding a solution for it but it comes to nothing. Please give me an advice for this. I really appreciate it. Thank you.
Here's some of the code:
<form id="form1" runat="server">
<uc3:AdminPanel ID="AdminPanel1" runat="server"></uc3:AdminPanel>
<uc1:Header ID="Header1" runat="server" />
<uc4:SearchBox ID="SearchBox1" runat="server"></uc4:SearchBox>
And here's the code of Search Control:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Search.ascx.vb" Inherits="BVModules_Controls_Search" %>
<strong><span><asp:Label ID="lblTitle" runat="server" Text="Search" AssociatedControlID="KeywordField" Visible="false"></asp:Label></span></strong>
<asp:Panel runat="server" DefaultButton="btnSearch" ID="pnlSearchBox">
<asp:TextBox ID="KeywordField" Columns="35" runat="server" CssClass="forminput"></asp:TextBox>
<asp:ImageButton CausesValidation="false" CssClass="searchbutton" ID="btnSearch" runat="server"/>
And here's is the code behind search control:
Partial Class BVModules_Controls_Search
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Private Sub SetDefaultControlValues()
lblTitle.Text = Content.SiteTerms.GetTerm("Search")
btnSearch.ImageUrl = PersonalizationServices.GetThemedButton("GoSearch")
btnSearch.AlternateText = "Submit Form"
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSearch.Click
Response.Redirect("~/search.aspx?keyword=" & Server.UrlEncode(Me.KeywordField.Text.Trim))
June 22nd, 2012, 01:04 AM
Please use the forum CODE tags around posted code. I don't use NET and don't have any suggestions about your problem, sorry. If no one jumps in you might try the NET forum, this forum is primarily classic asp.
I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton