I am really stucked at this.what i want is that there should be 6 table cells in which i should have days with date. like Monday 4/3/2013 Tuesday 5/3/2013 and so on till saturday .i have two more buttons,previous week and next week button.. it should automatically show next week when i click the next week button and should show the previous week whenever i press the previous button.. also the i need to take the value of days/month and year so that i can use them in where clause in my sql query..pls its urgent can anyone help me with this...
我真的很痴心于此。我想要的是应该有6个表格单元格,我应该有几天的日期。喜欢周一2013年4月3日星期二2013年5月3日星期二等到星期六。我还有两个按钮,上周和下周按钮..下周我点击下周按钮时会自动显示,并应显示前一周,每当我按下前一个按钮..也是我需要采取天/月和年的值,以便我可以在我的SQL查询中的where子句中使用它们.pls它的紧急任何人都可以帮我这个.. 。
im providing a link you can see what exactly i want by visiting this link
即时通讯提供链接,您可以通过访问此链接查看我想要的内容
www.test.ginormous.in/dinesmart/Filestore/Food/Capture.png
www.test.ginormous.in/dinesmart/Filestore/Food/Capture.png
1 个解决方案
#1
1
i am just giving you the outline as posting the whole code is not possible.
我只是给你大纲,因为发布整个代码是不可能的。
- create an asp:panel in your aspx page
- 在aspx页面中创建一个asp:面板
- try generating the table structure dynamically inside that panel by writing myPanel.innerhtml = "(your html structure generated in a string)"
- 尝试通过编写myPanel.innerhtml =“(在字符串中生成的html结构)在该面板内动态生成表结构”
- use theDate.AddDays(7 - (int)theDate.DayOfWeek) to get the date for this weeks sunday.(where theDay is the current date or the date given by you and change 7 to 6 if you want it for monday as this returns date for sunday etc..)
- 使用theDate.AddDays(7 - (int)theDate.DayOfWeek)来获取本周星期日的日期。(其中theDay是当前日期或您给出的日期,如果您希望它为星期一,则将其更改为7到6,因为它返回星期日等的日期..)
- on previous and next click you can add or subtract 7 days from the first day of the weel that is generated above.
- 在上一次和下一次点击中,您可以在上面生成的weel的第一天添加或减去7天。
hope this helps you.
希望这能帮助你。
#1
1
i am just giving you the outline as posting the whole code is not possible.
我只是给你大纲,因为发布整个代码是不可能的。
- create an asp:panel in your aspx page
- 在aspx页面中创建一个asp:面板
- try generating the table structure dynamically inside that panel by writing myPanel.innerhtml = "(your html structure generated in a string)"
- 尝试通过编写myPanel.innerhtml =“(在字符串中生成的html结构)在该面板内动态生成表结构”
- use theDate.AddDays(7 - (int)theDate.DayOfWeek) to get the date for this weeks sunday.(where theDay is the current date or the date given by you and change 7 to 6 if you want it for monday as this returns date for sunday etc..)
- 使用theDate.AddDays(7 - (int)theDate.DayOfWeek)来获取本周星期日的日期。(其中theDay是当前日期或您给出的日期,如果您希望它为星期一,则将其更改为7到6,因为它返回星期日等的日期..)
- on previous and next click you can add or subtract 7 days from the first day of the weel that is generated above.
- 在上一次和下一次点击中,您可以在上面生成的weel的第一天添加或减去7天。
hope this helps you.
希望这能帮助你。