Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Dear Xtremers,

 

I have 4 dropdownlist controls which let users to select the task Starttime and endtime:

 

There is a datagrid which have 2 controls in each of the editItemtemplate. They are (in editItemTemplate A:) StartTimeHrDDL, StartTimeMinDDL & (in editItemTemplate B:) EndTimeHrDDL, EndTimeMinDDL. And because these controls are created in runtime. I place the validator control in the end of editItemTemplate B too.

 

I found no problem when compare EndTimeHrDDL with StartTimeHrDDL (I want to make sure EndTime should not be lesser then StartTime). However, I want to perform the same validation to the StartTimeMinDDL & EndTimeMinDDL ONLY if StartTimeHrDDL = EndTimeHrDDL.

 

Because I cannot write a if..else statement in the runtime (if it is possible, please teach me!), I try to call a function like <%# GetResult() %> to get the result of the validation between StartTimeHrDDL & EndTimeHrDDL but fail.

 

Could anyone give me some idea? Thanks

Posted

This validation could easily be done on the client-side.

My idea is to use Javascript (or VBScript) to make a client validation. It's time so it's easily "decryptable" by Javascript and since it's DDL... user won't mess up everything.

 

Go with Javascript

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...