473,320 Members | 1,861 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,320 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 1296

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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.