C# - Comparing Two Times That Are Shown On Form As Dropdowns For Hours And Minutes

Feb 8, 2011

I have been working on a .NET/C# form that contains two time fields that are built out of dropdowns. Time A is made up of two dropdowns for Hours and Minutes and Time B is made up of two drop downs for hours and minutes too. I need to compare the two in order to ensure that Time A is always greater than B. I could just use a CompareValidator to check the hours, that works BUT doesn't take into account the minutes. So lets assume the following scenarios:

A = 11:00 B = 12:15 is fine my validation accepts this as it should do
A = 11:15 B = 11:00 is accepted because the hours are equal but otherwise shouldn't pass as the minutes aren't validated

How would you ensure B is always equal to or greater than A where dropdowns are used? I would if I could change this but not permitted to do so.

View 2 Replies


Similar Messages:

Add Hours And Minutes To The String?

Jun 2, 2010

I have the date format string dd-mm-yy. how to add hours and minutes to the string (i.e 13-03-2010.21.03) ....

DateTime.Today.ToString("dd-mm-yy") ?

View 5 Replies

Creating Data With Hours And Minutes?

Jan 12, 2010

I have a textfield where they can enter a date, a hour drop down and a minute dropdown.

What I would like to do is after i get the values for each to create a DateObject which has all 3. i.e 12/02/2009 15:36

But then also how dismantle the Date Object to get back my 3 individual values

View 4 Replies

Web Forms :: Convert Minutes To Hours And Display Using C#

May 7, 2015

my output is 87:02 hours 87 minutes 2

using (SqlConnection conn = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT CONVERT(VARCHAR(10),InTime,108 ), CONVERT(VARCHAR(10),outTime,108 ) FROM aten WHERE Id = '" + txtid.Text + "' and date between '" +

[Code].....

View 1 Replies

State Management :: How To Increase Session Timeout From 20 Minutes To 1 Or 2 Hours

Jul 28, 2010

In my webconfig i put

<system.web>
<sessionState timeout="60"/> doesn't work for me

Also i changed in IIS configration Manager as well from 20 minutes to 60 minutes, but still it expire after 20 minutes of no actiuvity.

View 8 Replies

Calculating Years, Months, Days, Hours, Minutes, Seconds Between Two Dates?

Oct 20, 2010

I'm trying to calculate the yrs, months, days, hours, mins, seconds between two dates with sql server or c# (ive just used sql more).

I have some code below that I started, but I get some negative values for months, values over 31 for months, and there very well could be more issues. Honestly my math is not the greatest and Im just not sure how to fix it. I want the user to be able to enter their birthday and for it to calculate the yrs, months, days, hours, mins, and seconds they have been alive.

[Code]....

View 5 Replies

Web Forms :: Calculate Relative Time - Minutes / Hours Or Weeks Ago In Words

May 7, 2015

I would like to get the accurarte (days, minutes, months and years) differnce between two date time variables and not just who is greater.

Is there a better way to do it then run DateTime's methods (TotalDays, TotalHours, TotalMinutes. etc...) and do the calculation?

The bottom line is to display something like "a minute ago", "an hour ago", "Three weeks ago", etc...

View 1 Replies

SOAP Call Times Out After 20 Minutes

Jun 3, 2010

We have an ASP.Net web service the call to which, due to some bad design, often takes more than 20 minutes to return. We have changed every setting that we can think of, but no matter what we do, we always get a timeout after 20 minutes. It happens that this web service is a BizTalk orchestration exposed as a web service, but I do not think that is relevant -- the error is an ASP.Net error.

There must be some setting we can change to increase the timeout to more than 20 minutes, but we've exhausted our knowledge. What setting are we missing? EDIT: Among other setting, we have tried those detailed here: [URL], which includes httpRuntime executionTimeout, sessionState timeout and app pool idle timeout.

View 2 Replies

AJAX :: Request Takes A Few Minutes Then Times Out - Only In Firefox

Nov 22, 2010

I have a very peculiar problem that I've been wrapping my head around and I just can't figure it out. I have an updatepanel. Inside that I have a TabContainer. And inside that I have three TabPanels, each of which has checkboxes. Sometimes (and it happens often enough that I can easily reproduce it, but strangely may not happen with the same exact steps), when I click on different tabs or click on checkboxes inside the tabpanels (basically when I do an AJAX async postback), the request takes about a few minutes, after which the request just stops. Looking at the Firefox error console, I see this popping up after a few minutes...

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0 Now, the asyncpostbacktimeout property for the ToolkitScriptManager is set at 360000, which is 6000 minutes, so the problem has nothing to do with that setting. In IE, I never have this problem and the AJAX requests are instantaneous and smooth, no delays. So this isn't a network or database lag issue. Something to do with how AJAX is run in Firefox. Why is it that sometimes, an AJAX request in Firefox takes a few minutes and just stops processing the request? And once again, the steps to reproduce this problem may not be the same every time, it seems random - very strange. Google searches have yielded very little help on this. I've tried things like extending the timeout property (which again has nothing to do with this), setting Response.Cache.SetNoStore() everywhere. Is there a crude workaround I can do (at this point, I'm willing to settle for a workaround). I just don't know anymore.

View 1 Replies

Webforms Site Using HTTPCookie With 100 Year Timeout Times Out After 20 Minutes

Jun 11, 2010

I have a site that is using Forms Auth. The client does not want the site session to expire at all for users. In the login page codebehind, the following code is used:

// user passed validation
FormsAuthentication.Initialize();
// grab the user's roles out of the database
String strRole = AssignRoles(UserName.Text);
// creates forms auth ticket with expiration date of 100 years from now and make it persistent
FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1,
UserName.Text, DateTime.Now,
DateTime.Now.AddYears(100), true, strRole,
FormsAuthentication.FormsCookiePath);
// create a cookie and throw the ticket in there, set expiration date to 100 years from now
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
FormsAuthentication.Encrypt(fat)) { Expires = DateTime.Now.AddYears(100) };
// add the cookie to the response queue
Response.Cookies.Add(cookie);
Response.Redirect(FormsAuthentication.GetRedirectUrl(UserName.Text, false));

The web.config file auth section looks like this:

<authentication mode="Forms">
<forms name="APLOnlineCompliance" loginUrl="~/Login.aspx" defaultUrl="~/Course/CourseViewer.aspx" />
</authentication>

When I log into the site I do see the cookie correctly being sent to the browser and passed back up: However, when I walk away for 20 minutes or so, come back and try to do anything on the site, the login window reappears. This solution was working for a while on our servers - now it's back. The problem doesn't occur on my local dev box running Cassini in VS2008.

View 3 Replies

State Management :: Comparing Old And New Data On A Form?

Jul 10, 2010

I have a form on which there is a repeater control for showing records in a grid-like format. On the same page, if we click on edit row link, the details for that row come into view. After editing, we click the save button to save the data and return back to the grid [Note that all these controls are on the same page]

This process is followed for say 3 records.

After this, I would want to view only those rows for which the values have been changed (alongwith the old and the new values)

How can this be achieved? Can Datatable.getchanges() help in such a case? If yes, how? Or are there any other options that I could go for?

View 6 Replies

Web Forms :: Dropdowns Validations - Make Sure That User Has Selected Something From The Dropdowns Otherwise Can't Proceed

Dec 6, 2010

I am using panel to hide and display certain controls on a page, On one of my panel i have three drop down, all i want is to make sure that user has selected something from the dropdowns otherwise they cant proceed, i am using the requiredfield validator but its just not working

[Code]....

View 9 Replies

Dropdownlist - Convert A Bunch Of Dropdowns Into An Array Of Dropdowns?

Mar 11, 2011

I have 45 dropdown lists in my asp page. There are some methods that I can apply to all of these dropdowns. Is it possible to convert them into an array of dropdowns for ease of use?

View 2 Replies

Web Forms :: Web Form Is Shown As Blank First While Loading?

Jan 16, 2011

I have created login page in which if user credential are incorrect it will show the message through jquery notification bar.But, what is happening when page is being postback it will show complete blank page after that it will load the controls of that page and then the error message will be shown if it is there. So, its taking quite a long time .So, how can we access or load the page in faster way?? or should i make any changes while postback?

View 2 Replies

Web Forms :: Memory Usage (consumption) Of Individual Controls On A Web Form Shown In A Browser?

Oct 12, 2010

Is there a way to check the memory usage (consumption) of individual controls on a web form shown in a browser. Like Repeater Control, Multiline Text box etc. The reason is I am putting the repeater control in session and checking the status of controls, based on which I am doing further actions.

View 2 Replies

Security :: How To Redirect The User After 2 Minutes If There Is Inactivity For 2 Minutes

Feb 13, 2011

I want to redirect the user after 2 mins if there is inactivity for 2 mins. I am not using ASP.NEt membership. And I dont want to use Sessiontimeout for this. Session timeout will logout the user even if he is working on the system. My objective is like screensaver process.

If there is no action for the specified time, the screensaver runs. Similarly, I want to redirect the user to login page.

note that i have already handled it with the following javascript:

[Code]....

Here what my problem is,

the user is working on the site...ok.. he want to see someother site.he browse someother site and works on....or even he can do some other work in his system...but he is active in his system... What this script does is, it automatically logout the user and redirect him to login page. But it should not do while he is active...IT SHOULD REDIRECT IF HE IS NOT ACTIVE REALLY (Similar to Screensaver process)

Is it possible ?

View 1 Replies

Security :: Didn't Run All Three Applications In Same Times And Also Form Authentication Crossed?

Jul 10, 2010

We are upgrading the asp.net 2.0 web application to asp.net 4.0.

The application contain three main modules (sub application) like End User, Franchise and Admin with separate web.config, asp.net form Authentication, login page and running with single domain.

the URL like,

mydomain.com/login.aspx
mydomain.com/franchise/login.aspx
mydomain.com/admin/login.aspx

In asp.net 2.0, working fine with 3 sub applications with separate form authentication under a single domain name and also we can working with all threes in same time.

After the up gradation process (ASP.NET 2.0 to 4.0),

We didn't run all three applications in same times and also form authentication crossed.

View 7 Replies

MVC :: Ajax Loaded Partial View Form Submits Multiple Times?

Feb 2, 2011

I am trying to implement an ajax form inside of a jquery ui dialog.

I have a view with a button that opens the modal dialog form, makes an ajax call to an action that loads a partial view into the dialog. The partial view consists of a form created via Ajax.begin form. When I post the form I close the modal and update a div on my main page. This all works fine.

The problem is, the next time I open the modal and submit the form the http POST for the form is called twice. The third time I open/submit the form is submitted 3 times and so on...

It seems as if the submit button/form is bound multiple times and I cant figure out how to fix this.

Here is my code...

first the jquery call to load the ajax form partial view and create the modal...

[Code]....

here is the ajax form partial view...

[Code]....

and the js callback when the form is submitted

[Code]....

View 4 Replies

Gridview Footer / Total Hours In The Footer (sum Of Hours For All Rows)?

Jan 29, 2011

I have a grid view which contains Hours as one of the columns.. now, i need to have a total hours in the footer (sum of hours for all rows).

View 2 Replies

Forms Data Controls :: Displaying Data On Gridview Based On Time Form 15 Minutes

Nov 9, 2010

I have a Transport Detaisl in DB , i want to dispay data on gridview with marquee scrolling up. Cabs are scheduled for drop every hour. So if drop is at 7pm i hav to dispaly on data of that hour from 6:30 to 7:15 later after 7:15 i have to display next hour data ie 8:00 pm drop data. I am able to get scrollin g data on gridview but how to schedlue it to scroll for such timings

View 1 Replies

Forms Data Controls :: GridView PopUpEdit Form - Show Fields Not Shown In GridView's Columns

May 4, 2010

Currently I have something like this, but when I click "update" the record doesn't get updated (but no error is returned).

[Code]....

View 5 Replies

Web Forms :: How To Calculate The Hours

Sep 25, 2010

How would you calculate the hours?

Example:
05:00 15:00 = 10 hours
07:00 12:00 = 5 hours
12:15 to 14:30 = 2 hours 15 minutes.

View 2 Replies

Executing A C# Function After Each 24 Hours?

Mar 20, 2011

I have a c# function for producing thumbnail images, these images are displayed on web-page i.e ASP.netSo how would i programtically call this back-end function let say everyday at 16:00 or at 3:00.

View 3 Replies

SQL Server :: Get Data During Last 24 Hours?

Aug 15, 2010

How do I get the data during last 24 hours ?

View 5 Replies

Show Data 24 Hours?

Nov 22, 2010

i have 30 data. i want show 24 hours at 24 hours only a data.

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved