473,543 Members | 3,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Button Programmaticall y REDUX - STILL NONFUNCTIONAL

Greetings.

I am in a very big pickle. I am trying to add page content - as well as
a submit button - programatically to a web form that is supposed to
submit to DB and then refresh.

That is, a user goes to the web page, which draws the current content
out of the db and inserts into a "preview" area as well as the form
itself. User makes changes, hits submit button. The page *should*
refresh, with the changes saved to the db, and the new content in the
preview area and in the form.

What happens is that the entire "content" section of the page vanishes.
Everything. Boom. Poof. Bye-bye. It's as if the sub that catches the
button action simply doesn't fire. And when I refresh the page, the
original content - not the changed content - comes back up, *proving*
that the database insert of the changed content FAILED TO FIRE.

Below is the code-behind that I am using:

Imports System
'Imports System.Configur ation
Imports System.Data
Imports System.Data.Ole Db
'Imports System.Drawing
'Imports System.Drawing. Imaging
'Imports System.IO
'Imports System.Web.Secu rity
Imports System.Web.UI
Imports System.Web.UI.W ebControls
Imports System.Web.UI.H TMLControls

Public Class TeamMetz
Inherits Page
Dim vbCrLf As String = Microsoft.Visua lBasic.vbCrLf
Dim strYear As String = DateTime.Now.Ye ar.ToString()
Dim strWarning As String = vbCrLf & " <p>Have you <a
href=""/rules.aspx"">re ad the rules</a> for adding content? Do you know
how to <a href=""/formatting.aspx "">properly format text</a>?</p>" & vbCrLf
Dim myForm As New HTMLForm
Dim myConn As New
OleDbConnection (System.Configu ration.Configur ationSettings.A ppSettings("str Conn"))

Protected Sub Page_Load(sende r As Object, e As EventArgs)
Dim strURL as String = Request.RawURL. ToString()
Dim strDO as String = Request.QuerySt ring("do")
Dim intID as Integer = Request.QuerySt ring("id")
Dim strP as String = Request.QuerySt ring("parent")
Dim strC as String = Request.QuerySt ring("child")
Dim strG as String = Request.QuerySt ring("gchild")
Dim intE as Integer = Request.QuerySt ring("entry")
Controls.Add(Ne w LiteralControl( " ... ")) 'sets up the opening
HTML, the meta tags and the page header.
If Not IsPostBack Then
Select Case strDo
Case "add"
Case "edit"
Case "delete"
Case "intro"
LoadIntro()
Case Else
Controls.Add(Ne w LiteralControl( " <h2>Welcome</h2>" & strWarning & "
<p>Please choose a task from the following list:</p>" & vbCrLf & " <ul>"
& vbCrLf & " <li><a href=""/default.aspx?do =add"">Add Data</a> to the
database</li>" & vbCrLf & " <li><a href=""/default.aspx?do =edit"">Edit
Data</a> in the database</li>" & vbCrLf & " <li><a
href=""/default.aspx?do =intro"">Edit Intro</a> on the front page</li>" &
vbCrLf & " </ul>"))
End Select
End If
Controls.Add(Ne w LiteralControl( " ... ")) 'sets up the page footer
and the closing HTML
End Sub

Sub LoadIntro()
Controls.Add(Ne w LiteralControl( " <h2>Edit Intro</h2>" & strWarning))
myForm.ID = "myForm"
Controls.Add(my Form)
Dim myCmd as New OleDbCommand("S ELECT [Comment] FROM [tblIntro]",
myConn)
myConn.Open()
myForm.Controls .Add(New LiteralControl( " <p>This is what is
currently in the Database:</p>" & vbCrLf & " <blockquote>" & vbCrLf & "
<p>" & FormatData(myCm d.ExecuteScalar ()) & "</p>" & vbCrLf & "
</blockquote>" & vbCrLf & " <p>Use the form below to edit the contents
of the database and submit the changes:</p>" & vbCrLf & " <div
class=""center" ">" & vbCrLf & " "))
Dim textarea As New TextBox
textarea.id = "IntroComme nt"
textarea.Text = myCmd.ExecuteSc alar()
textarea.Rows = "8"
textarea.Column s = "80"
textarea.TextMo de = TextBoxMode.Mul tiLine
textarea.Wrap = true
myForm.Controls .Add(textarea)
myForm.Controls .Add(New LiteralControl( "<br />" & vbCrLf & " "))
Dim submit As New Button
AddHandler submit.Click, AddressOf UpdateIntro
submit.id = "submit"
submit.Text = "Update Intro"
myForm.Controls .Add(submit)
myForm.Controls .Add(New LiteralControl( vbCrLf & " </div>" & vbCrLf))
myConn.Close()
End Sub
Sub UpdateIntro(sen der As Object, e As System.EventArg s)
Dim myCmd as New OleDbCommand("U PDATE tblIntro SET
[Comment]=@Comment", myConn)
myConn.Open()
myCmd.CommandTy pe = CommandType.Tex t
myCmd.Parameter s.Add("@Comment ", OleDbType.LongV arWChar).Value =
RepChar(Request .Form("IntroCom ment"))
myCmd.ExecuteNo nQuery()
myConn.Close()
LoadIntro()
End Sub

Function FormatDate(sIte m as Object) as String
Return String.Format(" <p class=""small"" >Posted: <i>{0:dddd, dd
MMMMM, yyyy}</i></p>", sItem)
End Function
Function FormatData(sIte m) as String
FormatData=sIte m.Replace(vbcrl f,"</p>" & vbCrLf & "
<p>").Replace ("","<b>").Replac e("","</b>").Replace( "","<i>").Replac e("","</i>").Replace(" </p>"
& vbCrLf & " <p>
  • </p>" & vbCrLf & " <p>[item]","</p>" & vbCrLf & "
    <ul>" & vbCrLf & " <li>").Replace( "</p>" & vbCrLf & "
    <p>[item]","</li>" & vbCrLf & " <li>").Replace( "</p>" & vbCrLf & "
    <p>
","</li>" & vbCrLf & " </ul>" & vbCrLf)
End Function
Function RepChar(sItem) as String
RepChar=sItem.R eplace("'","’ ").Replace( " & ", " &amp;
").Replace("<", "&lt;").Replace (">","&gt;")
End Function

End Class
As you can see, the *logical* progression of events is that the page is
loaded, the user clicks on "edit intro", the edit intro page comes up
(complete with preview area and pre-filled form). The user then makes
changes, and the button gets clicked.

The button *should* call UpdateIntro(), but it clearly does not, since
the DB never gets updated. WHY? WHY? WHY? Why does the DB not update???

The LoadIntro() clearly has the button referencing the UpdateIntro()
sub, but that sub fails to fire when the page gets submitted. It's like
that sub is completely ignored.

WHY?

TIA.
...Geshel
--
*************** *************** *************** *************** ***********
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
*************** *************** *************** *************** ***********
* “I contend that we are both atheists. I just believe in one fewer *
* god than you do. When you understand why you dismiss all the other *
* possible gods, you will understand why I dismiss yours.” *
* - Stephen F. Roberts *
*************** *************** *************** *************** ***********
* “Anyone who believes in Intelligent Design (“creationism ”) is just *
* as ignorant, irrational and ill-educated as someone who believes *
* that the world is a flat disc, that the Sun circles the Earth or *
* that there really is a tooth fairy. Darwinism has an overwhelming *
* foundation of evidence that can be tested and reproduced. *
* *
* “Intelligent Design, on the other hand, has no evidence at all;not *
* one single shred of testable proof. As such, Intelligent Design is *
* Religious Mythology, and has no right whatsoever to be in our *
* Science classrooms.” - 99.99+% of Scientists *
*************** *************** *************** *************** ***********
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.” Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
*************** *************** *************** *************** ***********
Mar 12 '06 #1
5 1513
Are you trying to insert a form within a form in ASP.NET? If so, it will
crash.
"Neo Geshel" <go****@geshel. org> wrote in message
news:HE1Rf.1374 11$H%4.1494@pd7 tw2no...
Greetings.

I am in a very big pickle. I am trying to add page content - as well as
a submit button - programatically to a web form that is supposed to
submit to DB and then refresh.

That is, a user goes to the web page, which draws the current content
out of the db and inserts into a "preview" area as well as the form
itself. User makes changes, hits submit button. The page *should*
refresh, with the changes saved to the db, and the new content in the
preview area and in the form.

What happens is that the entire "content" section of the page vanishes.
Everything. Boom. Poof. Bye-bye. It's as if the sub that catches the
button action simply doesn't fire. And when I refresh the page, the
original content - not the changed content - comes back up, *proving*
that the database insert of the changed content FAILED TO FIRE.

Below is the code-behind that I am using:

Imports System
'Imports System.Configur ation
Imports System.Data
Imports System.Data.Ole Db
'Imports System.Drawing
'Imports System.Drawing. Imaging
'Imports System.IO
'Imports System.Web.Secu rity
Imports System.Web.UI
Imports System.Web.UI.W ebControls
Imports System.Web.UI.H TMLControls

Public Class TeamMetz
Inherits Page
Dim vbCrLf As String = Microsoft.Visua lBasic.vbCrLf
Dim strYear As String = DateTime.Now.Ye ar.ToString()
Dim strWarning As String = vbCrLf & " <p>Have you <a
href=""/rules.aspx"">re ad the rules</a> for adding content? Do you know
how to <a href=""/formatting.aspx "">properly format text</a>?</p>" & vbCrLf
Dim myForm As New HTMLForm
Dim myConn As New
OleDbConnection (System.Configu ration.Configur ationSettings.A ppSettings("str Conn"))

Protected Sub Page_Load(sende r As Object, e As EventArgs)
Dim strURL as String = Request.RawURL. ToString()
Dim strDO as String = Request.QuerySt ring("do")
Dim intID as Integer = Request.QuerySt ring("id")
Dim strP as String = Request.QuerySt ring("parent")
Dim strC as String = Request.QuerySt ring("child")
Dim strG as String = Request.QuerySt ring("gchild")
Dim intE as Integer = Request.QuerySt ring("entry")
Controls.Add(Ne w LiteralControl( " ... ")) 'sets up the opening
HTML, the meta tags and the page header.
If Not IsPostBack Then
Select Case strDo
Case "add"
Case "edit"
Case "delete"
Case "intro"
LoadIntro()
Case Else
Controls.Add(Ne w LiteralControl( " <h2>Welcome</h2>" & strWarning & "
<p>Please choose a task from the following list:</p>" & vbCrLf & " <ul>"
& vbCrLf & " <li><a href=""/default.aspx?do =add"">Add Data</a> to the
database</li>" & vbCrLf & " <li><a href=""/default.aspx?do =edit"">Edit
Data</a> in the database</li>" & vbCrLf & " <li><a
href=""/default.aspx?do =intro"">Edit Intro</a> on the front page</li>" &
vbCrLf & " </ul>"))
End Select
End If
Controls.Add(Ne w LiteralControl( " ... ")) 'sets up the page footer
and the closing HTML
End Sub

Sub LoadIntro()
Controls.Add(Ne w LiteralControl( " <h2>Edit Intro</h2>" & strWarning))
myForm.ID = "myForm"
Controls.Add(my Form)
Dim myCmd as New OleDbCommand("S ELECT [Comment] FROM [tblIntro]",
myConn)
myConn.Open()
myForm.Controls .Add(New LiteralControl( " <p>This is what is
currently in the Database:</p>" & vbCrLf & " <blockquote>" & vbCrLf & "
<p>" & FormatData(myCm d.ExecuteScalar ()) & "</p>" & vbCrLf & "
</blockquote>" & vbCrLf & " <p>Use the form below to edit the contents
of the database and submit the changes:</p>" & vbCrLf & " <div
class=""center" ">" & vbCrLf & " "))
Dim textarea As New TextBox
textarea.id = "IntroComme nt"
textarea.Text = myCmd.ExecuteSc alar()
textarea.Rows = "8"
textarea.Column s = "80"
textarea.TextMo de = TextBoxMode.Mul tiLine
textarea.Wrap = true
myForm.Controls .Add(textarea)
myForm.Controls .Add(New LiteralControl( "<br />" & vbCrLf & " "))
Dim submit As New Button
AddHandler submit.Click, AddressOf UpdateIntro
submit.id = "submit"
submit.Text = "Update Intro"
myForm.Controls .Add(submit)
myForm.Controls .Add(New LiteralControl( vbCrLf & " </div>" & vbCrLf))
myConn.Close()
End Sub
Sub UpdateIntro(sen der As Object, e As System.EventArg s)
Dim myCmd as New OleDbCommand("U PDATE tblIntro SET
[Comment]=@Comment", myConn)
myConn.Open()
myCmd.CommandTy pe = CommandType.Tex t
myCmd.Parameter s.Add("@Comment ", OleDbType.LongV arWChar).Value =
RepChar(Request .Form("IntroCom ment"))
myCmd.ExecuteNo nQuery()
myConn.Close()
LoadIntro()
End Sub

Function FormatDate(sIte m as Object) as String
Return String.Format(" <p class=""small"" >Posted: <i>{0:dddd, dd
MMMMM, yyyy}</i></p>", sItem)
End Function
Function FormatData(sIte m) as String
FormatData=sIte m.Replace(vbcrl f,"</p>" & vbCrLf & "
<p>").Replace ("","<b>").Replac e("","</b>").Replace( "","<i>").Replac e("","</i>").Replace(" </p>"
& vbCrLf & " <p>
  • </p>" & vbCrLf & " <p>[item]","</p>" & vbCrLf & "
    <ul>" & vbCrLf & " <li>").Replace( "</p>" & vbCrLf & "
    <p>[item]","</li>" & vbCrLf & " <li>").Replace( "</p>" & vbCrLf & "
    <p>
","</li>" & vbCrLf & " </ul>" & vbCrLf)
End Function
Function RepChar(sItem) as String
RepChar=sItem.R eplace("'","'") .Replace(" & ", " &amp;
").Replace("<", "&lt;").Replace (">","&gt;")
End Function

End Class
As you can see, the *logical* progression of events is that the page is
loaded, the user clicks on "edit intro", the edit intro page comes up
(complete with preview area and pre-filled form). The user then makes
changes, and the button gets clicked.

The button *should* call UpdateIntro(), but it clearly does not, since
the DB never gets updated. WHY? WHY? WHY? Why does the DB not update???

The LoadIntro() clearly has the button referencing the UpdateIntro()
sub, but that sub fails to fire when the page gets submitted. It's like
that sub is completely ignored.

WHY?

TIA.
....Geshel
--
*************** *************** *************** *************** ***********
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
*************** *************** *************** *************** ***********
* "I contend that we are both atheists. I just believe in one fewer *
* god than you do. When you understand why you dismiss all the other *
* possible gods, you will understand why I dismiss yours." *
* - Stephen F. Roberts *
*************** *************** *************** *************** ***********
* "Anyone who believes in Intelligent Design ("creationis m") is just *
* as ignorant, irrational and ill-educated as someone who believes *
* that the world is a flat disc, that the Sun circles the Earth or *
* that there really is a tooth fairy. Darwinism has an overwhelming *
* foundation of evidence that can be tested and reproduced. *
* *
* "Intelligen t Design, on the other hand, has no evidence at all; not *
* one single shred of testable proof. As such, Intelligent Design is *
* Religious Mythology, and has no right whatsoever to be in our *
* Science classrooms." - 99.99+% of Scientists *
*************** *************** *************** *************** ***********
Mignon McLaughlin once said that "A nymphomaniac is a woman [who is] as
obsessed with sex as the average man." Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
*************** *************** *************** *************** ***********
Mar 12 '06 #2
Ken Cox - Microsoft MVP wrote:
Are you trying to insert a form within a form in ASP.NET? If so, it will
crash.


Ummm.... no. Didn't you read what I wrote?

On the first viewing of the page (If Not IsPostBack Then), when
do=intro, the sub LoadIntro() is called. This extracts data from the
database, and puts it into a preview section, as well as directly into a
form for editing.

When the contents of the form are edited and submitted, the sub
UpdateIntro() is *supposed* to fire. It is *supposed* to take the form
contents, and submit them to the database, before calling the sub
LoadIntro().

The problem is, the submit button of the form FAILS TO CALL THE
UPDATEINTRO() SUB, and so THE DATABASE INSERT FAILS TO OCCUR, and the
reloading of the preview/filled form also fails to occur.

BTW, the only contents of my main page is the page attribute. I am
dynamically loading all of the page contents (<html>, <title></title>,
<page>, </page>, </html>, etc.) from the code-behind. I intend to
compile the results once I get it working.

TIA.
...Geshel
--
*************** *************** *************** *************** ***********
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
*************** *************** *************** *************** ***********
* “I contend that we are both atheists. I just believe in one fewer *
* god than you do. When you understand why you dismiss all the other *
* possible gods, you will understand why I dismiss yours.” *
* - Stephen F. Roberts *
*************** *************** *************** *************** ***********
* “Anyone who believes in Intelligent Design (“creationism ”) is just *
* as ignorant, irrational and ill-educated as someone who believes *
* that the world is a flat disc, that the Sun circles the Earth or *
* that there really is a tooth fairy. Darwinism has an overwhelming *
* foundation of evidence that can be tested and reproduced. *
* *
* “Intelligent Design, on the other hand, has no evidence at all;not *
* one single shred of testable proof. As such, Intelligent Design is *
* Religious Mythology, and has no right whatsoever to be in our *
* Science classrooms.” - 99.99+% of Scientists *
*************** *************** *************** *************** ***********
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.” Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
*************** *************** *************** *************** ***********
Mar 13 '06 #3
Neo Geshel wrote:
Ken Cox - Microsoft MVP wrote:
Are you trying to insert a form within a form in ASP.NET? If so, it
will crash.


Ummm.... no. Didn't you read what I wrote?

On the first viewing of the page (If Not IsPostBack Then), when
do=intro, the sub LoadIntro() is called. This extracts data from the
database, and puts it into a preview section, as well as directly into a
form for editing.

When the contents of the form are edited and submitted, the sub
UpdateIntro() is *supposed* to fire. It is *supposed* to take the form
contents, and submit them to the database, before calling the sub
LoadIntro().

The problem is, the submit button of the form FAILS TO CALL THE
UPDATEINTRO() SUB, and so THE DATABASE INSERT FAILS TO OCCUR, and the
reloading of the preview/filled form also fails to occur.

BTW, the only contents of my main page is the page attribute. I am
dynamically loading all of the page contents (<html>, <title></title>,
<page>, </page>, </html>, etc.) from the code-behind. I intend to
compile the results once I get it working.

TIA.
...Geshel


As an addendum, here is how the HTML ends up in the browser's source
preview window:

<h2>Edit Intro</h2>
<p>Have you <a href="/rules.aspx">rea d the rules</a> for adding
content? Do you know how to <a href="/formatting.aspx ">properly format
text</a>?</p>
<form name="myForm" method="post" action="default .aspx?do=intro"
id="myForm">
<input type="hidden" name="__VIEWSTA TE"
value="dDw1Mzgx Ozs+m5H4fRpTaPk fBKkPgV/0vEOzo+4=" />
<p>This is what is currently in the Database:</p>
<blockquote>
<p> ... Contents of Intro, with proper formatting ...</p>
</blockquote>
<p>Use the form below to edit the contents of the database and submit
the changes:</p>
<div class="center">
<textarea name="IntroComm ent" rows="8" cols="80" id="IntroCommen t">
... Contents of Intro, withOUT proper formatting ... </textarea><br />

<input type="submit" name="submit" value="Update Intro" id="submit" />
</div>
</form>

This is what *should* be coming up *every time* for that page, even
*after* clicking on the submit button. What I have noticed is that the
textarea and the submit button don't have their usual viewstate-munged
Id's. Their ID's are plain, as if viewstate was turned off.

...Geshel
--
*************** *************** *************** *************** ***********
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
*************** *************** *************** *************** ***********
* “I contend that we are both atheists. I just believe in one fewer *
* god than you do. When you understand why you dismiss all the other *
* possible gods, you will understand why I dismiss yours.” *
* - Stephen F. Roberts *
*************** *************** *************** *************** ***********
* “Anyone who believes in Intelligent Design (“creationism ”) is just *
* as ignorant, irrational and ill-educated as someone who believes *
* that the world is a flat disc, that the Sun circles the Earth or *
* that there really is a tooth fairy. Darwinism has an overwhelming *
* foundation of evidence that can be tested and reproduced. *
* *
* “Intelligent Design, on the other hand, has no evidence at all;not *
* one single shred of testable proof. As such, Intelligent Design is *
* Religious Mythology, and has no right whatsoever to be in our *
* Science classrooms.” - 99.99+% of Scientists *
*************** *************** *************** *************** ***********
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.” Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
*************** *************** *************** *************** ***********
Mar 13 '06 #4
Well the error I got with your codes was

Exception Details: System.Web.Http Exception: A page can have only one
server-side Form tag.
"Neo Geshel" <go****@geshel. org> wrote in message
news:Ku2Rf.1374 63$H%4.111154@p d7tw2no...
Ken Cox - Microsoft MVP wrote:
Are you trying to insert a form within a form in ASP.NET? If so, it will
crash.


Ummm.... no. Didn't you read what I wrote?

On the first viewing of the page (If Not IsPostBack Then), when
do=intro, the sub LoadIntro() is called. This extracts data from the
database, and puts it into a preview section, as well as directly into a
form for editing.

When the contents of the form are edited and submitted, the sub
UpdateIntro() is *supposed* to fire. It is *supposed* to take the form
contents, and submit them to the database, before calling the sub
LoadIntro().

The problem is, the submit button of the form FAILS TO CALL THE
UPDATEINTRO() SUB, and so THE DATABASE INSERT FAILS TO OCCUR, and the
reloading of the preview/filled form also fails to occur.

BTW, the only contents of my main page is the page attribute. I am
dynamically loading all of the page contents (<html>, <title></title>,
<page>, </page>, </html>, etc.) from the code-behind. I intend to
compile the results once I get it working.

TIA.
....Geshel
--
*************** *************** *************** *************** ***********
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
*************** *************** *************** *************** ***********
* "I contend that we are both atheists. I just believe in one fewer *
* god than you do. When you understand why you dismiss all the other *
* possible gods, you will understand why I dismiss yours." *
* - Stephen F. Roberts *
*************** *************** *************** *************** ***********
* "Anyone who believes in Intelligent Design ("creationis m") is just *
* as ignorant, irrational and ill-educated as someone who believes *
* that the world is a flat disc, that the Sun circles the Earth or *
* that there really is a tooth fairy. Darwinism has an overwhelming *
* foundation of evidence that can be tested and reproduced. *
* *
* "Intelligen t Design, on the other hand, has no evidence at all; not *
* one single shred of testable proof. As such, Intelligent Design is *
* Religious Mythology, and has no right whatsoever to be in our *
* Science classrooms." - 99.99+% of Scientists *
*************** *************** *************** *************** ***********
Mignon McLaughlin once said that "A nymphomaniac is a woman [who is] as
obsessed with sex as the average man." Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
*************** *************** *************** *************** ***********
Mar 13 '06 #5
Ken Cox - Microsoft MVP wrote:
Well the error I got with your codes was

Exception Details: System.Web.Http Exception: A page can have only one
server-side Form tag.


Well, there is only one instance of a FORM tag that was dynamically
created, as you can see from the code-behind. Where was your second FORM
tag coming from??

Remember, the only thing on the ASPX page was the @page directive.
Nothing else.

...Geshel
--
*************** *************** *************** *************** ***********
* My reply-to is an automatically monitored spam honeypot. Do not use *
* it unless you want to be blacklisted by SpamCop. Please reply to my *
* first name at my last name dot org. *
*************** *************** *************** *************** ***********
* “I contend that we are both atheists. I just believe in one fewer *
* god than you do. When you understand why you dismiss all the other *
* possible gods, you will understand why I dismiss yours.” *
* - Stephen F. Roberts *
*************** *************** *************** *************** ***********
* “Anyone who believes in Intelligent Design (“creationism ”) is just *
* as ignorant, irrational and ill-educated as someone who believes *
* that the world is a flat disc, that the Sun circles the Earth or *
* that there really is a tooth fairy. Darwinism has an overwhelming *
* foundation of evidence that can be tested and reproduced. *
* *
* “Intelligent Design, on the other hand, has no evidence at all;not *
* one single shred of testable proof. As such, Intelligent Design is *
* Religious Mythology, and has no right whatsoever to be in our *
* Science classrooms.” - 99.99+% of Scientists *
*************** *************** *************** *************** ***********
Mignon McLaughlin once said that “A nymphomaniac is a woman [who is] as
obsessed with sex as the average man.” Unfortunately, since true
nymphomaniacs are so rare, this means that it takes an extraordinary
woman to keep up with an ordinary man.
*************** *************** *************** *************** ***********
Mar 13 '06 #6

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

Similar topics

12
1881
by: Silvia | last post by:
Hi I have a form and I add buttons programmatically in de form_Load function Anybody know how implements de function button_click if in the designer mode the button doesn't exists Another question In a datagrid control is posible programmatically do autosize columns
5
6785
by: Carlo Marchesoni | last post by:
From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a button's event in A.aspx to be fired. I guess the only way is using javascript - does anybody have a sample for this ? Thanks
3
4858
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
3
10358
by: Silvia | last post by:
Hi, I have a form and I add buttons programmatically in de form_Load function. Anybody know how implements de function button_click if in the designer mode the button doesn't exists? I write in visual basic .net: mybutton.Click = New EventHandler (AddressOf DetectedAClick)
5
2081
by: Mike Dee | last post by:
Is it possible to dynamically create a new form object (form1), then create a new form field object and add it form1, and then add form1 to the current document? I need to do all this in script rather than using the html <form> and related tags. Can this be done to support both IE, Firefox? Any code snippets or samples showing how to do...
5
957
by: Neo Geshel | last post by:
Greetings. I am in a very big pickle. I am trying to add page content - as well as a submit button - programatically to a web form that is supposed to submit to DB and then refresh. That is, a user goes to the web page, which draws the current content out of the db and inserts into a "preview" area as well as the form itself. User...
9
2755
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT IS IMPOSSIBLE TO PROGRAMMATICALLY ADD A BUTTON TO A DYNAMICALLY CREATED PAGE. Or, to be more precise, why it is impossible to have an onClick sub ...
0
1214
by: mark.norgate | last post by:
Righto, a problem with programmatically created controls. Well, in that kind of area anyway. I'm creating and adding controls to my page using TemplateControl.LoadControl quite successfully, but I have a button on my page that adds another control (it's a row of a table in a timesheet application). Trouble is, of course,...
2
15048
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am...
0
7402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7347
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7733
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7344
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7684
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
963
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
633
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.