473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

postback error

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.UrlPa thEncode(sSrch))
Response.End()
End If
End If
End Sub
End Class
Nov 19 '05 #1
0 1299

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
2
by: johngilmer | last post by:
I have a login page and it appears just fine (login.aspx). There are a couple of links on the page which use javascript to bring up modal dialogs of other aspx pages, and they work fine. But if I...
6
by: | last post by:
Hi all, I have a bunch of dropdownlists that are populated in client-side javascript. When i do a postback I get the following error:- Invalid postback or callback argument. Event...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
3
by: Martin | last post by:
Hi, I have an aspx page with two dropdownlist controls. I update the options in the second ddl based on selection made in the first. I do this with the ICallbackEventHandler interface, as per...
3
by: teo | last post by:
Mozilla error on postback and validation ----------- A Button causes a Listbox to desappear. If no item has been selected on the Listbox, all is OK. If one or more items are selected,
15
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
5
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
9
by: 200dogz | last post by:
Hi guys, I want to have a button which opens up a new window when pressed. <asp:Button ID="Button1" runat="server" Text="Open new window" /> ... Button1.Attributes.Add("OnClick",
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.