Hello everyone,
I receive the error in the subject when viewing this page, I can get it to work fine without the master page and only the textboxes, but that causes an error with line 11, even when the page contents do process to the form.
I don`t understand the error and I would appreciate any guidance on this.
Thanks for reading.
1 <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %> 2 3 <script runat="server"> 4 5 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) 6 Dim Dbconnection, sqlcommand, dbcommunication, dbread 7 Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb")) 8 Dbconnection.Open() 9 sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Title],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Title.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')" 10 dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection) 11 dbread = dbcommunication.ExecuteNonQuery() 12 dbread.Close() 13 Dbconnection.Close() 14 End Sub 15 </script> 16 17 <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 18 <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" /> 19 .<br /> 20 <br /> 21 <table> 22 <tr> 23 <td style="width: 100px; height: 26px;"> 24 CustomerID 5</td> 25 <td style="width: 100px; height: 26px;"> 26 <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td> 27 </tr> 28 <tr> 29 <td style="width: 100px"> 30 LastName 20</td> 31 <td style="width: 100px"> 32 <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td> 33 </tr> 34 <tr> 35 <td style="width: 100px"> 36 FirstName 10</td> 37 <td style="width: 100px"> 38 <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td> 39 </tr> 40 <tr> 41 <td style="width: 100px"> 42 Title 4</td> 43 <td style="width: 100px"> 44 <asp:TextBox ID="Title" runat="server"></asp:TextBox></td> 45 </tr> 46 <tr> 47 <td style="width: 100px"> 48 BirthDate 49 </td> 50 <td style="width: 100px"> 51 <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td> 52 </tr> 53 <tr> 54 <td style="width: 100px"> 55 Address 50</td> 56 <td style="width: 100px"> 57 <asp:TextBox ID="Address" runat="server"></asp:TextBox></td> 58 </tr> 59 <tr> 60 <td style="width: 100px"> 61 Town 15</td> 62 <td style="width: 100px"> 63 <asp:TextBox ID="Town" runat="server"></asp:TextBox></td> 64 </tr> 65 <tr> 66 <td style="width: 100px"> 67 County 15</td> 68 <td style="width: 100px"> 69 <asp:TextBox ID="County" runat="server"></asp:TextBox></td> 70 </tr> 71 <tr> 72 <td style="width: 100px; height: 26px;"> 73 PostCode 10</td> 74 <td style="width: 100px; height: 26px;"> 75 <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td> 76 </tr> 77 <tr> 78 <td style="width: 100px"> 79 HomePhone 24</td> 80 <td style="width: 100px"> 81 <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td> 82 </tr> 83 </table> 84 <br /> 85 <input id="Button1" type="button" value="button" /> 86 </form> 87 88 </asp:Content>
![]() |
0 |
![]() |
Try http://scottonwriting.net/sowblog/posts/10878.aspx
Hope that helps.
Aaron
Don't forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so everyone will know you have been helped.
![]() |
0 |
![]() |
Thanks a lot. It now works, but when I apply my master page, I get a strange error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %> <script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim Dbconnection, sqlcommand, dbcommunication, dbread Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb")) Dbconnection.Open() sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Titl],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Titl.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')" dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection) dbread = dbcommunication.ExecuteReader() dbread.Close() Dbconnection.Close() End Sub </script> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" /> .<br /> <br /> <div> <div> <table> <tr> <td style="width: 100px"> CustomerID 5</td> <td style="width: 100px"> <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> LastName 20</td> <td style="width: 100px"> <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> FirstName 10</td> <td style="width: 100px"> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Titl 4</td> <td style="width: 100px"> <asp:TextBox ID="Titl" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> BirthDate </td> <td style="width: 100px"> <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Address 50</td> <td style="width: 100px"> <asp:TextBox ID="Address" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Town 15</td> <td style="width: 100px"> <asp:TextBox ID="Town" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> County 15</td> <td style="width: 100px"> <asp:TextBox ID="County" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> PostCode 10</td> <td style="width: 100px"> <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> HomePhone 24</td> <td style="width: 100px"> <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td> </tr> </table> <br /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div> </div> <br /> </form> </asp:Content>
![]() |
0 |
![]() |
Thanks a lot. It now works, but when I apply my master page, I get a strange error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %> <script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim Dbconnection, sqlcommand, dbcommunication, dbread Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb")) Dbconnection.Open() sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Titl],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Titl.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')" dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection) dbread = dbcommunication.ExecuteReader() dbread.Close() Dbconnection.Close() End Sub </script> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" /> .<br /> <br /> <div> <div> <table> <tr> <td style="width: 100px"> CustomerID 5</td> <td style="width: 100px"> <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> LastName 20</td> <td style="width: 100px"> <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> FirstName 10</td> <td style="width: 100px"> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Titl 4</td> <td style="width: 100px"> <asp:TextBox ID="Titl" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> BirthDate </td> <td style="width: 100px"> <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Address 50</td> <td style="width: 100px"> <asp:TextBox ID="Address" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Town 15</td> <td style="width: 100px"> <asp:TextBox ID="Town" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> County 15</td> <td style="width: 100px"> <asp:TextBox ID="County" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> PostCode 10</td> <td style="width: 100px"> <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> HomePhone 24</td> <td style="width: 100px"> <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td> </tr> </table> <br /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div> </div> <br /> </form> </asp:Content>
![]() |
0 |
![]() |
Thanks a lot. It now works, but when I apply my master page, I get a strange error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %> <script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim Dbconnection, sqlcommand, dbcommunication, dbread Dbconnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data\LAM.mdb")) Dbconnection.Open() sqlcommand = "INSERT INTO Customers([CustomerID],[LastName],[FirstName],[Titl],[BirthDate],[Address],[Town],[County],[PostCode],[HomePhone]) values ('" & CustomerID.Text & "', '" & LastName.Text & "', '" & FirstName.Text & "','" & Titl.Text & "', '" & BirthDate.Text & "', '" & Address.Text & "', '" & Town.Text & "', '" & County.Text & "', '" & PostCode.Text & "', '" & HomePhone.Text & "')" dbcommunication = New Data.OleDb.OleDbCommand(sqlcommand, Dbconnection) dbread = dbcommunication.ExecuteReader() dbread.Close() Dbconnection.Close() End Sub </script> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form>Please fill in your Customer Details here, <asp:LoginName ID="LoginName1" runat="server" /> .<br /> <br /> <div> <div> <table> <tr> <td style="width: 100px"> CustomerID 5</td> <td style="width: 100px"> <asp:TextBox ID="CustomerID" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> LastName 20</td> <td style="width: 100px"> <asp:TextBox ID="LastName" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> FirstName 10</td> <td style="width: 100px"> <asp:TextBox ID="FirstName" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Titl 4</td> <td style="width: 100px"> <asp:TextBox ID="Titl" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> BirthDate </td> <td style="width: 100px"> <asp:TextBox ID="BirthDate" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Address 50</td> <td style="width: 100px"> <asp:TextBox ID="Address" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> Town 15</td> <td style="width: 100px"> <asp:TextBox ID="Town" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> County 15</td> <td style="width: 100px"> <asp:TextBox ID="County" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> PostCode 10</td> <td style="width: 100px"> <asp:TextBox ID="PostCode" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 100px"> HomePhone 24</td> <td style="width: 100px"> <asp:TextBox ID="HomePhone" runat="server"></asp:TextBox></td> </tr> </table> <br /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div> </div> <br /> </form> </asp:Content>
![]() |
0 |
![]() |
I`ve solved it all, but don`t have a clue how!
Thanks for the help, sorry for the triple-post!
![]() |
0 |
![]() |