asp.net压延机问题 [英] Problem with asp.net calender

查看:100
本文介绍了asp.net压延机问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我正在使用asp.net日历,以绿色显示数据库中可用的日期,而在栗色中显示其他日期.
为此,我将日历的DayRender事件用作

Hi All
I am using asp.net calender showing dates available in databse in Green color and others in Maroon.
For this i am using DayRender Event of Calender as

protected void Calendar2_DayRender(object sender, DayRenderEventArgs e)
   {
       //to clear all dates
       e.Cell.Controls.Clear();
       //HtmlGenericControl lk = new HtmlGenericControl();
       if (e.Day.Date.Month == Calendar2.VisibleDate.Month)
       {
           //lk.TagName = "a";
           //lk.InnerText = e.Day.DayNumberText;
           bool sts = _roomInventory.CheckRoomAvailability_By_Date(e.Day.Date, Server.MapPath("XML/WROOMINVENTORY.xml"), Server.MapPath("XML/WROOMMASTER.xml"), Server.MapPath("XML/WROOMCATEGORY.xml"));  
       if (sts == true)
               e.Cell.BackColor = System.Drawing.Color.Green;
           else
               e.Cell.BackColor = System.Drawing.Color.Maroon;
           e.Cell.ForeColor = System.Drawing.Color.White;
           //lk.Attributes["href"] = "#";
           //e.Cell.Controls.Add(lk);
           e.Cell.Controls.Add(new LiteralControl(e.Day.DayNumberText));

       }
   }



现在我希望当我从日历中选择一个日期时,也选择下一个''N''日期.这里''N''是存储在 Session ["N"] 中的数字.
为此,我正在尝试在
中编写代码 Calendar2_SelectionChanged
但是,当我单击日历中的任何日期时,不会触发 Calendar2_SelectionChanged .

谢谢.



Now I want that when i select a date from calender the next ''N'' dates also get selected. Here ''N'' is a number stored in Session["N"] .
For this i am trying to write code in
Calendar2_SelectionChanged
But when i am clicking any date in calender Calendar2_SelectionChanged is not fired.

Thanks in advnce.

推荐答案

我看不到您的控件属性.无论如何尝试

构建事件日历Web应用程序 [构建事件日历Web应用程序,第2部分 [
I can''t see your control properties. Anyway try this

Building an Event Calendar Web Application[^]

Building an Event Calendar Web Application, Part 2[^](You need this part)

check the properties of calender control & code too with yours. Let us know again.


这篇关于asp.net压延机问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆