I know the unobtrusive client validation is required using Html.XXXFor to generate the input html. But in my project, I want to use Html.TextBox(), and also want to use unobtrusive client validation. I think you'd better expose a extension method like Html.TextBox(..., ModelMetadata,... ) allow me pass the ModelMetadata manually.
I'm trying to add a validation support to DropDownList by creating a custom control inheriting from DropDownList:
public class MyDropDown: DropDownList, INamingContainer { private const string ValidatorID = "Validator"; private RequiredFieldValidator _validator;
[Code]....
My class implements INamingContainer because I wanted to avoid naming conflicts. Unfortunately when I try using this control I get the following exception:
Unable to find control id 'MDD' referenced by the 'ControlToValidate' property of 'MDD_Validator'
This is happening beause for INamingContainer FindControl(NamingContainerId) returns null.
When I remove INamingContainer implementation and set validator ID in the following way:
i'm working on a MVC3 webapp and my Model consist of many classes that use a custom type (TextRef) for textual properties. for example my Product entity looks like :
[Code]....
TextRef :
[Code]....
so in my views i'm using :
[Code]....
how could i add validation support to TextRef items ? for example making Product.Title required
We are developing a web solution for our clients to handle their business processes. With reality in check, clients' requirements change over time; sometimes adding a new field, changing the calculation logic etc. When it was still a small scale solution, whenever an upgrade occurs, we will upgrade any existing data to the latest change i.e by having a empty property for it. I would admit this isn't the best of scenarios as old products that previously don't possess certain properties are now 'new' again which doesn't reflect the product correctly.
I am looking for a solution to introduce versioning to this solution before things get out of hand. What I've come up with is like this:
Realising that data is semi-structured (it changes from time to time), we've decided to go with an XML / XSLT approach. Storage of the data will be a mix of columns storing individual properties (e.g. ProductID, ProductName, VersionNumber) and XML columns that holds XML data to cater to fields that will change.
These XML and XSLT will have version numbers to tell the system which version of XML works with the other.Logic wise, we were thinking of developing our business logic to support multiple versions so that old products will still be calculated using old algorithms while new ones will use the new algo. For old products, besides updating them using the old algorithm, we will allow an 'upgrade' option so that they can be upgraded to the new version if they want to. Database wise will remain unchanged since we will store fields that are to be changed in XML form so extending fields should be catered for.
Would like you guys out there to comment on such a setup. I'm concern about performance since some fields are stored as XML, retrieving it will require extra steps, hence the reason why we decided some consistent fields should be on their own for searching purposes etc. Also, would doing multiple versioning like this get really big on the logic side as the program grows?
My client has few requirements for his website he want to built. want to discuss best practices to start this project and make this a learning experience.
accessible from all browsers and platforms. (mobile as welll)language supportscalableshould be CMS style so he can assign roles etc for editing. except above my question is what will be best to use as a new project in VS2010 (MVC, web application etc)
I am working on a web forms application that needs to support multiple languages based on a user's preference. Here are some considerations to keep in mind about the needed solution:
I want to avoid using resource files to store the different text translations because I'd like the ability to change them without having to recompile and deploy the application.
Also the translations ideally need to be adminstratable.
It seems its a considerable amount of effort to add this support to an existing application.
I am little confused regarding the concepts of localisation and globalization.I was working on a project which was totally database driven. All the data, images and flash stuff was coming from the database. Now the site is fully loaded with the data.Now the client wants the currently running site in 5 different languages. So I read the resource files concept. Now the confusion arises. I have 2 types data on the site, one is static(ie text on labels, titles, buttons) and dynamic data that was added from the admin panel.Now my question is: If at this stage I want to make the site in 5 different languages, then I have to make the resource files for all those languages so that the static data can be displayed in different languages.But what about the dynamic data that was entered by the client. Client uploaded huge amount of data. Should I make the changes in the database tables and add 4 other columns for different languages and again upload that much data in those 4 languages.
I am new to mobile applications. How to develop a .net web application which will support all the phones like iphone, blackberry etc...For developing this applications what are the softwares we need.
I am new to asp.net, I have been tasked to upgrade the physical architecture to load balancing environment to support the application. I done some reading the session state should be configure to Out-Process instead of In-Proc to support load balancing. Is there any other issues I need to take note for asp.net web application to run in the load balanced environment?
We are programming a new web application framework (Second WAF). I was wondering if we should support cookieless sessions or not. Who use it and who needs it?
Is there any pattern or kind of "least requirements list" to follow for ensuring an asp.NET application to support BACK button of the browser for each aspx page?
We have a Web Role that we are hosting in Windows Azure that uses an old ASMX based Web Reference to contact an external system. The Web Reference proxy code is big enough that instantiating it the first time has a significant cost.
We'd like to be able to have this run when the Web Role starts instead of on the first request.
I know IIS 7.5 has an Application Warm-Up module that would allow us to achieve this, but I'm having trouble figuring out if something similar exists with hosting on Windows Azure.
we are building a multi-tenant application, which will support that each tenant can have a unique top level domain, the application is build using the asp.net 3.5 and SQL servr 2005, while each tenant will have different database. I have seen a number of questions about the similar applications on the StackOverFlow, but none of them is related to the Testing, I want to know is how one can test the application in a development environment, specially How can we test that each customer connects to his own DB based on the URL. how can we emulate different domains on the local system. like [URL] and [URL]all goes to dev machine's IIS.
I am using one datalist control for uploading multiple images.I hv used one Asp:FileUplaod Control and one button in one itemtemplate.I am using reqired field validator and regular expression validator for file upload cntrl I am assigning validation group for both of them on ItemDataBound event of my datalist so that each upload cntrl hv same validaton group as required field and regular expression validator.Now what i want to do is - i want to show my error message in validation summary which is right at the top of the page.I want one know how to write javascript that will assign validation group of my control in datalist on which i click ?
My root problem is that I get the following error message from my CruiseControl server :
errorMSB4019: The imported project "C:Program FilesMSBuildMicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" was not found.
I know all i have to do to workaround this issue is to copy the files to the folder but I just can't found anyone having thoses files and based on this thread I tried to "explicitly install the Web Application Project support on my machine" BUT I don't have such an option from the Microsoft Visual Studio 2010 Professional Setup tool ...where can I found the content of the following folder : C:Program
Is it possible to do client side validation on a detailsview (insert or edit) without using validation controls? I.E. somehow capture the onClientClick event of the autogenerated Insert/Update link buttons to call my javascript function?
I am using ASP.NET's server-side validation. In the page_load event I'm calling Page.Validate(), and if Page.IsValid is not true I'm then polling the controls to figure out which ones are not valid, and then determining what actions to take.It would be much easier if each control would raise an event as validation fails, allowing me to take action for that particular control. I'm very much a naive programmer when it comes to validation, but is there a way to extend these controls so that a validation error raises an event?
For example when using a gridview. When you specify the columns
BoundField for example won't work if you are binding it to a field instead of a property.
I guess this is so because when the gridview is looking for the DataField property it looks for a property and not a field. Now the question is how can i change this behavior to make it possible to use fields. I know i have to inherit from the gridview, but i don't know where to go from there.
It is easy enough to add a required field validator to this page like this.
<asp:RequiredFieldValidator ID="valMyTextBox" runat="server" ControlToValidate="txtMyTextBox" ErrorMessage="My Text Box is required."></asp:RequiredFieldValidator>
But I need to modify the HTML slightly if this text box fails validation. I need to add a CSS class to the DIV. So if the user leaves this field blank I need the HTML to look like this:
Is this possible? I can't figure out if there is a way to write code behind that only fires if this particular validator control fails validation or something. I know I can write code that runs when the entire page is not valid. But I just want this code to run when this validator returns invalid. Hope this makes sense.
Say you have a form designed in Silverlight(Front end)-Asp.NEt(business layer)-SQl(bakcend)Should data validation occur on all 3 layers or just the presentation layer or a combination of the front end with the other 2 e.g. validating an email address? I'm trying to undestand as to why if data has been validated on the presentation why further data validation would be necessary especially if there would be large amounts of data being validated and this could potentially slow down database transactions?