datalist edit mode and javascript pop up calendar

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default datalist edit mode and javascript pop up calendar

    Hi

    Check whether textbox control name is 'txtDischargeDate'
    or it contains automatically generated id?

    HTH
    Ravikanth

    >-----Original Message-----
    >Dear ASP.NET Programmers,
    >
    >I am using a javascript to display popup calendar and
    return the selected
    >date to the control in the calling form. No problems
    here. When I use this
    >script for a control that is created in datalist edit
    mode, the popup
    >calendar doesn't return the date because it cannot find
    the control (or I
    >think so). Is there any way to work around this? I use
    the following code:
    >
    ><script language="Javascript">
    > function GetDate(ctrlName)
    > {
    > childWindow = window.open('popup.aspx?formName=' +
    > document.forms[0].name + '&ctrlName=' +
    ctrlName, "PopUpCalendar",
    > "width=350, height=230, top=200, left=200,
    toolbars=no, scrollbars=no,
    >status=no, resizable=no");
    > }
    >
    > function CloseWindow()
    > {
    > childWindow.close()
    > }
    > </script>
    > <script language="JavaScript">
    >
    ><A href="javascript:GetDate('txtDischargeDate')"><IMG
    >src="images/smallcalendar.gif" border="0"></A>
    >
    >Thanks in advance,
    >
    >Buran
    >
    >
    >.
    >
    Ravikanth[MVP] Guest

  2. Similar Questions and Discussions

    1. Edit button not converting to edit mode
      I too had the same problem today. I've users set up as writers role to update content thru Contribute. We have two admins including my self. We...
    2. Edit button not converting to edit mode
      Do you (or the client, rather), by chance, have desktop firewall installed? Some of those programs will block ftp traffic. If so, you may see if you...
    3. Would like to load a datagrid already in edit mode instead of having the user click the edit button
      Now my asp.net datagrid shows an edit button and clicking it puts the datagrid in edit mode. I would like to: 1) possilby load the page already...
    4. Need help with Datagrid Control in edit mode and Javascript
      I have calendar control in Javascript including in the Head of mu page: <script charset="iso-8859-1" language="JavaScript"...
    5. how to call a function in datalist edit mode
      The "following procedure" you mentioned is structured like an Event Handler. Is there some reason for this? Why don't you just leave off the Event...
  3. #2

    Default Re: datalist edit mode and javascript pop up calendar

    The control name is 'txtDischargeDate' and it is automatically created when
    in edit mode. How can I reference it in Javascript?

    Buran

    "Ravikanth[MVP]" <dvravikanth@hotmail.com> wrote in message
    news:04ef01c34d14$906ea1c0$a001280a@phx.gbl...
    > Hi
    >
    > Check whether textbox control name is 'txtDischargeDate'
    > or it contains automatically generated id?
    >
    > HTH
    > Ravikanth
    >
    >
    > >-----Original Message-----
    > >Dear ASP.NET Programmers,
    > >
    > >I am using a javascript to display popup calendar and
    > return the selected
    > >date to the control in the calling form. No problems
    > here. When I use this
    > >script for a control that is created in datalist edit
    > mode, the popup
    > >calendar doesn't return the date because it cannot find
    > the control (or I
    > >think so). Is there any way to work around this? I use
    > the following code:
    > >
    > ><script language="Javascript">
    > > function GetDate(ctrlName)
    > > {
    > > childWindow = window.open('popup.aspx?formName=' +
    > > document.forms[0].name + '&ctrlName=' +
    > ctrlName, "PopUpCalendar",
    > > "width=350, height=230, top=200, left=200,
    > toolbars=no, scrollbars=no,
    > >status=no, resizable=no");
    > > }
    > >
    > > function CloseWindow()
    > > {
    > > childWindow.close()
    > > }
    > > </script>
    > > <script language="JavaScript">
    > >
    > ><A href="javascript:GetDate('txtDischargeDate')"><IMG
    > >src="images/smallcalendar.gif" border="0"></A>
    > >
    > >Thanks in advance,
    > >
    > >Buran
    > >
    > >
    > >.
    > >

    buran Guest

  4. #3

    Default Re: datalist edit mode and javascript pop up calendar

    Check out this article, i have explained about the similar problem in
    datagrid. Problem is with the name of the control which you are passing to
    javascript function. For solution check this article.
    [url]http://www.microsoft.com/india/msdn/articles/PopupCalendarinASP.aspx[/url]

    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "buran" <buran@buran.com> wrote in message
    news:eRb0cPQTDHA.2256@TK2MSFTNGP11.phx.gbl...
    > Dear ASP.NET Programmers,
    >
    > I am using a javascript to display popup calendar and return the selected
    > date to the control in the calling form. No problems here. When I use this
    > script for a control that is created in datalist edit mode, the popup
    > calendar doesn't return the date because it cannot find the control (or I
    > think so). Is there any way to work around this? I use the following code:
    >
    > <script language="Javascript">
    > function GetDate(ctrlName)
    > {
    > childWindow = window.open('popup.aspx?formName=' +
    > document.forms[0].name + '&ctrlName=' + ctrlName, "PopUpCalendar",
    > "width=350, height=230, top=200, left=200, toolbars=no, scrollbars=no,
    > status=no, resizable=no");
    > }
    >
    > function CloseWindow()
    > {
    > childWindow.close()
    > }
    > </script>
    > <script language="JavaScript">
    >
    > <A href="javascript:GetDate('txtDischargeDate')"><IMG
    > src="images/smallcalendar.gif" border="0"></A>
    >
    > Thanks in advance,
    >
    > Buran
    >
    >

    Saravana Guest

  5. #4

    Default Re: datalist edit mode and javascript pop up calendar

    The control name is txtDischargeDate. No problems there. Any suggestions?

    Buran

    "Ravikanth[MVP]" <dvravikanth@hotmail.com> wrote in message
    news:04ef01c34d14$906ea1c0$a001280a@phx.gbl...
    > Hi
    >
    > Check whether textbox control name is 'txtDischargeDate'
    > or it contains automatically generated id?
    >
    > HTH
    > Ravikanth
    >
    >
    > >-----Original Message-----
    > >Dear ASP.NET Programmers,
    > >
    > >I am using a javascript to display popup calendar and
    > return the selected
    > >date to the control in the calling form. No problems
    > here. When I use this
    > >script for a control that is created in datalist edit
    > mode, the popup
    > >calendar doesn't return the date because it cannot find
    > the control (or I
    > >think so). Is there any way to work around this? I use
    > the following code:
    > >
    > ><script language="Javascript">
    > > function GetDate(ctrlName)
    > > {
    > > childWindow = window.open('popup.aspx?formName=' +
    > > document.forms[0].name + '&ctrlName=' +
    > ctrlName, "PopUpCalendar",
    > > "width=350, height=230, top=200, left=200,
    > toolbars=no, scrollbars=no,
    > >status=no, resizable=no");
    > > }
    > >
    > > function CloseWindow()
    > > {
    > > childWindow.close()
    > > }
    > > </script>
    > > <script language="JavaScript">
    > >
    > ><A href="javascript:GetDate('txtDischargeDate')"><IMG
    > >src="images/smallcalendar.gif" border="0"></A>
    > >
    > >Thanks in advance,
    > >
    > >Buran
    > >
    > >
    > >.
    > >

    buran Guest

  6. #5

    Default Re: datalist edit mode and javascript pop up calendar

    Dear Saravana,

    The article helped me a lot, but I still cannot find the solution. I use the
    following code:

    Private Sub dliStayDetails_ItemDataBound(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.DataListItemEventArgs) Handles
    dliStayDetails.ItemDataBound

    If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    ListItemType.AlternatingItem Then
    Dim imgCal As New System.Web.UI.WebControls.Image()
    imgCal = CType(e.Item.FindControl("imgCal1"),
    System.Web.UI.WebControls.Image)
    imgCal.Attributes.Add("Onclick", "javascript:pickDate('" &
    e.Item.FindControl("txtAdmDate").ClientID & "')")
    End If

    End Sub

    and I get "Object reference not set to an instance of an object" for the
    line with the attribute.
    Thanks,

    Buran


    "Saravana" <saravank@sct.co.in> wrote in message
    news:ewsuwwRTDHA.3500@tk2msftngp13.phx.gbl...
    > Check out this article, i have explained about the similar problem in
    > datagrid. Problem is with the name of the control which you are passing
    to
    > javascript function. For solution check this article.
    > [url]http://www.microsoft.com/india/msdn/articles/PopupCalendarinASP.aspx[/url]
    >
    > --
    > Saravana
    > Microsoft India Community Star,
    > MCAD,SE,SD,DBA.
    >
    >
    > "buran" <buran@buran.com> wrote in message
    > news:eRb0cPQTDHA.2256@TK2MSFTNGP11.phx.gbl...
    > > Dear ASP.NET Programmers,
    > >
    > > I am using a javascript to display popup calendar and return the
    selected
    > > date to the control in the calling form. No problems here. When I use
    this
    > > script for a control that is created in datalist edit mode, the popup
    > > calendar doesn't return the date because it cannot find the control (or
    I
    > > think so). Is there any way to work around this? I use the following
    code:
    > >
    > > <script language="Javascript">
    > > function GetDate(ctrlName)
    > > {
    > > childWindow = window.open('popup.aspx?formName=' +
    > > document.forms[0].name + '&ctrlName=' + ctrlName, "PopUpCalendar",
    > > "width=350, height=230, top=200, left=200, toolbars=no, scrollbars=no,
    > > status=no, resizable=no");
    > > }
    > >
    > > function CloseWindow()
    > > {
    > > childWindow.close()
    > > }
    > > </script>
    > > <script language="JavaScript">
    > >
    > > <A href="javascript:GetDate('txtDischargeDate')"><IMG
    > > src="images/smallcalendar.gif" border="0"></A>
    > >
    > > Thanks in advance,
    > >
    > > Buran
    > >
    > >
    >
    >

    buran Guest

  7. #6

    Default Re: datalist edit mode and javascript pop up calendar

    Can you post your aspx (datagrid)code also.

    --
    Saravana
    Microsoft India Community Star,
    MCAD,SE,SD,DBA.


    "buran" <buran@buran.com> wrote in message
    news:OubI$9nUDHA.1512@TK2MSFTNGP11.phx.gbl...
    > Dear Saravana,
    >
    > The article helped me a lot, but I still cannot find the solution. I use
    the
    > following code:
    >
    > Private Sub dliStayDetails_ItemDataBound(ByVal sender As Object, ByVal e
    As
    > System.Web.UI.WebControls.DataListItemEventArgs) Handles
    > dliStayDetails.ItemDataBound
    >
    > If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
    > ListItemType.AlternatingItem Then
    > Dim imgCal As New System.Web.UI.WebControls.Image()
    > imgCal = CType(e.Item.FindControl("imgCal1"),
    > System.Web.UI.WebControls.Image)
    > imgCal.Attributes.Add("Onclick", "javascript:pickDate('" &
    > e.Item.FindControl("txtAdmDate").ClientID & "')")
    > End If
    >
    > End Sub
    >
    > and I get "Object reference not set to an instance of an object" for the
    > line with the attribute.
    > Thanks,
    >
    > Buran
    >
    >
    > "Saravana" <saravank@sct.co.in> wrote in message
    > news:ewsuwwRTDHA.3500@tk2msftngp13.phx.gbl...
    > > Check out this article, i have explained about the similar problem in
    > > datagrid. Problem is with the name of the control which you are passing
    > to
    > > javascript function. For solution check this article.
    > > [url]http://www.microsoft.com/india/msdn/articles/PopupCalendarinASP.aspx[/url]
    > >
    > > --
    > > Saravana
    > > Microsoft India Community Star,
    > > MCAD,SE,SD,DBA.
    > >
    > >
    > > "buran" <buran@buran.com> wrote in message
    > > news:eRb0cPQTDHA.2256@TK2MSFTNGP11.phx.gbl...
    > > > Dear ASP.NET Programmers,
    > > >
    > > > I am using a javascript to display popup calendar and return the
    > selected
    > > > date to the control in the calling form. No problems here. When I use
    > this
    > > > script for a control that is created in datalist edit mode, the popup
    > > > calendar doesn't return the date because it cannot find the control
    (or
    > I
    > > > think so). Is there any way to work around this? I use the following
    > code:
    > > >
    > > > <script language="Javascript">
    > > > function GetDate(ctrlName)
    > > > {
    > > > childWindow = window.open('popup.aspx?formName=' +
    > > > document.forms[0].name + '&ctrlName=' + ctrlName, "PopUpCalendar",
    > > > "width=350, height=230, top=200, left=200, toolbars=no,
    scrollbars=no,
    > > > status=no, resizable=no");
    > > > }
    > > >
    > > > function CloseWindow()
    > > > {
    > > > childWindow.close()
    > > > }
    > > > </script>
    > > > <script language="JavaScript">
    > > >
    > > > <A href="javascript:GetDate('txtDischargeDate')"><IMG
    > > > src="images/smallcalendar.gif" border="0"></A>
    > > >
    > > > Thanks in advance,
    > > >
    > > > Buran
    > > >
    > > >
    > >
    > >
    >
    >

    Saravana Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139