Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Creating calendar in c#

Creating calendar in c#

Scheduled Pinned Locked Moved C#
helpcsharpjavascript
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nauty
    wrote on last edited by
    #1

    Hi all I am in urgent need of help from you people. In my web page the user has to insert date several times.so i thought of creating user control.I did that and it worked nicely. but the problem in that is the calendar is opening in the page.So i want to create a window for displaying the calendar and returning the date in the textbox with only c# code i.e. No javascript. Kindly send the solution as early as possible. I want to repeat once more that i don't want javascript code to create the window only C# code is needed. Thanks in advance nauty

    C L P 3 Replies Last reply
    0
    • N nauty

      Hi all I am in urgent need of help from you people. In my web page the user has to insert date several times.so i thought of creating user control.I did that and it worked nicely. but the problem in that is the calendar is opening in the page.So i want to create a window for displaying the calendar and returning the date in the textbox with only c# code i.e. No javascript. Kindly send the solution as early as possible. I want to repeat once more that i don't want javascript code to create the window only C# code is needed. Thanks in advance nauty

      C Offline
      C Offline
      coolestCoder
      wrote on last edited by
      #2

      I think you can use the query string instead. just create a new web form and keep the calendar control on it. then when user want to select a date open that new web form. Here the user will select the date and click ok button the calendar control web form. In the code behind for the ok button redirect the page to its origin with the selected date as query string. This link would be built when the web form is loaded from the source page, again through query string. For this solution you will have to modify the code for the source page to accept date as a query string to the page. When you get a date through query string you can easily set it to a text box control. there is some extra coding in this way but it is a simple solution for your problem. Reply me if you have some confusion. Anant Y. Kulkarni

      L N 2 Replies Last reply
      0
      • N nauty

        Hi all I am in urgent need of help from you people. In my web page the user has to insert date several times.so i thought of creating user control.I did that and it worked nicely. but the problem in that is the calendar is opening in the page.So i want to create a window for displaying the calendar and returning the date in the textbox with only c# code i.e. No javascript. Kindly send the solution as early as possible. I want to repeat once more that i don't want javascript code to create the window only C# code is needed. Thanks in advance nauty

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        What you are describing is not possible without Javascript.**

        xacc.ide-0.1.3.14 - Now with syntax support for PowerShell
        xacc.ide-0.1.3.13 source code

        **

        1 Reply Last reply
        0
        • N nauty

          Hi all I am in urgent need of help from you people. In my web page the user has to insert date several times.so i thought of creating user control.I did that and it worked nicely. but the problem in that is the calendar is opening in the page.So i want to create a window for displaying the calendar and returning the date in the textbox with only c# code i.e. No javascript. Kindly send the solution as early as possible. I want to repeat once more that i don't want javascript code to create the window only C# code is needed. Thanks in advance nauty

          P Offline
          P Offline
          papa1980
          wrote on last edited by
          #4

          why not javascript???Ok use cookies or cross-page posting

          1 Reply Last reply
          0
          • C coolestCoder

            I think you can use the query string instead. just create a new web form and keep the calendar control on it. then when user want to select a date open that new web form. Here the user will select the date and click ok button the calendar control web form. In the code behind for the ok button redirect the page to its origin with the selected date as query string. This link would be built when the web form is loaded from the source page, again through query string. For this solution you will have to modify the code for the source page to accept date as a query string to the page. When you get a date through query string you can easily set it to a text box control. there is some extra coding in this way but it is a simple solution for your problem. Reply me if you have some confusion. Anant Y. Kulkarni

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            Good approach :)**

            xacc.ide-0.1.3.14 - Now with syntax support for PowerShell
            xacc.ide-0.1.3.13 source code

            **

            1 Reply Last reply
            0
            • C coolestCoder

              I think you can use the query string instead. just create a new web form and keep the calendar control on it. then when user want to select a date open that new web form. Here the user will select the date and click ok button the calendar control web form. In the code behind for the ok button redirect the page to its origin with the selected date as query string. This link would be built when the web form is loaded from the source page, again through query string. For this solution you will have to modify the code for the source page to accept date as a query string to the page. When you get a date through query string you can easily set it to a text box control. there is some extra coding in this way but it is a simple solution for your problem. Reply me if you have some confusion. Anant Y. Kulkarni

              N Offline
              N Offline
              nauty
              wrote on last edited by
              #6

              Hi Anant The approach is really cool.but i don't kno how new window is being made in c#(without javascript) and how to close it after redirecting it back to the parent page. could you send me some sample code. If you've the code for the same using javascript please send me. Thanks for the help. my id is ashishnautiyal@hotmail.com nauty

              C 1 Reply Last reply
              0
              • N nauty

                Hi Anant The approach is really cool.but i don't kno how new window is being made in c#(without javascript) and how to close it after redirecting it back to the parent page. could you send me some sample code. If you've the code for the same using javascript please send me. Thanks for the help. my id is ashishnautiyal@hotmail.com nauty

                C Offline
                C Offline
                coolestCoder
                wrote on last edited by
                #7

                Hi, First of all you create a new web form for your calendar control. That means this new web form will contain only the calendar control and the ok button. Now you modify the source web form to accept a query string named, for example date like this -- private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here try { string dt = Request.QueryString[0].ToString(); txrDate.Text = dt; } catch { } } You can check for post backs according to your program logic. The code for button which will display the calendar web form will go like this -- private void cmdDate_Click(object sender, System.EventArgs e) { Response.Redirect("calendar.aspx?url=webform1.aspx"); } i have assumed that the calendar control is placed on calendar.aspx and the source web form is webform1.aspx now its turn of the calendar.aspx web form write following code in page load event private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here try { url = Request.QueryString[0]; } catch { } } here i have used a string variable named url to store the source url which will be sent to calendar.aspx through query string. now for the ok button on calendar.aspx write this code -- private void cmdOk_Click(object sender, System.EventArgs e) { if(url != "") { Response.Redirect(url + "?date=" + Calendar1.SelectedDate.ToShortDateString()); this.Visible=false; } } here my calendar control name is calendar1 this.visible=false will hide the calendar.aspx page. similarly if you want you can hide and show the source page. But be sure to check the visible property where it is to be set to true where to false. hope you have understood the code. Its just simple.:) Anant Y. Kulkarni

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups