i created a page with validates. now i want to add the back buttion but when i click it all the validates comes "up". how can I cancel them? maybe with a gruop or somthing?
an the secound qustion is about time, i have like that HH:MM. the time tyoe is string,how i compare them now?
I have an add button that needs to only validate the child validation group which is easily done. The save button needs to validate against the parent and child validation groups, both client side and server side. I think I know how to do it server side by calling the Page.Validate("groupname") method for each group, but how can it be done client side?
I need to be able to validate multiple validation groups with the click of one button. My Form consists of two text boxes and a drop down list for input. The form also, currently, has three buttons, one for each control. Each of those buttons are tied to a validation control and if the validation is successful, it will add the user inputted data into a database that I have. The interesting part comes when I need to add a forth button which will act as a "Save All" Button. When this button is clicked, I need it to fire the three validation groups.
Is it possible to add multiple validation groups to the "Save All" Button?
I have a Dynamic GridView on a page as below. The user can add or delete rows. When inserting record, the code is executed one row at a time. I have 3 rows to be inserted to the database. Here is the issue:
-if the first row is not completed, then no record is added to the database
-if the first row is completed and the second row is not, then only the first row is inserted in the database
-if the first row is completed, the second row is not complete, and the third row is completed, then only the first row is inserted in the database.
How to arrange this piece of code to validate all rows before any insert? or avoid inserting a row if there is one row not complete?the conditions starts with int rowIndex = 0;
I have an asp.net control textbox, clicking on which a jquery timepicker appears and user can select any time.But I want to validate the selected time so that it is one hour greater than the current time in the client side. I mean when textbox value will be changed it should be validated.
I can access the website I've created on my local machine in debug mode; and with my domain account as a local administrator, if I do this:
[Code]....
I can still access the website; and with my domain account in a Domain Group named "DomainDomainLocalSecurityGroup", if I do this:
[Code]....
I can still access the website; HOWEVER, if I create a Local Group on my machine named "LocalMachineGroup" and I add "DomainMyDomainUserName" to this group and I do this:
[Code]....
I get an Access Denied error trying to access the website. What I want to do is, have a group on my local machine (for testing), on a test web server, and on a production web server named "MyWebsiteUserAccess" with the same Domain Group (filled with Domain Users allowed access to the site) in all of these local groups; so that when I test the web application on my local machine, on my test web server and on my production web server, I don't have to change the Web.config file to have it work on each AND if the Domain Group name ever has to change, it won't affect access to the website.
What am I overlooking or is this even possible to do this way? I understand that there is a way to do Role Management through ASP.NET but I don't understand that well enough yet to implement that (and will probably go that route once I've done the research on how to best implement it for purpose of access control of this intranet site).
I have a user that when I attempt to enumerate her groups using either System.Security.Principal.WindowsIdentity.GetCurrent().Groups on user's computer or System.Web.HttpContext.Current.Request.LogonUserIdentity.Groups on the IIS server, I get a list of their old groups, not their new. I have checked the DC that they authenticate to and the ASP.NET page is running inside a SharePoint instance so the LogonUserIdentity most like is being provided from there Kerberos ticket. Should I be looking up the groups directly from the AD instead of relying on the WindowsIdentity or LogonUserIdentity?
i have a code to get the groups a user belongs to.
try { DirectoryEntry adRoot = new DirectoryEntry(string.Format("WinNT://{0}", Environment.UserDomainName)); DirectoryEntry user = adRoot.Children.Find(completeUserName, "User"); object obGroups = user.Invoke("Groups"); foreach (object ob in (IEnumerable)obGroups) { // Create object for each group. DirectoryEntry obGpEntry = new DirectoryEntry(ob); listOfMyWindowsGroups.Add(obGpEntry.Name); } return true; } catch (Exception ex) { new GUIUtility().LogMessageToFile("Error in getting User MachineGroups = " + ex); return false; }
the above code works fine when i have to find the groups of a local user but
for a domain user it returns a value "Domain User" which is kind of wierd as it is a part of 2 local groups.
Research
I did some finding and got that i am being returned the primary group of the domain user
called "Domain User" group
but what i actually want is the groups of the local machines the domain user is a part of... i cannot get that.. any suggestions
another code using LDAP
string domain = Environment.UserDomainName; DirectoryEntry DE = new DirectoryEntry("LDAP://" + domain, null, null, AuthenticationTypes.Secure); DirectorySearcher search = new DirectorySearcher(); search.SearchRoot = DE; search.Filter = "(SAMAccountName=" + completeUserName + ")"; //Searches active directory for the login name search.PropertiesToLoad.Add("displayName"); // Once found, get a list of Groups try { SearchResult result = search.FindOne(); // Grab the records and assign them to result if (result != null) { DirectoryEntry theUser = result.GetDirectoryEntry(); theUser.RefreshCache(new string[] { "tokenGroups" }); foreach (byte[] resultBytes in theUser.Properties["tokenGroups"]) { System.Security.Principal.SecurityIdentifier mySID = new System.Security.Principal.SecurityIdentifier(resultBytes, 0); DirectorySearcher sidSearcher = new DirectorySearcher(); sidSearcher.SearchRoot = DE; sidSearcher.Filter = "(objectSid=" + mySID.Value + ")"; sidSearcher.PropertiesToLoad.Add("distinguishedName"); SearchResult sidResult = sidSearcher.FindOne(); if (sidResult != null) { listOfMyWindowsGroups.Add((string)sidResult.Properties["distinguishedName"][0]); } } } else { new GUIUtility().LogMessageToFile("no user found"); } return true; } catch (Exception ex) { new GUIUtility().LogMessageToFile("Error obtaining group names: " + ex.Message + " Please contact your administrator."); // If an error occurs report it to the user. return false; }
this works too but i get the same result "Domain Users" . Please can some1 tell me how to get the local machine groups...?
I want to validate Time-Start and Time-End. The time format is like this 2:15:00 AM I want to make sure that the Time-End must be greater or equal to the Time-Start.
The Time-Start gets the time from DropDownListHourStart(1-12) and DropDownListMinuteStart(1-59) and DropDownListSecondStart(00) and DropDownListAMPMStart(AM-PM) The Time-End gets the time from DropDownListHourEnd(1-12) and DropDownListMinuteEnd(1-59) and DropDownListSecondEnd(00) and DropDownListAMPMEnd(AM-PM)
I want to check that time-end is equal to or greater than time-in. Can you show me any time validation technique? Whether it's jQuery, JavaScript, or ASP.NET control validator.
I have two validationsummary controls on my page for aesthetic reasons. Each control is assigned a validation group (StudentInfo and Grades). validation controls in the upper part of my page are in validationgroup StudentInfo and those in the bottom part of my page are in validationgroup Grades.
However, I only have one "Save" button control that causes validation. I want the Save button to validate both groups of controls, but it appears to only allow one Validation group to be specified in its properties.
Is there a way to have a button cause validation for both groups?
I found one link or web services [URL] which enable me to search whether email id exist in real world or not...Did some testing and it works. Is it possible to make similar web services and use it in my application? because i am not sure till what date this web services will work.
I'm using AjaxToolkit and it works just fine. In one form i'm using the Time field (MaskedEdit). I need to validate Time field only if a tickbox is ticked. Is it possible?
Data annotation to validate an inbound model in MVC:
public class ValidNumber { [RegularExpression(@"^d+$", ErrorMessage = "*")] public string number { get; set; } }
Would I need to create my own class to validate a List<string> or can I do something like this? What code could I write in C# to add a Regex validator for a list of string?
public class ValidNumberList { [RegularExpression(@"^d+$", ErrorMessage = "*")] public List<string> numbers { get; set; } }
How to validate particular format date string using Javascript?I have one date picker which has the display format like "dddd MMMM dd,yyyy"(displaying like this:"Wednesday February 03, 2010".)So i have to validate this format using javascript.Please help me for implementing this.
i am displaying some news from rss feeds in the page. But i am stuck up in the date time conversion. I got th published datetime as pdt formated string. How can i convert to my local time. Coversion from the pdt string tot DateTime is error..
[Code]....
This second line is error and i need the result in the specified format or same format as in the published date but in local time ie IST (India Standard Time)
I want to enter date/time in the following format 22-02-2011 6:11:00 PM So how can i validate this and user should be restricted to enter any other value