.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Display previous week and following week of Timesheet on webpage

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :ASP.Net

I am new to ASP.Net & C# so bear with me.

I have a working timesheet which displays on a webpage, what I was also wanting was to display the previous week and the following also on the same page.  Can anyone help with this?  I will attach both the .aspx page and the aspx.cs page.  I have hardcoded the date into the webpage just for ease of reference at the moment.

Your help would be appreciated.


aspx.cs page:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;

public partial class Timesheet : System.Web.UI.Page
    String strConn = "";
    DataTable dtTaskStaffList = new DataTable();
    DataTable dtTaskEditList = new DataTable();

    protected void Page_Load(object sender, EventArgs e)
        strConn = System.Configuration.ConfigurationManager.ConnectionStrings["CMConnectionString"].ConnectionString;

        if (!Page.IsPostBack)
            //txtCalendarDate.Text = DateTime.Now.ToString("dd/MM/yyyy");


    protected void 

View Complete Post

More Related Resource Links

dropdownbox which selects records based on criteria (TODAY, THIS WEEK, THIS MONTH, etc)


I have a dropdownbox which I want to use to search records based on a timescale. The gridview populates results based from that search.

So here is how I want to work this;

If a user selects "today" - a list of records input today are populated. If "this week" is selected, a list of all records added within that week from todays date is populated.

I created a forum on this issue previously but to no avail whatsoever. How do I work around this problem?

Help would be much appreciated

Display 'Top Queries Over Previous 30 Days' to users


In the Site Usage Reports, there is a section for 'Top Queries Over Previous 30 Days'. I would like to display this information to users. 

Is there a existing webpart for this? 
Is the data stored in a list that can be used for this purpose?


Steve Clark

IE cannot display the webpage during report execution

Hi. I have a problem with a report having some T-SQL and MDX queries. When I execute it during the working hours I have an error about that Internet Explorer cannot display the web page, but in the other hours the execution is completed successfully. I have a look inside RS log but I cannot find any errors; no timeout is set about report execution inside the Report Manager. Any ideas to solve this issue, please? Many thanks

Silverlight gives the error "Internet Explorer cannot display the webpage"

Hello, I'm new to SharePoint 2010.  I have an SP2010 environment up and running.  When I click on a link that activates Silverlight, I get an error that reads "Internet Explorer cannot display the webpage".  The Server is on a different domain. When I use remote desktop to access the server, I can open up the same link using IE and I can see the content no problem. An example would be from the calendar page.  If I choose a date and select 'add', the browser fades and I see a 'loading' screen.  Then the next screen I get the error.  If I follow the same process on the server using remote desktop, everything works. What could the problem be?

SSAS Calendar Week commencing with split at month

Hi all, Wonder if someone can help. Our CFO wants to see a cube calendar that shows week commencing but stops at the end of month. For example if the dates are Monday  28th   Tuesday  29th   Wednesday 30th   Thursday 1st    Friday  2nd Saturday 3rd Sunday   4th So for this example the week commencing is the 28th of Month 1 and Thursday is week commencing 1st of the next. I am having a problem seeing how I can do this. If I add the weeks to a standard calendar I get the week commencing 28th which includes the 7 days, naturally. I cannot help feeling I am missing something obvious. Cheers

Is there a way to disable the day and week links within the Calendar itself?

I'm able to hide the top icons. I'm wondering if there's a way to keep a user from clicking the top of a date or the side of the week and navigating them to another calendar view. I only want to keep them within the month view. Thanks in advance! -Mike

"Internet Explorer cannot display the webpage" from IE7 - ASP.NET Development Server Error?

Dear everybody, I've just installed Microsoft Visual Studio 2008 on Windows Vista Ultimate. I created "New Web Site" and Started Debugging the page to see the blank page rendered. To my surprise, IE 7.0 displayed an error message saying: "Internet Explorer cannot display the webpage". I spent some time investigating and here is the result: The page going to be rendered assumes port 49791: http://localhost:49791/WebSite3/Default.aspx The ASP.NET Development Server operates under different port no: 49793 After changing the url above manually to use the port of ASP.NET Development Server, the webpage gets renderred correctly: http://localhost:49793/WebSite3/Default.aspx ASP.NET Development Server uses dynamic ports. I noticed that Debugging process always assumes port number lower by 2 than the real port number of the ASP.NET DevSer. Therefore Debug process never runs and displays the page. I do not want to manually edit the local host URL after every page rebuild, so my question is following: How to make the "Start Debugging" function to use appropriate port of the ASP.NET Development server? How to make Visual Studio to open the page being debugged? To mention couple of things I tried: I reinstalled Visual Studio2008, tried to disabled IPv6 as some threads recommen

Grouping by week, but show day range

SELECT SUM(T.SPEED_OCCURRENCES) AS TOTAL_SPEED_OCCURRENCES, CONVERT(NVARCHAR, DATEPART(WEEK, T.DATE), 101) AS STRDATE FROM VEHICLE_TRENDS T, @VIEWABLE V WHERE T.VEHICLE_ID = V.VEHICLE_ID AND T.DATE BETWEEN @START_DATE AND DATEADD(DAY, 1, @END_DATE) GROUP BY DATEPART(WEEK, T.DATE) ORDER BY [STRDATE] ASC; So we have a query that returns results like: TOTAL_SPEED_OCCURRENCES       STRDATE 34                                               34 45                                               35 67                                               36 Where STRDATE is the week number. This is correct grouping, but we want STRDATE to select the range of day

How I select Start of week is Friday from date of Year ?

Hello everyone, I am tring to solve How i select Start date is Friday from week? Details for which i want to show I have dtmDate column in a query. from that date i display week of that date as per using (ww,dtmDate) as dtmWeek, and parameters are StartDate & EndDate Suppose I select StartDate as 1/1/2007 & End Date as 12/31/2007   I  do not want to show Output as: Weeks                      Column1          Column2 1/1/2007 (Thuesday)       5                     6 1/2/2007 (Wed)               4                     2 | | 1/5/2007  (Friday)            1                      8 1/6/2007 (Saturday)        7                     

MDX Query - Find only new item that purchased in the last day or during the last week

Hi to all I whould like to write a MDX query to get new items that purchased in the last day and not purchased in the last 7 days or 30 days  , Also to find new items that purchased in the last 7 days and not purchased in the last 30 days , this is what i done until now CREATE   SET CURRENTCUBE.[FindNewWordIn_1_Day]   AS Filter   (nonempty([Keyword].[Keyword Name].members, ([Measures].[Count keyword],   NONEMPTY (Tail( Filter( [Time].[Date].MEMBERS ,   Not IsEmpty ([Measures].[Count keyword]) ), 1) ))) ,([Measures].[Count keyword], [Time].[Date].&[2010-09-10] )=0);   The value of [Time].[Date].&[2010-09-10] should be change to period that i want to check , ( 1 day, 7 day , 30 day)   the other one is lateset day with value NONEMPTY (Tail( Filter( [Time].[Date].MEMBERS , Not IsEmpty ([Measures].[Count keyword]) ), 1) with for you help ,   ofer  

SQL WEEK function

Does SQL 2005 have a week function? If not how can I find the week in a SQL SP.   Thanks!!! 

YEAR --WEEK of the YEAR -- DAY of the WEEK to datetime

Good Evening Can someone help me covert a string in the format YEAR --WEEK of the YEAR(1-53)  -- DAY of the WEEK(1-7)to datetime ie 2010-38-6 is today = '2010-09-17'  valid sql server date nb day numbers are 1 to 7, 1= sunday thanks   David          

Week no


I have to find the no of the week, dies anyone know a way to capture the week no Ex:

I use 



datepart(wk, '2010-07-29') - 26 AS 'Current Date'



logic for Custom Start Day and End Day for a week.


Hi All,

We have a unique requirment where we have our own start day of a week and end day of a week(C#),

Contrary to the existing Date Time class whose start day is Sunday and end day is Saturday, we have Wednesday as our start day and Monday as our EndDay (and this will vary per client).

and we need to implement the following logic

a) for a given date get the start Date of a week and end Date of a week

Ex: based on the above if the current day is  23/Sep/2010 (Thur) we need to get  22/Sep/2010 (Wed) as our Start Day and 27/Sep/2010 (Mon) as our end day


Can anyone help here?




How to schedule the custom timer job two times a week to run in MOSS




I have scheduled a custom timer job to run for weekly two times using the spschedule. the string used in the feature event was

"weekly between tue 23:00:00 and thu 23:00:00"

But the problem is i have the job is running only once with the above schedule.How can i run the job twice a week on specific days.


Please share your ideas/solutions to run the custom timer job in  MOSS as per the above schedule.






Thanks keshav,Share point Developer

Last day of month and last day of the week Using MTD,YTD

How Can I achive Last day of month and last day of the week Using MTD,YTD function in SSAS Qube ?

select records within a week


i try to use select statement to select records within a week from orderdate. like,


"select * from order where orderdate <= DATEADD(day,7,orderdate)";


correct me if wrong.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend