473,405 Members | 2,187 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,405 software developers and data experts.

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="text/html"
ResponseEncoding="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(sender 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="__SCROLLPOS" value="" />
<br>
<table border="0" width="650" style="border-collapse:collapse" >
<tr>
<td width="701">
<asp:RadioButton ID="ScreenTests" Text="Screening"
TextAlign="right" AutoPostBack="true"
OnCheckedChanged="GetScreenNames_Checked" GroupName="Positions"
runat="server" Checked="true" />
<asp:RadioButton ID="SkillsTests" Text="Skills" TextAlign="right"
AutoPostBack="true" OnCheckedChanged="GetScreenNames_Checked"
GroupName="Positions" 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:LinkButton ID="LinkJob" Text="Link Job"
OnClick="LinkJob_Click" runat="server" />
</td>
</tr>
</table>
</form>
</body>
</html>
************************************************** *****

Thanks,

Tom
Jan 16 '06 #1
2 1150
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="WebForm1.aspx.vb"
Inherits="WebApplication5.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:RadioButton id="ScreenTests" Text="Screening" TextAlign="right"
AutoPostBack="true" OnCheckedChanged="ScreenTests_CheckedChanged"
GroupName="Positions" runat="server"></asp:RadioButton>
<asp:RadioButton id="Skillstests" Text="Skills" TextAlign="right"
AutoPostBack="true" OnCheckedChanged="Skillstests_CheckedChanged"
GroupName="Positions" 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:LinkButton id="LinkButton1" Text="Link Job"
OnClick="Skillstests_CheckedChanged" runat="server" /></P>
</form>
</body>
</HTML>
************************************************** *********************

************************************************** **********************
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents ScreenTests As
System.Web.UI.WebControls.RadioButton
Protected WithEvents ListBox1 As System.Web.UI.WebControls.ListBox
Protected WithEvents LinkButton1 As System.Web.UI.WebControls.LinkButton
Protected WithEvents Skillstests As
System.Web.UI.WebControls.RadioButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

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
End Sub

Public Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click

End Sub

Public Sub ScreenTests_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ScreenTests.CheckedChanged

End Sub

Public Sub Skillstests_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Skillstests.CheckedChanged

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

Thanks,

Tom

"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP12.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="text/html"
ResponseEncoding="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(sender 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="__SCROLLPOS" value="" />
<br>
<table border="0" width="650" style="border-collapse:collapse" >
<tr>
<td width="701">
<asp:RadioButton ID="ScreenTests" Text="Screening"
TextAlign="right" AutoPostBack="true"
OnCheckedChanged="GetScreenNames_Checked" GroupName="Positions"
runat="server" Checked="true" />
<asp:RadioButton ID="SkillsTests" Text="Skills" TextAlign="right" AutoPostBack="true" OnCheckedChanged="GetScreenNames_Checked"
GroupName="Positions" 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:LinkButton ID="LinkJob" Text="Link Job"
OnClick="LinkJob_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****************@TK2MSFTNGP12.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="WebForm1.aspx.vb"
Inherits="WebApplication5.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>
<asp:RadioButton id="ScreenTests" Text="Screening"
TextAlign="right"
AutoPostBack="true" OnCheckedChanged="ScreenTests_CheckedChanged"
GroupName="Positions" runat="server"></asp:RadioButton>
<asp:RadioButton id="Skillstests" Text="Skills" TextAlign="right"
AutoPostBack="true" OnCheckedChanged="Skillstests_CheckedChanged"
GroupName="Positions" 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:LinkButton id="LinkButton1" Text="Link Job"
OnClick="Skillstests_CheckedChanged" runat="server" /></P>
</form>
</body>
</HTML>
************************************************** *********************

************************************************** **********************
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents ScreenTests As
System.Web.UI.WebControls.RadioButton
Protected WithEvents ListBox1 As System.Web.UI.WebControls.ListBox
Protected WithEvents LinkButton1 As
System.Web.UI.WebControls.LinkButton
Protected WithEvents Skillstests As
System.Web.UI.WebControls.RadioButton

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub

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
End Sub

Public Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click

End Sub

Public Sub ScreenTests_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ScreenTests.CheckedChanged

End Sub

Public Sub Skillstests_CheckedChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Skillstests.CheckedChanged

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

Thanks,

Tom

"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP12.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="text/html"
ResponseEncoding="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(sender 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="__SCROLLPOS" value="" />
<br>
<table border="0" width="650" style="border-collapse:collapse" >
<tr>
<td width="701">
<asp:RadioButton ID="ScreenTests" Text="Screening"
TextAlign="right" AutoPostBack="true"
OnCheckedChanged="GetScreenNames_Checked" GroupName="Positions"
runat="server" Checked="true" />
<asp:RadioButton ID="SkillsTests" Text="Skills"

TextAlign="right"
AutoPostBack="true" OnCheckedChanged="GetScreenNames_Checked"
GroupName="Positions" 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:LinkButton ID="LinkJob" Text="Link Job"
OnClick="LinkJob_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
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...
2
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
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...
5
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...
3
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...
3
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:...
1
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...
3
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....
0
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.