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

Submit form in ASP.net

Hello,

i have a form inserted in a multipage. This multipage has 6 panels.

When i finally submit the form a new record in the database is created but
the record is allways empty.

This is driving me crazy.

Please, if you can look to my file just send me an email to my email
address:

web001@27NOSPAMlamps

Just take the NOSPAM part.

Thanks,
Miguel


Nov 20 '05 #1
3 1906
Miguel Dias Moura wrote:
i have a form inserted in a multipage. This multipage has 6 panels.

When i finally submit the form a new record in the database is created but
the record is allways empty.

This is driving me crazy.

Please, if you can look to my file just send me an email to my email
address:

web001@27NOSPAMlamps

Just take the NOSPAM part.


Hi Miguel,

why don't you simply post the relevant code so that everyone is able to
find the error?

Cheers

Arne Janning
Nov 20 '05 #2
It's just that is so long. Well i just cuted mostly of the form parts and
posted just some of it as an example:

Hello,

I will post only the code of 2 input form items as it would be to big to
post all the form items.

here is the database code:

<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,c
ulture=neutral" %>
<MM:Insert
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING
_connBonsAlunos") %>'
CommandText='<%# "INSERT INTO explicador (BIAno, BIDia) VALUES (?, ?)" %>'
CreateDataSet="false"
Debug="true"
Expression='<%# Request.Form("MM_insert") = "dadosForm" %>'
runat="server" id="InsertFormValues"
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABA
SETYPE_connBonsAlunos") %>' manualmode="true"
<Parameters>
<Parameter Name="@BIAno" Value='<%#
IIf((Request.Form("panelSubscribe1:BIAno") <> Nothing),
Request.Form("panelSubscribe1:BIAno"), "") %>' Type="WChar" />
<Parameter Name="@BIDia" Value='<%#
IIf((Request.Form("panelSubscribe1:BIDia") <> Nothing),
Request.Form("panelSubscribe1:BIDia"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>

Script which controls the multipage:

<script runat="Server">

Sub Page_Load
If Not IsPostBack Then
ViewState( "CurrentPage" ) = 1
End If
End Sub

Sub btnNextPage_Click( s As Object, e As EventArgs )
Dim pnlPanel As Panel
Dim strPanelName AS String

' Hide Previous Panel
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = False

' Show Current Panel
ViewState( "CurrentPage" ) += 1
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = True
End Sub

Sub btnPrevPage_Click( s As Object, e As EventArgs )
Dim pnlPanel As Panel
Dim strPanelName AS String

' Hide Current Panel
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = False

' Show Previous Panel
ViewState( "CurrentPage" ) -= 1
strPanelName = "panelSubscribe" & ViewState( "CurrentPage" )
pnlPanel = FindControl( strPanelName )
pnlPanel.Visible = True
End Sub

Sub btnFinish_Click( sender As Object, e As System.EventArgs )
InsertFormValues.DoInit()
End Sub

</script>

Some of the form code:

<form runat='server' method='POST' name='dadosForm' class="tableForm"
id="dadosForm">
<asp:Panel ID="panelSubscribe1" Runat="Server">
<table>
<td><asp:TextBox ID="BIAno" runat="server" /></td>
</table>
<table>
<td><asp:TextBox ID="BIDia" runat="server" /></td>
</table>

..... there are 6 panels.

The last code line are:

</asp:Panel>
<input type="hidden" name="MM_insert" value="dadosForm">
</form>

As i said, a new record is inserted in the database but is empty. Have no
idea what else to do.

Thank You For Your Help,
Miguel

"Arne Janning" <sp*****************@msn.com> wrote in message
news:#X*************@tk2msftngp13.phx.gbl... Miguel Dias Moura wrote:
i have a form inserted in a multipage. This multipage has 6 panels.

When i finally submit the form a new record in the database is created but the record is allways empty.

This is driving me crazy.

Please, if you can look to my file just send me an email to my email
address:

web001@27NOSPAMlamps

Just take the NOSPAM part.


Hi Miguel,

why don't you simply post the relevant code so that everyone is able to
find the error?

Cheers

Arne Janning

Nov 20 '05 #3
Hi Miquel,

In addition to Arne,

I thought this problem have sand before, however when the question is, "why
is there a empty row created in the database", than we can maybe help you
with showing some code how you update that database, I could not find it in
what you sand.

I see an insert string, however nowhere a command or an adapter which take
some action with that string. (I hope I do not oversee it, however point us
than on that).

Cor
Nov 20 '05 #4

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

Similar topics

2
by: Matt | last post by:
Can form.submit() submit another form? In the following example, in page1.asp, it is fine to submit the current form: form1.submit(), and and I could see the value "Joe" in page2.asp. However, if I...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
8
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.