Results 1 to 3 of 3

Thread: Resolved[02/03] web user control calendar

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    790

    Resolved[02/03] web user control calendar

    I recently added a web user calendar control that I made from a textbox , an input button, an html div and a calendar tool to my webpage and realized to my chagrin that I can't move it from the left side of the page it is essentially locked once I drag and drop this from the solution explorer. Is there any way to unlock a web user control so that it can be placed where you wish to drag and drop it ?
    Last edited by Christopher_Arm; Oct 24th, 2007 at 08:52 AM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [02/03] web user control calendar

    You could just go into the HTML source of the page and place it inside another DIV which is right aligned. Dragging and dropping is for absolute positioning but you're obviously not using that on your page.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    790

    Resolved [02/03] web user control calendar

    I am one step ahead of you Mendhak..I did exactly as you said some hours before..however..within the code of my html it invokes this function

    Code:
    <script>
    in the script tags:
    function OnClick
    
    { 
    if (divCalendar.style.display == "none")
    divCalendar.style.display = "";
    else
    divCalendar.style.display = "none";
    }
    
    </script>
    In the code behind:
    
    Private Sub Calendar1_SelectionChanged1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
            TextBox14.Text = Calendar1.SelectedDate.ToShortDateString
            Dim div As System.Web.UI.Control = Page.FindControl("divCalendar")
            If TypeOf div Is HtmlGenericControl Then
                CType(div, HtmlGenericControl).Style.Add("display", "none")
               
            End If
    
        End Sub
    Is there any way around this line of code or to be more precise..is there a way to incorporate similar logic to make the calendar vanish once the selection has been made since I do not have a div/label and it doesn't seem to work when I put it around my calendar control.

    EDIT: I figured this out. There was no need to go around this bit of logic. It works well enough. Figuring out how to autocalc the date in textboxes setting the following textboxes to 30 and 60 days in advance with javascript with the OnBlur method which you mentioned in a previous thread earlier. Except for www.w3schools.com I don't see many references on that subject and that has proven to be a harder problem in solving.
    Last edited by Christopher_Arm; Oct 24th, 2007 at 08:52 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width