473,385 Members | 1,655 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,385 software developers and data experts.

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 4798
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ricki Susic | last post by:
Hi, Can anyone tell me if it is possible to call a function from a html form, where the function is included in the same file as the form. <html> <body> <form method="post" action="what...
2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
4
by: Howard Jess | last post by:
In Opera 8.01 (Linux; Build 1204) and in Opera 7.54 (Windows XP; Build 3865), my form disappears from the HTML markup (below). To summarize: 1) In a <script> block in the <head> I create a form...
10
by: Phlip | last post by:
HTMListas: (Apologies for I can't Google for this - too many common words.) I have a <form> tag. It thinks I want a <p> break before and after the form. I don't. (My forms are sneaky and...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
19
by: Coward 9 | last post by:
HI, I saw in an example hello.aspx, there is a <form tagbeing used like <form runat="server> I search all html tag references and could NOT find "runat" attributes for <formtag. which...
10
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...

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.