473,322 Members | 1,523 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.

FormView - how to insert data into a hidden field??

I am pretty sure this is a simple problem, with a simple solution, but
I am totally lost with this. I am working to a very tight uni
deadline, and have wasted far too long on this now, so any help would
be much appreciated.

I have a FormView with various textboxes in it and some hidden fields.
I also have a command button. What I basically want to happen, is
when the command button is pressed is the script send some values back
to the hidden fields in FormView1. How do you do this? I have no
problems in getting this to work with labels outside the FormView?

Below is my code from the button.

ivfBookingNo, ivfBookingDate and ivfBookingDate are the fields I am
trying to populate. I have tried it in various ways, such as
FormView1.ivfBookingNo etc...

Please ignore my non-standard naming conventions :)

Thanks!
Protected Sub book_Click(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim bookingNo As String

Dim bookingTime As String

Dim bookingDate As String

Dim bookingSec As String

Dim strHash As String
bookingTime = Now.ToLongTimeString

bookingDate = Now.Date

bookingSec = Now.Millisecond

strHash = bookingSec + bookingTime + bookingDate

bookingNo =
FormsAuthentication.HashPasswordForStoringInConfig File(strHash,

"md5")
lblBookingMade.Text =

"Booking Confirmation"
lblBookingRef.Text =

"Your Booking Ref: " + bookingNo
ivfBookingNo.value = bookingNo

ivfBookingTime.value = bookingTime

ivfBookingDate.value = bookingDate
End Sub

Feb 24 '07 #1
1 3101
Have you tried something like
CType(FormView1.FindControl("ivfBookingNo), "HiddenField").value = bookingNo

--
Regards,
Kees de Winter

<ad*************@gmail.comwrote in message
news:11*********************@h3g2000cwc.googlegrou ps.com...
I am pretty sure this is a simple problem, with a simple solution, but
I am totally lost with this. I am working to a very tight uni
deadline, and have wasted far too long on this now, so any help would
be much appreciated.

I have a FormView with various textboxes in it and some hidden fields.
I also have a command button. What I basically want to happen, is
when the command button is pressed is the script send some values back
to the hidden fields in FormView1. How do you do this? I have no
problems in getting this to work with labels outside the FormView?

Below is my code from the button.

ivfBookingNo, ivfBookingDate and ivfBookingDate are the fields I am
trying to populate. I have tried it in various ways, such as
FormView1.ivfBookingNo etc...

Please ignore my non-standard naming conventions :)

Thanks!
Protected Sub book_Click(ByVal sender As Object, ByVal e As
System.EventArgs)

Dim bookingNo As String

Dim bookingTime As String

Dim bookingDate As String

Dim bookingSec As String

Dim strHash As String
bookingTime = Now.ToLongTimeString

bookingDate = Now.Date

bookingSec = Now.Millisecond

strHash = bookingSec + bookingTime + bookingDate

bookingNo =
FormsAuthentication.HashPasswordForStoringInConfig File(strHash,

"md5")
lblBookingMade.Text =

"Booking Confirmation"
lblBookingRef.Text =

"Your Booking Ref: " + bookingNo
ivfBookingNo.value = bookingNo

ivfBookingTime.value = bookingTime

ivfBookingDate.value = bookingDate
End Sub

Feb 25 '07 #2

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

Similar topics

0
by: le_mo_mo | last post by:
Hi, I am using ASP.Net 2.0 as the framework and using a formview component to update database. I am not sure how to edit the "Edit" template so I can include hidden field/data (current time,...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
7
by: Lorenzino | last post by:
Hi, I have a problem with bindings in a formview. I have a formview; in the insert template i've created a wizard control and inside it i have an HTML table with some textboxes bound to the...
0
by: Hawk | last post by:
Hello, this is my first post hope to get some good answers. I am using asp.net 2.0 and I am trying to pass the value entered in the formview textbox in insert mode "in this case it is the...
1
by: scartin | last post by:
I'm fairly new to working with ASP web controls, and am running into what seems to be a ridiculous problem that I'm hoping will be a breeze for an experienced ASP developer. I have a GridView...
0
by: Sam | last post by:
I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data type of 'Money...
0
by: Sam | last post by:
Folks.. I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
3
by: YMPN | last post by:
Hi Everyone, I'm deen from Riyadh. Please do help me with some problem i have. I have this formview control setup to recieved inputs from user (textbox, dropdownlist, others). After...
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...
0
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...
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: 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...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.