postback error

D

DC Gringo

I am getting a error upon attempting a postback that causes a redirection of
the browser from http://myserver.com/ to http://myserver.com/0.

My Try Catch block with exception handler doesn't come up with anything.

Here is my HTML and code-behind...which is a user control that serves as the
site's main header:

<LINK HREF="NSStyles.css" TYPE="text/css" REL="stylesheet">
<!-- //////////// MAIN HEADER //////////// -->
<SCRIPT LANGUAGE="javascript">
<!--

function clickDefaultButton(e, buttonid){
var bt = document.getElementById(buttonid);
if (typeof bt == 'object'){
if(navigator.appName.indexOf("Netscape")>(-1)){
if (e.keyCode == 13){
bt.click();
return false;
}
}
if (navigator.appName.indexOf("Microsoft Internet
Explorer")>(-1)){
if (event.keyCode == 13){
bt.click();
return false;
}
}
}
}
//-->
</SCRIPT>

<TABLE CLASS="navtop" ID="navtop" CELLSPACING="0" CELLPADDING="0"
WIDTH="780" BORDER="0">
<TBODY>
<TR>
<TD ID="navtop1" COLSPAN="2">
<DIV ID="homelink"><ASP:HYPERLINK ID="hlHomeTopLeft" NAVIGATEURL="~/"
RUNAT="server"></ASP:HYPERLINK></DIV>

<DIV ID="searchform"><ASP:TEXTBOX ID="tbSearch" ONFOCUS="this.value=''"
TEXT="search fews" MAXLENGTH="25" RUNAT="server"></ASP:TEXTBOX><ASP:BUTTON
ID="GO" RUNAT="server" CAUSESVALIDATION="false"
COMMANDNAME="GO_Click"></ASP:BUTTON></DIV>
<DIV><ASP:HYPERLINK ID="hlContact" NAVIGATEURL="~/networks/"
RUNAT="server"></ASP:HYPERLINK></DIV>
<DIV><ASP:HYPERLINK ID="hlEmail" NAVIGATEURL="~/email/"
RUNAT="server"></ASP:HYPERLINK></DIV>
<DIV><ASP:HYPERLINK ID="hlHelpFeedback" NAVIGATEURL="~/help/"
RUNAT="server"></ASP:HYPERLINK></DIV>
<DIV><ASP:HYPERLINK ID="hlAbout" NAVIGATEURL="~/about/?pageID=aboutHome"
RUNAT="server"></ASP:HYPERLINK></DIV>
</TD>
<!-- </FORM> --></TR>
<TR>
<TD ID="navtop2"><A HREF="/"><ASP:IMAGE ID="imgFewsNetLogo" STYLE="FLOAT:
left" RUNAT="server" VISIBLE="False" HEIGHT="70"
WIDTH="122"
IMAGEURL="~/images/mainHeaderLogoAltShade.gif"></ASP:IMAGE><ASP:IMAGE
ID="imgMfewsLogo" RUNAT="server" VISIBLE="False"
IMAGEURL="CentralAmerica/images/mfewsLogo.gif"
IMAGEALIGN="Left"></ASP:IMAGE><ASP:IMAGE ID="imgUsaidActivity"
STYLE="FLOAT: right" RUNAT="server" VISIBLE="False"
IMAGEURL="images/fews_logotype.gif"></ASP:IMAGE><asp:Image
id="imgUSAIDActivityEs" STYLE="FLOAT: right" RUNAT="server" VISIBLE="False"
ImageUrl="images/fews_logotypeColor_es.gif"></asp:Image><ASP:IMAGE
ID="imgUsaidActivityNoFewsNet" STYLE="FLOAT: right" RUNAT="server"
VISIBLE="False"
IMAGEURL="images/fews_logotypeNoFEWSNET.gif"></ASP:IMAGE><asp:Image
id="imgUsaidActivityNoFewsNetEs" STYLE="FLOAT: right" RUNAT="server"
VISIBLE="False"
IMAGEURL="images/fews_logotypeNoFEWSNET_es.gif"></asp:Image></A></TD>
</TR>
<UC1:MAINNAV ID="MainNav1"
RUNAT="server"></UC1:MAINNAV></TBODY><UC1:SECTIONHEADER ID="SectionHeader1"
RUNAT="server"></UC1:SECTIONHEADER></TABLE>
<!-- //////////// MAIN HEADER //////////// -->


Public Class mainHeader
Inherits System.Web.UI.UserControl
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents ddlLanguageSelection2 As
System.Web.UI.WebControls.DropDownList
Protected WithEvents Table1 As System.Web.UI.WebControls.Table
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents Image1 As System.Web.UI.WebControls.Image
Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel
Protected WithEvents Panel2 As System.Web.UI.WebControls.Panel
Protected WithEvents panel3 As System.Web.UI.WebControls.Panel
Protected WithEvents Panel4 As System.Web.UI.WebControls.Panel
Protected WithEvents Panel5 As System.Web.UI.WebControls.Panel
Protected WithEvents Panel6 As System.Web.UI.WebControls.Panel
Protected WithEvents aboutLinkEN As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperlinkES As System.Web.UI.WebControls.HyperLink
Protected WithEvents Textbox2 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button3 As System.Web.UI.WebControls.Button
Protected WithEvents hlAboutLinkEN As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlHelpLinkEN As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlEmailUpdates As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlContactsNetworks As
System.Web.UI.WebControls.HyperLink
Protected WithEvents HomeLinkEN As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlHome As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlContactNetworks As
System.Web.UI.WebControls.HyperLink
Protected WithEvents Image2 As System.Web.UI.WebControls.Image
Protected WithEvents ddlLanguageSelection1 As
System.Web.UI.WebControls.DropDownList


Public WithEvents mainRegionCountrySelectors3 As New
mainRegionCountrySelectors
Public sectionHeader1 As sectionHeader
Protected WithEvents imgMfewsLogo As System.Web.UI.WebControls.Image
Protected WithEvents imgFewsNetLogo As System.Web.UI.WebControls.Image
Protected WithEvents imgUsaidActivity As System.Web.UI.WebControls.Image
Protected WithEvents imgUsaidActivityNoFewsNet As
System.Web.UI.WebControls.Image
Protected WithEvents tbSearch As System.Web.UI.WebControls.TextBox
Protected WithEvents hlEmail As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlHomeTopLeft As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlContact As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlHelpFeedback As System.Web.UI.WebControls.HyperLink
Protected WithEvents hlAbout As System.Web.UI.WebControls.HyperLink
Protected WithEvents GO As System.Web.UI.WebControls.Button
Protected WithEvents imgUSAIDActivityEs As System.Web.UI.WebControls.Image
Protected WithEvents imgUsaidActivityNoFewsNetEs As
System.Web.UI.WebControls.Image

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Try
'Determine which logo graphic to show, FEWS NET or MFEWS
Dim areaID As String
areaID = CType(Request.QueryString("f"), String)
'Based on language selection, select words
If Not Request.QueryString("l") Is Nothing And Request.QueryString("l") =
"es" Then
hlHomeTopLeft.Text = "Pàgina Principal"
hlAbout.Text = "Acerca de"
hlHelpFeedback.Text = "Ayuda/Realimentación"
hlContact.Text = "Contactos/Redes"
hlEmail.Text = "Actualización de Correo Electrónico"
Select Case areaID
Case Is = "r5", "hn", "gt", "ni"
imgMfewsLogo.Visible = True
imgUsaidActivityNoFewsNetEs.Visible = True
Case Is = Nothing
imgFewsNetLogo.Visible = True
imgUSAIDActivityEs.Visible = True
Case Else
imgFewsNetLogo.Visible = True
imgUSAIDActivityEs.Visible = True
End Select
If Not Page.IsPostBack Then
tbSearch.Text = "Buscar FEWS NET"
End If
GO.Text = "IR A"
Else
hlHomeTopLeft.Text = "Home"
hlAbout.Text = "About"
hlHelpFeedback.Text = "Help/Feedback"
hlContact.Text = "Contacts/Networks"
hlEmail.Text = "E-mail Updates"
Select Case areaID
Case Is = "r5", "hn", "gt", "ni"
imgMfewsLogo.Visible = True
imgUsaidActivityNoFewsNet.Visible = True
Case Is = Nothing
imgFewsNetLogo.Visible = True
imgUsaidActivity.Visible = True
Case Else
imgFewsNetLogo.Visible = True
imgUsaidActivity.Visible = True
End Select
If Not Page.IsPostBack Then
tbSearch.Text = "Search FEWS NET"
End If
GO.Text = "GO"
End If


tbSearch.Attributes.Add("onkeypress", "return clickDefaultButton(event,'" &
GO.ClientID + "')")
Catch ex As Exception
ExceptionManager.Publish(ex)
End Try

End Sub

Private Sub GO_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles GO.Click
Dim sSrch As String = tbSearch.Text
If (sSrch.Length = 0) OrElse ("search fews net" = sSrch.ToLower) Then
Exit Sub
Else
If UserInputValidation.CheckString(sSrch) Then
sSrch = "~/search/index.aspx?srch=" & sSrch
Response.Redirect(HttpContext.Current.Server.UrlPathEncode(sSrch))
Response.End()
End If
End If
End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top