468,458 Members | 1,873 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,458 developers. It's quick & easy.

DropDownList SelectedIndexChanged not firing for extra <form>

I'm using .NET framework 1.1 and VS.NET 2003 for a aspx web form.

There is a DropDwonList on the page and its SelectedIndexChanged event is
fired to the server normally, until when I add another form "FormDummy" onto
the main form, and then the event no longer fires again when the user change
the value of the drop down list.

Can anybody help ? Thanks so much!

The aspx code is as follows:
(Every thing works fine is the form "FormDummy" is abscent !)

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="HKG.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.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<form id="FormDummy" method="post">
</form>

<form id="Form2" method="post">
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 168px;
POSITION: absolute; TOP: 64px"
runat="server" Width="160px" AutoPostBack="True">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
</asp:DropDownList>
</form>
</form>
</body>
</HTML>

Nov 18 '05 #1
4 4629
> There is a DropDownList on the page and its SelectedIndexChanged
event is fired to the server normally, until when I add another form
"FormDummy" onto the main form, and then the event no longer fires
again when the user change the value of the drop down list.


George,
An ASP.NET WebForm page can have only one server-side Form tag.
And if you want to catch server-side event(s) for a web control, then
place it within the one server-side Form tag.

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com
Nov 18 '05 #2


Yes there is only one server side form <Form1> on the page, and <FormDummy>
and <Form2> are just client side form tags without runat="server" attribute.
The behavior is that the drop down list under <Form2> (which is under
<Form1>) fires the SelectedIndexChangedEvent, but it does not fire when I add
<FormDummy> under <Form1>. <FormDummy> is in the same level as <Form2> and
just has nothing to do with the drop down list.

Many thanks.

Best Regards,
George

"Carl Prothman [MVP]" wrote:

George,
An ASP.NET WebForm page can have only one server-side Form tag.
And if you want to catch server-side event(s) for a web control, then
place it within the one server-side Form tag.

--

Nov 18 '05 #3

So what I mean is the event is still not fired if i have a dummy form
besides the form hosting my webcontrol.
Any ideas? Thx.
"Carl Prothman [MVP]" wrote:
There is a DropDownList on the page and its SelectedIndexChanged
event is fired to the server normally, until when I add another form
"FormDummy" onto the main form, and then the event no longer fires
again when the user change the value of the drop down list.


George,
An ASP.NET WebForm page can have only one server-side Form tag.
And if you want to catch server-side event(s) for a web control, then
place it within the one server-side Form tag.

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com

Nov 18 '05 #4
> I'm using .NET framework 1.1 and VS.NET 2003 for a aspx web form.

There is a DropDwonList on the page and its SelectedIndexChanged event is
fired to the server normally, until when I add another form "FormDummy" onto
the main form, and then the event no longer fires again when the user change
the value of the drop down list. <form id="Form1" method="post" runat="server">

<form id="FormDummy" method="post">
</form>


Nested forms aren't valid HTML anyway. Whatever you're trying to do, you're
going about it wrong.
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ricki Susic | last post: by
4 posts views Thread by Howard Jess | last post: by
10 posts views Thread by Phlip | last post: by
6 posts views Thread by snacktime | last post: by
19 posts views Thread by Coward 9 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.