473,386 Members | 1,766 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.

DetailsView Textbox with Bind and Date?

Hello!
I'm relative new to asp.net and I'm trying to figure out how i can
have a "auto fill" date in a textbox from a DetailsView in insertmode.

I know that with <%# Now %in Text='' I can put the Date in the
TextBox Field.
And I know that i can use <%# Bind="date" %to bind it to the date
part of the sql query.

But how can I make both with one textbox?
I tried all combinations but i got only errors.

My Code "Part" so far:

<asp:TemplateField HeaderText="Datum" SortExpression="date">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server"
Text='<%# Bind("date") %>' Width="300px"></asp:TextBox>
<asp:Label ID="Label7" runat="server"
Text="tt.mm.jjjj hh:mm"></asp:Label>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="TextBox5"
ErrorMessage="Bitte Datum eingeben!"></
asp:RequiredFieldValidator>&nbsp;
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox6" runat="server"
Text='<%# Bind("date") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server"
Text='<%# Bind("date") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

Feb 5 '07 #1
0 1404

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

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
1
by: vbnetdev | last post by:
I need to customize the DetailsView New record (insert) so that it gets the maximum value of ROWID and adds 1, places that value in the textbox and makes it read only. Also, I have a field...
3
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource...
5
by: Mike P | last post by:
The default format for the DetailsView control is for there to be a row per field. Is it possible set it to show more than one column per row (see below)? ID ... Name ......
0
by: jeffmagill | last post by:
Hi Everybody, I'm really hoping that someone can help me out because I have spent too much time on this project already! Basically, I have a DetailsView that handles all the Edits for a...
3
by: Jason | last post by:
Anyone know how to make the text wrap in a text box of a DetailsView?
2
by: David Lozzi | last post by:
Howdy, I have a DetailsView that when I fire the UpdateItem event, it doesn't update the data. The page reloads and the data is set back to the original. I'm using a Button to fire the...
0
by: sansie | last post by:
Hi, I have a page which is basically a details view(in inset mode) inside a datalist. The problem is I want to set the field "invoiceID" (of the detailsview) to an invoiceID coming through the...
1
by: needhelp1 | last post by:
I have gridview with a detailsview below. When I click on 'New' in brings up the DetailsView for inserting. When I click on 'Edit' in does not brink up the DetailsView. What am I doing wrong? I...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.