Populating textbox using calendar in DETAILSVIEW control - Vb.net

I need help. I am a new member, though I have used your site for a while now. I have read alot about popup calendars but have not find anything that is specifically geared towards DetailsView controls.  I borrows the following codes. Instead of adding the textbox on a form I added it in a templatefield (detailsview instead). Every time I click on the textbox I get this message "HTTP Error 404 - Not found version information: ASP.NET Development Server

I need to make my textbox a required field too. Thank you in advance for all your help.

This is my code for the detailsview textbox

<asp:DetailsView ID="OrderDetailView"








<asp:BoundField DataField="CUST_ID" HeaderText="CUST_ID" SortExpression="CUST_ID" Visible="False" />

<asp:BoundField DataField="ORDER_ID" HeaderText="ORDER_ID" InsertVisible="False" SortExpression="ORDER_ID" Visible="False" />

<asp:TemplateField HeaderText="Date Ordered" SortExpression="DATE_ORDERED">


<asp:TextBox ID="TextBox24" runat="server"

Text='<%# Bind("DATE_ORDERED") %>'>


<a href="javascript:calendar_window=window.open('/Calendar.aspx?detailsviewid=orderdetailview.TextBox24','calendar_window','width=154,height=188');calendar_window.focus()">

Calendar </a>

<br />



This is my calendar page:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Calendar.aspx.vb" Inherits="Calendar" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>



<form id="form1" runat="server">


<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="calendar1_SelectionChanged" OnDayRender="calendar1_dayrender" showtitle="true" DayNameformat="FirstTwoLetters" SelectionMode="Day" BackColor="#ffffff" FirstDayOfWeek="Monday" BorderColor="#000000" ForeColor="#00000" Height="60" Width="120">

<TitleStyle backcolor="#000080" forecolor="#ffffff" />

<NextPrevStyle backcolor="#000080" forecolor="#ffffff" />

<OtherMonthDayStyle forecolor="#c0c0c0" />


<asp:Literal ID="Literal1" runat="server"></asp:Literal>





Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs)

If e.Day.Date = DateTime.Now.ToString("d") Then

e.Cell.BackColor = System.Drawing.Color.LightGray

End If

End Sub

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged

Dim strjscript As String = "<script language=""javascript"">"

strjscript &= "window.opener." & _

HttpContext.Current.Request.QueryString("detailview.TextBox24") & ".value = '" & _

Calendar1.SelectedDate & "';window.close();"

strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug

Literal1.Text = strjscript 'Set the literal control's text to the JScript code

End Sub


7/9/2008 4:53:21 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 48

Hi Kirumo ,


HTTP Error 404

<a href="javascript:calendar_window=window.open('/Calendar.aspx?detailsviewid=orderdetailview.TextBox24','calendar_window','width=154,height=188');calendar_window.focus()"> 

The error 404 means that the resource can not be found .

Please double check the a tag above. Make sure you are using the correct URL address. Because the url seems to be wrong.


Samu Zhang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
7/11/2008 6:06:21 AM

Thank you for your help. My resource URL was wrong so it is now working. However, my texbox is still not set as required field. I tried using the required field validator control without success. Can someone help me please?


7/14/2008 4:45:23 PM

Similar Artilces:

Making the .NET calendar control as a floating control
Hi, I need to implement the .NET calendar control as a floating control. Is it possible to do that? If so, can you let me know how to do that?With Regards,Saravana Kumar M R  You could use the calendar extender control in the AJAX control toolkit. You can download the toolkit here, and there is a sample here.My Blog...

ajax.net controls used in custom composite controls?
I am creating an events calendar that uses the accordion to display the events for the selected day.  The problem I'm having is that the accordion is not responding to any client side events.  I would really like to find a good "How to" article for building composite controls that incorporate an ajax.net control like the accordion....

using a .Net Control as activex control in VCL form
Hi , We have a to integrate a simple .Dot CSharp control which needs to be integrated into bcb2010 VCL form as a control. We will place the control on the VCL form along with other VCL controls's. I tried creating a simple .net control using a lable+textbox and trying to use in vcl form. I have made the assembly comvisible and generated tlb files and .bpl for the component. I could see the component in "ActiveX" tool palette. But when I drag the object onto VCL form and try to access its attributes I run into problems. I am not able to see .net control on the vcl at runti...

Issue using control created in VS.net 2003 in VS.net 2002
I have a friend that has an issue using my asp.net C# custom control in Visual Studio.net 2002 that I have compiled under Visual Studio.net 2003. I never did test it with that version, but I was under the impression that it should still work as long as you don't use any features specific to the 1.1 framework (which I really don't think I did). My guess now is that this is correct, but only when using 2002 controls in 2003. I have searched the web, these forums, and MSDN for the last 30 minutes with no real answer. The guy that runs MetaBuilders (http://www.metabuilders.com/Faq.aspx) tell...

How to populate a textbox nested within a DataLsit control with the return value from a calendar control ?
Hi all: I have a pop up window which contains a calendar control. It is works well for me. But when I have a textbox inside a DataList control, I cannot get the return value from the calendar window to fill in that textbox. I do not know how to specify the path in Javascript. if the form = form1, Datalist control = DTcontrol1, and TextBox = txtBox1, how can I do that ? Please help ... Thanks, JL...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

What control do I use (or do I not use a control at all...)
Okay so here's the story so far. I am making a blog to be incorporated into a website. Well, I'm doing the blog from scratch. I'm using MySQL to source all the data via MySQL .NET/Connector. Now while developing the script, I used DataReader and Response.Write to show the blog topics. Now that it has come to put it under a design (I'm using a Master Page for that), I've hit the problem. Response.Write shows all the topics before any of the design elements could be incorporated. So that (more or less) is out of question. So next I looked into the data presentation controls. I looked up GridVi...

populate Grid view control through programming using Ado.net
i am working in visual studio 2005 .i want to populate Grid view control  through programming using Ado.net  with result of datareader ,gridview is already filled with a datasource control but there is an error " Index is out of Rang And Index cant negative" plz any one help me Code is : GrdManageMessages.DataSourceID = ""GrdManageMessages.DataBind()  Dim i As Integer = 0Dim SqlConnect As SqlConnection = New SqlConnection("Data Source=COMMANDER\SQLEXPRESS;Initial Catalog=Enotice;Integrated Security=True")      &n...

Datagrid(.net 1.1) to GridView(.net 2.0) and using the RowUpdating event how to extract the values from the controls.
Ok  This is the settings: I use a Viewgrid with only itemtemplate colums for example. <asp:TemplateField HeaderText="Test"><ItemTemplate><asp:Label id="LBL_Test" text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' runat="server" meta:resourcekey="LBL_TestResource1"></asp:Label></font></ItemTemplate> <EditItemTemplate><asp:TextBox ID="HDN_Test" Text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' Runat="server" meta:resourcekey="HDN_TestResource1" /></EditItemTemplate></asp:TemplateField>  The ...

Trouble controlling .net controlls with CSS
 I am trying to control the :hover css property on <asp: Button> controls. Basically the css is working correctly to set the initial look of the button, but nothing is happening when I hover over the button. Here is my code:CSS:.sidebarButton{    width: 168px;     height: 45px;     background-color: #666666;     text-align: left;    font-weight: bold;    font-family: Century Gothic;    font-size: 13pt;    color: White;    border-style: none;  ...

Architecture: .Net Controls vs. Custom Controls
I'm interested in managing users. i.e. Logins and profiles, etc.My question is, should I be using things like the Login control or should I program these from scratch? I dont like the fact that .NET creates so many things for me. This level of abstraction terrifies me and it feels like I have no control over the code .I've done a few huge sites in Classic ASP (million-hits-per-day type sites) and I'm not sure how robust certain controls are, or when to use them.Is, for example, the Login control aimed at newbies to .NET? Should it be used for the larger projects with thousands of...

Add .Net Control to Web Custom Control
 I want to add .NET Control (like: TextBox, Button...) to Web Custom Control.How i can do it? Alphavn That's called a composite control -- "Mark As Answer" if my reply helped you -- Hello Guys What gunteman said, that is one approach and in most cases the right one.But its also possible to add child controls to a Control thats inherit from WebControl itself. Be sure to implement INamingContainer to that inherited Control too, thats the important point of that approach.--Microsoft MVP - Visual Developer ASP / ASP.NET- http://www.aspnetzone.de/blogs/peterbuch...

What is the real difference between Server Controls and .NET controls?
This was a class discussion question and I'd like to know, what exactly are the differences? Is there a clear answer? .NET framework controls are server controls. The only difference that I can think of is that the .NET controls are part of the FCL (Framework Class Library). HTH,RyanRyan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

Need a server control that uses the calendar control
I want to develop a server control that uses the calendar control.  This new control will have one string property passed in from the outside.  The control will use a SQL stored proc to gather data used in the page render section of the calendar control.  The property will be passed to the stored proc.  In case you're wondering, I need this because I program in VB and an app that I need to use this in is written in C#.  Once I have the control, I can put it in the app and use it as desired.  I have the working code in a web project, I just need to know how...

How to Use MathML.NET Control.
Hi all,  I have the problem with creating the web form contaning MathML control, actually i have no knowledge how to use it or how to store the math quation from the control to database i want to do the exact same i wrote earlier.  plz do a favourable reply. Yogesh Agarwal...

Web resources about - Populating textbox using calendar in DETAILSVIEW control - Vb.net - asp.net.presentation-controls

Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta
In this article, Scott discusses the recently released beta version of Visual Studio 2008 and .NET Framework 3.5 Service Pack 1. He starts with ...

Latest Updates
Latest Updates - Free source code and tutorials for Software developers and Architects.; Updated: 15 Feb 2013

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

<asp:DetailsView ID="grd_empDetails" runat="server" DataSourceID="empDataSource - Pastebin.com
Pastebin launched a little side project called HostCabi.net , check it out ;-) Don't like ads?

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Latest Updates
Latest Updates - Free source code and tutorials for Software developers and Architects.; Updated: 15 Feb 2013

Resources last updated: 11/28/2015 10:46:56 AM