473,793 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with Postback

I have a page that has been displaying some weird behavior.

I have 2 radio buttons that work fine until I press the link button with an
item selected in my link box (if an item is not selected, there is no
problem).

This makes no sense. I am not doing anything with the item in the listbox.
It just has to be selected.

What happens is that once this starts happening, the radio buttons WILL NOT
stay selected. So the page quits working.

If I don't select either of the items in the listbox, I can press the
Linkbutton all day and the radio buttons will work. But once I select it,
the radio buttons will never work again.

What is wrong here?

Is this a bug in Asp? There is no Database access here, so that is not the
problem.

I can't figure this out nor can anyone I work with.

I have stripped out everything that is not related to the problem.

Anyone have an idea as to what is causing this problem???

*************** *************** *************** *********
<%@ Page Language="VB" trace="false" debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script runat="server">
Sub Page_Load(sende r as Object, e as EventArgs)
End Sub

Sub GetScreenNames_ Checked(s as Object, e as EventArgs)
End Sub

Sub LinkJob_Click(s as Object,e as EventArgs)
End Sub

</script>
</head>

<body id="myBody" runat="server">
<form id="Form1" runat="server">
<input type="hidden" name="__SCROLLP OS" value="" />
<br>
<table border="0" width="650" style="border-collapse:collap se" >
<tr>
<td width="701">
<asp:RadioButto n ID="ScreenTests " Text="Screening "
TextAlign="righ t" AutoPostBack="t rue"
OnCheckedChange d="GetScreenNam es_Checked" GroupName="Posi tions"
runat="server" Checked="true" />
<asp:RadioButto n ID="SkillsTests " Text="Skills" TextAlign="righ t"
AutoPostBack="t rue" OnCheckedChange d="GetScreenNam es_Checked"
GroupName="Posi tions" runat="server" /> </td>
</tr>
<tr>
<td ><asp:ListBox ID="Positions" SelectionMode=" multiple" Rows="8"
Width="600" runat="server">
<asp:ListItem Value="1">This is Line 1</asp:ListItem>
<asp:ListItem Value="2">This is Line 2</asp:ListItem>
</asp:ListBox>
</td>
</tr>
<tr>
<td >
<asp:LinkButt on ID="LinkJob" Text="Link Job"
OnClick="LinkJo b_Click" runat="server" />
</td>
</tr>
</table>
</form>
</body>
</html>
*************** *************** *************** **********

Thanks,

Tom
Jan 16 '06 #1
2 1171
I tried to do the exact same thing using vs.net (2003) and it works fine.

What is the difference? The code is straight forward and is doing nothing
in the events - just returning:

Here are the 2 vs.net files:

*************** *************** *************** *************** ***********
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb"
Inherits="WebAp plication5.WebF orm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1 </title>
<meta name="GENERATOR " content="Micros oft Visual Studio.NET 7.0">
<meta name="CODE_LANG UAGE" content="Visual Basic 7.0">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:RadioButto n id="ScreenTests " Text="Screening " TextAlign="righ t"
AutoPostBack="t rue" OnCheckedChange d="ScreenTests_ CheckedChanged"
GroupName="Posi tions" runat="server"> </asp:RadioButton >
<asp:RadioButto n id="Skillstests " Text="Skills" TextAlign="righ t"
AutoPostBack="t rue" OnCheckedChange d="Skillstests_ CheckedChanged"
GroupName="Posi tions" runat="server"> </asp:RadioButton ></P>
<P>
<asp:ListBox id="ListBox1" runat="server">
<asp:ListItem Value="1">This is Line 1</asp:ListItem>
<asp:ListItem Value="2">This is Line 2</asp:ListItem>
</asp:ListBox></P>
<P>
<asp:LinkButt on id="LinkButton1 " Text="Link Job"
OnClick="Skills tests_CheckedCh anged" runat="server" /></P>
</form>
</body>
</HTML>
*************** *************** *************** *************** ***********

*************** *************** *************** *************** ************
Public Class WebForm1
Inherits System.Web.UI.P age
Protected WithEvents ScreenTests As
System.Web.UI.W ebControls.Radi oButton
Protected WithEvents ListBox1 As System.Web.UI.W ebControls.List Box
Protected WithEvents LinkButton1 As System.Web.UI.W ebControls.Link Button
Protected WithEvents Skillstests As
System.Web.UI.W ebControls.Radi oButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Public Sub LinkButton1_Cli ck(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles LinkButton1.Cli ck

End Sub

Public Sub ScreenTests_Che ckedChanged(ByV al sender As System.Object,
ByVal e As System.EventArg s) Handles ScreenTests.Che ckedChanged

End Sub

Public Sub Skillstests_Che ckedChanged(ByV al sender As System.Object,
ByVal e As System.EventArg s) Handles Skillstests.Che ckedChanged

End Sub
End Class
*************** *************** *************** *************** ************

Thanks,

Tom

"tshad" <tf*@dslextreme .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I have a page that has been displaying some weird behavior.

I have 2 radio buttons that work fine until I press the link button with an item selected in my link box (if an item is not selected, there is no
problem).

This makes no sense. I am not doing anything with the item in the listbox. It just has to be selected.

What happens is that once this starts happening, the radio buttons WILL NOT stay selected. So the page quits working.

If I don't select either of the items in the listbox, I can press the
Linkbutton all day and the radio buttons will work. But once I select it,
the radio buttons will never work again.

What is wrong here?

Is this a bug in Asp? There is no Database access here, so that is not the problem.

I can't figure this out nor can anyone I work with.

I have stripped out everything that is not related to the problem.

Anyone have an idea as to what is causing this problem???

*************** *************** *************** *********
<%@ Page Language="VB" trace="false" debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script runat="server">
Sub Page_Load(sende r as Object, e as EventArgs)
End Sub

Sub GetScreenNames_ Checked(s as Object, e as EventArgs)
End Sub

Sub LinkJob_Click(s as Object,e as EventArgs)
End Sub

</script>
</head>

<body id="myBody" runat="server">
<form id="Form1" runat="server">
<input type="hidden" name="__SCROLLP OS" value="" />
<br>
<table border="0" width="650" style="border-collapse:collap se" >
<tr>
<td width="701">
<asp:RadioButto n ID="ScreenTests " Text="Screening "
TextAlign="righ t" AutoPostBack="t rue"
OnCheckedChange d="GetScreenNam es_Checked" GroupName="Posi tions"
runat="server" Checked="true" />
<asp:RadioButto n ID="SkillsTests " Text="Skills" TextAlign="righ t" AutoPostBack="t rue" OnCheckedChange d="GetScreenNam es_Checked"
GroupName="Posi tions" runat="server" /> </td>
</tr>
<tr>
<td ><asp:ListBox ID="Positions" SelectionMode=" multiple" Rows="8"
Width="600" runat="server">
<asp:ListItem Value="1">This is Line 1</asp:ListItem>
<asp:ListItem Value="2">This is Line 2</asp:ListItem>
</asp:ListBox>
</td>
</tr>
<tr>
<td >
<asp:LinkButt on ID="LinkJob" Text="Link Job"
OnClick="LinkJo b_Click" runat="server" />
</td>
</tr>
</table>
</form>
</body>
</html>
*************** *************** *************** **********

Thanks,

Tom

Jan 16 '06 #2
I rewrote the program in VS 2003 and found that the radio buttons would
work, but now the listbox doesn't work correctly.

I select an item in the listbox and press the link button, which just tells
me which line is selected. It gives me back a -1 (no line selected) and
clears the line. The next time I select a line it works fine. I can select
all the lines I want and each time I hit the link button it sees the line
file.

Only the first time, does it have a problem.

Is there some sort of initialization problem that I am having?

Thanks,

Tom

"tshad" <tf*@dslextreme .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I tried to do the exact same thing using vs.net (2003) and it works fine.

What is the difference? The code is straight forward and is doing nothing
in the events - just returning:

Here are the 2 vs.net files:

*************** *************** *************** *************** ***********
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Web Form1.aspx.vb"
Inherits="WebAp plication5.WebF orm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1 </title>
<meta name="GENERATOR " content="Micros oft Visual Studio.NET 7.0">
<meta name="CODE_LANG UAGE" content="Visual Basic 7.0">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:RadioButto n id="ScreenTests " Text="Screening "
TextAlign="righ t"
AutoPostBack="t rue" OnCheckedChange d="ScreenTests_ CheckedChanged"
GroupName="Posi tions" runat="server"> </asp:RadioButton >
<asp:RadioButto n id="Skillstests " Text="Skills" TextAlign="righ t"
AutoPostBack="t rue" OnCheckedChange d="Skillstests_ CheckedChanged"
GroupName="Posi tions" runat="server"> </asp:RadioButton ></P>
<P>
<asp:ListBox id="ListBox1" runat="server">
<asp:ListItem Value="1">This is Line 1</asp:ListItem>
<asp:ListItem Value="2">This is Line 2</asp:ListItem>
</asp:ListBox></P>
<P>
<asp:LinkButt on id="LinkButton1 " Text="Link Job"
OnClick="Skills tests_CheckedCh anged" runat="server" /></P>
</form>
</body>
</HTML>
*************** *************** *************** *************** ***********

*************** *************** *************** *************** ************
Public Class WebForm1
Inherits System.Web.UI.P age
Protected WithEvents ScreenTests As
System.Web.UI.W ebControls.Radi oButton
Protected WithEvents ListBox1 As System.Web.UI.W ebControls.List Box
Protected WithEvents LinkButton1 As
System.Web.UI.W ebControls.Link Button
Protected WithEvents Skillstests As
System.Web.UI.W ebControls.Radi oButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Public Sub LinkButton1_Cli ck(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles LinkButton1.Cli ck

End Sub

Public Sub ScreenTests_Che ckedChanged(ByV al sender As System.Object,
ByVal e As System.EventArg s) Handles ScreenTests.Che ckedChanged

End Sub

Public Sub Skillstests_Che ckedChanged(ByV al sender As System.Object,
ByVal e As System.EventArg s) Handles Skillstests.Che ckedChanged

End Sub
End Class
*************** *************** *************** *************** ************

Thanks,

Tom

"tshad" <tf*@dslextreme .com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I have a page that has been displaying some weird behavior.

I have 2 radio buttons that work fine until I press the link button with

an
item selected in my link box (if an item is not selected, there is no
problem).

This makes no sense. I am not doing anything with the item in the

listbox.
It just has to be selected.

What happens is that once this starts happening, the radio buttons WILL

NOT
stay selected. So the page quits working.

If I don't select either of the items in the listbox, I can press the
Linkbutton all day and the radio buttons will work. But once I select
it,
the radio buttons will never work again.

What is wrong here?

Is this a bug in Asp? There is no Database access here, so that is not

the
problem.

I can't figure this out nor can anyone I work with.

I have stripped out everything that is not related to the problem.

Anyone have an idea as to what is causing this problem???

*************** *************** *************** *********
<%@ Page Language="VB" trace="false" debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script runat="server">
Sub Page_Load(sende r as Object, e as EventArgs)
End Sub

Sub GetScreenNames_ Checked(s as Object, e as EventArgs)
End Sub

Sub LinkJob_Click(s as Object,e as EventArgs)
End Sub

</script>
</head>

<body id="myBody" runat="server">
<form id="Form1" runat="server">
<input type="hidden" name="__SCROLLP OS" value="" />
<br>
<table border="0" width="650" style="border-collapse:collap se" >
<tr>
<td width="701">
<asp:RadioButto n ID="ScreenTests " Text="Screening "
TextAlign="righ t" AutoPostBack="t rue"
OnCheckedChange d="GetScreenNam es_Checked" GroupName="Posi tions"
runat="server" Checked="true" />
<asp:RadioButto n ID="SkillsTests " Text="Skills"

TextAlign="righ t"
AutoPostBack="t rue" OnCheckedChange d="GetScreenNam es_Checked"
GroupName="Posi tions" runat="server" /> </td>
</tr>
<tr>
<td ><asp:ListBox ID="Positions" SelectionMode=" multiple"
Rows="8"
Width="600" runat="server">
<asp:ListItem Value="1">This is Line 1</asp:ListItem>
<asp:ListItem Value="2">This is Line 2</asp:ListItem>
</asp:ListBox>
</td>
</tr>
<tr>
<td >
<asp:LinkButt on ID="LinkJob" Text="Link Job"
OnClick="LinkJo b_Click" runat="server" />
</td>
</tr>
</table>
</form>
</body>
</html>
*************** *************** *************** **********

Thanks,

Tom


Jan 16 '06 #3

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

Similar topics

1
1638
by: john | last post by:
I have two different problems: 1. When the user has clicked on a button that is causing the browser to post back to the server, it could take a little while for the new page to show up. So in the mean time, I want to change the cursor to an hourglass and disable all of the controls on the form using javascript so the user can't do anything with any of the controls on the page. But when I disable certain controls (e.g. text boxes, radio...
2
1358
by: BluDog | last post by:
Hi I have a created a custom web control called ImageBrowser, extract is below: <Code> #Region "Properties" Public Property Images() As ImageCollection
1
4320
by: Steve Loper | last post by:
I am developing a control in ASP.NET 2.0 that is derived from GridView. This control handles paging on its own and thus renders custom paging buttons. It also add some other functionality to the GridView by overriding Render() and rendering other controls alongside the GridView’s HTML. When I click one of the pager buttons (of type ImageButton), I receive the following error: Invalid postback or callback argument. Event validation...
5
1540
by: WesIdell | last post by:
Hi All: I need some advice regarding a problem that I'm experiencing. I'm using a group of TextBox controls in the .aspx page and am using a function in the .cs code to perform some actions with the values. The problem is that when I try to retrieve the Text property, it is always equal to "" (an empty string) even though that a value is keyed in. I'm trying to do the same function with CheckBoxes and an array as well. Here's my code......
3
4915
by: dpomt | last post by:
I am facing some issues with the webforms DefaultButton functionality: #1 One text box ==> hitting enter works in IE but not in Firefox (1.5) #2 One text box and req. field validator ==> problem in IE #3 two text boxes ==> not even a postbak in Firefox. The three problems I have could be simply reproduced creating a new webform and pasting the code below in the codebehind file. TextBox bx1;
3
1860
by: moshi | last post by:
Hey, I'm working with asp.net 2.0. I make objects (like ddl, textbox...) disabled=true in client side. Then, when I get to the server in post action, these objects lose their value. For example: ddl comes back after postback with the first values in it's list - it doesn't keep the new value that the user chooses, and textbox - still remains it's last value, like the user didn't alter it. What I'm trying to say is that making object on...
1
1373
by: Jason | last post by:
I have a webpage that I've wrapped in an Atlas UpdatePanel. This page contains four textboxes, each with AutoPostBack set to true. The problem comes when someone edits the first box and tabs to the second box. They have enough time to make a quick edit to the second box before the postback completes and then the value in the second textbox is reset to the original value. Is there anything I can do about this? It's really causing...
3
3591
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I have an ASP.NET 2.0 application that allows content search. Search is included in all pages and a cross postback to the search results page is performed with the text inserted by the user. The search results also allows refining the search and a search button that performs a postback triggers the search. Many of the web pages in the web site have an OutputCache directive and the search results page does not. When I run the first...
0
1403
by: rn5a | last post by:
I have 2 ListBoxes which get populated with records from a database. The Form has a Button as well. Note that users can select multiple items in both the ListBoxes. When a user selects items from the 1st ListBox & clicks the Button, the selected items get deleted from the 1st ListBox & get appended to the 2nd ListBox at the very end. I also want that the items that have just got appended to the 2nd ListBox should also get selected. In...
3
1404
by: yovalk | last post by:
Hello, I have the following problem, I think it is rather simple, but hard to describe: I created a simple user control which contains a check box and an image - CheckBoxImage. Then I createa a control which contains and visually arranges CheckBoxImage controls in a table dynamically (it can contain diffrent numbers of ImageCheckBox)- CheckBoxImageContainer. The CheckBoxImage are added to the container dynamically. The problem is this:...
0
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9035
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.