FORM value not bein inserted when posting to sql server

C

con

I have created a aspx page which contains a formview with the state set to
"insert", I prepopulate some of the data as seen below and this is visible
on the form.
The information appears on the form but when I view the post via sql
profilter , the data that was "created" from the eval is null?


SQL server 2003
vs 2005
..net framework 2.0


code snippet from aspx page


<asp:TemplateField HeaderText="by User" SortExpression="lastid">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%#
Setid(Eval("lastid")) %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%#
Bind("lastid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

VB backend code

Public Function setid(ByVal itemtype As Object) As Object
Return "test"
End Function

sql snippet value passed to storedprocedure

@lastid = NULL
 
C

con

Solved the null posting;

set the binding to two way as the source was from an object I moved the key
to the first column and the issue appears to have been rectified.
Unsure as to why this all worked but i hope it saves somebody some time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top