Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6104917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:53:50+00:00 2026-05-23T13:53:50+00:00

i have a calender and i was able to add text-box inside the cell

  • 0

i have a calender and i was able to add text-box inside the cell using the day-render event but what i am trying to do is allow the user to add data to the text-box and then press add and the content is added to a database and showed inside that same text-box:

here is what i did:

    protected void Page_Load(object sender, EventArgs e)
{
    Calendar1.SelectedDate = DateTime.Now;
}

protected void update(object sender, DayRenderEventArgs e) 
{
    TextBox tb = new TextBox();
    Button1.click += new EventHandler(insert);

    e.Cell.Controls.Add(Button1);
    e.Cell.Controls.Add(textBox2);
}

protected void insert(object sender, EventArgs e) 
{

}

and i know how to insert the data but i am lost on how to identify it and output it back to the same text box

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:53:51+00:00Added an answer on May 23, 2026 at 1:53 pm

    Well I’m not sure exactly what part you are lost on based on your question, so short of providing a complete working example I’ll hit some of the main points:

    1) To identify the data you are inserting, attach a date (and time if applicable) to the record. (Edit: are you looking for a mechanism to accomplish this? If so post your current DayRender handler code and Calendar markup).

    2) To populate individual day data in a calendar, use Calendar.VisibleDate (to filter DB results) in a Page.Load handler to load a data structure (such as a List<T>) with day data for the entire month. Then in a Calendar.DayRender handler, add appropriate records from the structure to the e.Cell.

    3) To cause the new results to show up on the first page refresh after insertion, you should be able to get away with using a Response.Redirect to the current page after insertion. This will cause the page generation process to restart, but you will lose ViewState.


    Edit: Here is a basic prototype of what I tried to describe above. Note that you could pre-fetch into any enumerable data type, I use a List<T> here.

    //Page code-behind
    public partial class Default2 : System.Web.UI.Page
    {
        List<DataObject> liCurrentMonth = new List<DataObject>();
    
        protected void Page_Load(object sender, EventArgs e)
        {
            liCurrentMonth = DataObject.GetCurrentMonth(Calendar1.VisibleDate);   
        }
    
        protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
        {
            foreach (DataObject item in liCurrentMonth)
            {
                if (item.date == e.Day.Date)
                {
                    Literal lit = new Literal();
                    lit.Text = item.text;
                    e.Cell.Controls.Add(lit);
                }
            }
        }
    }
    
    //Data layer object
    public class DataObject
    {
        public DateTime date { get; set; }
        public string text { get; set; }
    
        public static List<DataObject> GetCurrentMonth(DateTime currentdate)
        {
            //Get items from the db here, based on currentdate parameter
            //and populate the List<DataObject>.
            return new List<DataObject>();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several Outlook Calendars. I want to be able to create one event
I'm new to vs10 and I'm trying to make a customized schedule/calender using WPF.
Please help me about this issue... In my application i have calender where user
i have invoked blackberry calender from my application can anyone tell me how to
I have a calendar control derived from DataGridView. A custom item hover event is
I have a calendar feed (.ics) available from my application, but it's quite large
I have a calendar on my website, generated in Perl using Template::Toolkit and Template::Plugin::Date
I'm making an online calendar. One will be able to create en event and
I have a jquery datepicker and I need to be able to change the
I have a calender and I nested a itemscontrol within the calendars itemscontrol so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.