473,386 Members | 1,720 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,386 software developers and data experts.

Setting FormView Text and Calendar data from code-behind page

I have a Master page that wraps my content pages, on one page I have a FormView that is tied to an ObjectDataSource and has textbox and calendar controls bound to the datasource. My problem is this, there are times when I would like to set the control values when the page initially loads. I've tried this in the Page_Load function for the code-behind for this page:

FormView1.Expire_DateCalendar.SelectedDate = DateTime.Today.AddYears(+100);

But I get the following error message:

'System.Web.UI.WebControls.FormView' does not contain a definition for 'Expire_DateCalendar'

I've also tried adding ItemTemplate or InsertItemTemplate after FormView1 and doesn't seem to work either. I am new to ASP.NET using C#. Any help given would be greatly appreciated.

Thank you in advance, DotNetNubie66
Sep 25 '07 #1
2 2088
Can anyone tell me the best way to handle NULL values for a Calendar control on a formview used to insert?

Thanks.
Sep 29 '07 #2
kenobewan
4,871 Expert 4TB
Sounds like you dont want todays date as a default date, but you can select a date in the 1800 and not write. From memory I have used two different sp_ or checked for null value and not written calendar value, assuming you have allowed nulls in db. HTH.
Sep 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: TdarTdar | last post by:
I wanted to add three columns up on the form and run some logic to fill in the third but not sure how to call the field names in the formview control. Dim Girth As Integer Elenght =...
8
by: John Wildes | last post by:
Hello all I'm going to try and be brief with my question, please tell me if I have the wrong group. We are querying transaction data from a DB3 database application. The dates are stored as...
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
6
by: Douglas J. Badin | last post by:
Earlier this month, there was a posting about this without a definitive answer. If you place a Wizard inside a FormView's EditItemTemplate the bound fields contained within the View will display...
4
by: sck10 | last post by:
Hello, I am trying to use a radiobutton inside of a FormView for editing data. My question is how do you bind the radio buttons to the data field? Thanks, sck10 <td style="width:30%;...
0
by: jobs | last post by:
In the below code, why can't I equate which form to a formview like we do with controls under the main control. The below gives me an error because whichform does not really take all the properties...
8
by: =?Utf-8?B?QXNo?= | last post by:
Hi, I have an object, for example User. User contains various properties which i have been able to bind to successfully using wizards and the form view. However if the class User has a property...
0
by: trubble | last post by:
Hi I've been googling for AGES but still no joy so would really appreciate help!! I have a form view with a calendar control in it's edit item template. It displays the date from the database...
4
by: Cirene | last post by:
I have a formview control. When the user goes into insert mode I want to set the Calendar to today's date. How can I accomplish this? I know it's probably only 1 or 2 lines of code. I...
0
by: cs_in_va | last post by:
I have a calendar (Cal1) inside a formview (fv) when the date is chanded I want to display the date on the label, vlblDate. Protected Sub Cal1_SelectionChanged(ByVal sender As Object, ByVal e...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.