472,353 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Submit button not working on a method="get" form after DataBind

Hi,

I have found a odd one, my submit button is not submitting on a
method="get" form after using any form of DataBind?

Has anyone struck this problem before?

here is snipits of the code as an example

<form id="frmUserSearch" method="get" runat="server">
<asp:DropDownList ID="listBrokers"
Runat="server"
DataSource="<%# dvBrokers%>"
DataTextField="BrokerName"
DataValueField="BrokerID" />
<input type="submit" name="search" value="search">
</form>
private void Page_Load(object sender, System.EventArgs e)
{
Brokers brokers = Methods.GetBrokers(login);
dvBrokers = new DataView(brokers.Broker, "", "BrokerName",
DataViewRowState.CurrentRows);
//listBrokers.DataBind();<- including this is the problem
listBrokers.Items.Insert(0, new ListItem("", ""));
}

Nov 19 '05 #1
2 1906
You are circumventing .NET, so it is understandable once you understand how
..NET works.

When you add a server side button to a form, .NET writes out some JavaScript
to capture the form submit and send it to the proper event handler on your
form. If you switch to GET, you are potentially interfering with this
process. If you truly desire a GET, you will have to handle more of the
coding yourself.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"ma**********@hotmail.com" wrote:
Hi,

I have found a odd one, my submit button is not submitting on a
method="get" form after using any form of DataBind?

Has anyone struck this problem before?

here is snipits of the code as an example

<form id="frmUserSearch" method="get" runat="server">
<asp:DropDownList ID="listBrokers"
Runat="server"
DataSource="<%# dvBrokers%>"
DataTextField="BrokerName"
DataValueField="BrokerID" />
<input type="submit" name="search" value="search">
</form>
private void Page_Load(object sender, System.EventArgs e)
{
Brokers brokers = Methods.GetBrokers(login);
dvBrokers = new DataView(brokers.Broker, "", "BrokerName",
DataViewRowState.CurrentRows);
//listBrokers.DataBind();<- including this is the problem
listBrokers.Items.Insert(0, new ListItem("", ""));
}

Nov 19 '05 #2
Hmm, I've into it further, and DataBind seems to be a read herring. If
i limited the numbers of brokers to around 90 it worked! It appears it
is the length of the ViewState, so you are right in a way. Using GET,
it still tries to send the ViewState in the query string an the Browser
(IE) must refuse to submit when the Querystring is just too long.
Having
enableViewState="False" in the page declaration solved this. So it is
possible if you want to be bothered working with out viewstate.

Cowboy (Gregory A. Beamer) - MVP wrote:
You are circumventing .NET, so it is understandable once you understand how .NET works.

When you add a server side button to a form, .NET writes out some JavaScript to capture the form submit and send it to the proper event handler on your form. If you switch to GET, you are potentially interfering with this process. If you truly desire a GET, you will have to handle more of the coding yourself.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"ma**********@hotmail.com" wrote:
Hi,

I have found a odd one, my submit button is not submitting on a
method="get" form after using any form of DataBind?

Has anyone struck this problem before?

here is snipits of the code as an example

<form id="frmUserSearch" method="get" runat="server">
<asp:DropDownList ID="listBrokers"
Runat="server"
DataSource="<%# dvBrokers%>"
DataTextField="BrokerName"
DataValueField="BrokerID" />
<input type="submit" name="search" value="search">
</form>
private void Page_Load(object sender, System.EventArgs e)
{
Brokers brokers = Methods.GetBrokers(login);
dvBrokers = new DataView(brokers.Broker, "", "BrokerName",
DataViewRowState.CurrentRows);
//listBrokers.DataBind();<- including this is the problem
listBrokers.Items.Insert(0, new ListItem("", ""));
}


Nov 19 '05 #3

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

Similar topics

5
by: lsarg | last post by:
i've been trying forever to figure out a way to use a regular text link in place of a submit button at the bottom of this. can't get it. i'm just...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The...
1
by: Pete Mahoney | last post by:
Ok I use a textarea to store data input by the user, and then upon them clicking the submit button I store this data to a database. The problem is...
12
by: Me | last post by:
Hi, I would like learn from people with experience in C++, which of the following styles of way to construct "get/set" member functions would be the...
2
by: Alex | last post by:
Hello, I use the following script inside a page. My page contains : 1 FORM, Some Hidden fields, and one line of JAVASCRIPT in order to instantly...
3
by: Adam | last post by:
Hey guys, I've decided to stop banging my head against the wall and just ask you guys for the answer. I can't seem to find it. I have a form...
2
by: Tom S | last post by:
I'm using ASP.NET with C# as my code behind and I figure out how to get the above process to work. I've found many examples online for using the...
9
by: Alexandra | last post by:
Not sure why none of these permutations are working. I appreciate a second set of eyes! .... <form id="form1" name="form1" > .... <input...
1
by: Jim Carlock | last post by:
Let's not argue about semantics. Let's talk about semasiology. Do specifications exist for using mixed case, upper case, lower case for the...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.