Can anyone explain why the code below inserts blank values into my access
database while the same code without the masterpagefile reference works and
inserts the values?
<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er" Title="Untitled
Page" %>
<Script runat="server">
Private Sub Insertimg(ByVal Source As Object, ByVal e As EventArgs)
SqlDataSource1. Insert()
End Sub
</Script>
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server" ConnectionStrin g="<%$
ConnectionStrin gs:minConnectio nString %>"
ProviderName="< %$ ConnectionStrin gs:minConnectio nString.Provide rName %>"
InsertCommand=" INSERT INTO iconimg (Imgname, Imgpath) VALUES (@Imgn,@Imgp)">
<insertparamete rs>
<asp:FormParame ter FormField="Imgn ame" Name="Imgn" />
<asp:FormParame ter FormField="Imgp ath" Name="Imgp" />
</insertparameter s>
</asp:SqlDataSour ce>
Billednavn: <asp:TextBox ID="Imgname" runat="server"> </asp:TextBox>
Billedsti: <asp:TextBox ID="Imgpath" runat="server"> </asp:TextBox>
<asp:button
id="Button2"
runat="server"
text="Insert"
onclick="Insert img" />
</asp:Content>
database while the same code without the masterpagefile reference works and
inserts the values?
<%@ Page Language="VB" MasterPageFile= "~/MasterPage.mast er" Title="Untitled
Page" %>
<Script runat="server">
Private Sub Insertimg(ByVal Source As Object, ByVal e As EventArgs)
SqlDataSource1. Insert()
End Sub
</Script>
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server" ConnectionStrin g="<%$
ConnectionStrin gs:minConnectio nString %>"
ProviderName="< %$ ConnectionStrin gs:minConnectio nString.Provide rName %>"
InsertCommand=" INSERT INTO iconimg (Imgname, Imgpath) VALUES (@Imgn,@Imgp)">
<insertparamete rs>
<asp:FormParame ter FormField="Imgn ame" Name="Imgn" />
<asp:FormParame ter FormField="Imgp ath" Name="Imgp" />
</insertparameter s>
</asp:SqlDataSour ce>
Billednavn: <asp:TextBox ID="Imgname" runat="server"> </asp:TextBox>
Billedsti: <asp:TextBox ID="Imgpath" runat="server"> </asp:TextBox>
<asp:button
id="Button2"
runat="server"
text="Insert"
onclick="Insert img" />
</asp:Content>