Search Results

Search found 25123 results on 1005 pages for 'domain model'.

Page 42/1005 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • How and where do you manage your domain names?

    - by Saif Bechan
    In the past several years doing web development I often times needed to buy new domain names. I changed registrars a lot also so over the years I have multiple domain names scattered over different registrars all over the world. Now I want to bring a little structure into my business, and I am at the point that I want to be able to have easy control over my domain names in a convenient way. Does anyone have an idea on what the best way is to give structure on this. I have made some suggestions maybe you can comment on them for me. 1) Just leave it as it is I can leave everything as it is. To make adjustments I have to log into different panels, and for some registrars I have to email the changes. 2) Transfer all the domains to one registar This will cost a lot, about 10 usd per domain name. But if I can find a registar where I have full control over DNS this is worth looking at. Can you give me some comments on how you are doing things now. Maybe also which registrar you prefer on doing things.

    Read the article

  • MVVM/Presentation Model With WinForms

    - by Erik Ashepa
    Hi, I'm currently working on a brownfield application, it's written with winforms, as a preparation to use WPF in a later version, out team plans to at least use the MVVM/Presentation model, and bind it against winforms... I've explored the subject, including the posts in this site (which i love very much), when boiled down, the main advantage of wpf are : binding controls to properties in xaml. binding commands to command objects in the viewmodel. the first feature is easy to implement (in code), or with a generic control binder, which binds all the controls in the form. the second feature is a little harder to implement, but if you inherit from all your controls and add a command property (which is triggered by an internal event such as click), which is binded to a command instance in the ViewModel. The challenges I'm currently aware of are : implementing a commandmanager, (which will trigger the CanInvoke method of the commands as necessery. winforms only supports one level of databinding : datasource, datamember, wpf is much more flexible. am i missing any other major features that winforms lacks in comparison with wpf, when attempting to implement this design pattern? i sure many of you will recommend some sort of MVP pattern, but MVVM/Presentation model is the way to go for me, because I'll want future WPF support. Thanks in advance, Erik.

    Read the article

  • Synchronizing an ERWin model with a Visual Studio 2008 GDR 2/2010 db project

    - by Grant Back
    I am looking for options to get our vast collection of DB objects across many DBs into source control (TFS 2010). Once we succeed here, we will work toward generating our alter scripts for a particular DB change via TFS build. The problem is, our data architecture group is responsible for maintaining the DB objects (excluding SPs), and they work within a model centric process, via ERWin. What this means, is that they maintain the DBs via ERWin models, and generate alters from them that are used to release changes. In order to achieve our goal of getting the DB objects (not just the ERWin models) into TFS, I believe the best option is to do this via Visual Studio DB projects. From what I can tell, there is very little urgency for CA to continue supporting an integration between ERWin and Visual Studio, that no longer works as of Visual Studio 2008 DB Ed. GDR. If I have been mislead in this regard, please feel free to set me straight. One potential solution is to: Perform changes in the ERWin model. Take the alter script generated from ERWin, and import the script into the appropriate Visual Studio DB project, updating the objects in the in the DB project Check the changed objects in the DB project into TFS. TFS Build executes to generate the alter scripts that will be used to push the changes through our release process. My question is, is this solution viable, or are there any other options?

    Read the article

  • RIA Services: Inserting multiple presentation-model objects

    - by nlawalker
    I'm sharing data via RIA services using a presentation model on top of LINQ to SQL classes. On the Silverlight client, I created a couple of new entities (album and artist), associated them with each other (by either adding the album to the artist's album collection, or setting the Artist property on the album - either one works), added them to the context, and submitted changes. On the server, I get two separate Insert calls - one for the album and one for the artist. These entitites are new so their ID values are both set to the default int value (0 - keep in mind that depending on my DB, this could be a valid ID in the DB) because as far as I know you don't set IDs for new entities on the client. This all would work fine if I was transferring the LINQ to SQL classes via my RIA services, because even though the Album insert includes the Artist and the Artist insert includes the Album, both are Entities and the L2S context recognizes them. However, with my custom presentation model objects, I need to convert them back to the LINQ to SQL classes maintaining the associations in the process so they can be added to the L2S context. Put simply, as far as I can tell, this is impossible. Each entity gets its own Insert call, but there's no way you can just insert the one entity because without IDs the associations are lost. If the database used GUID identifiers it would be a different story because I could set those on the client. Is this possible, or should I be pursuing another design?

    Read the article

  • ASP.NET Model Binder and base type

    - by user137348
    My model inherits from an interface: public interface IGrid { ISearchExpression Search { get; set; } . . } public interface ISearchExpression { IRelationPredicateBucket Get(); } The model: public class Project : IGrid { public ISearchExpression Search { get; set; } public Project() { this.Search = new ProjectSearch(); } } The ProjectSearch: public class ProjectSearch: ISearchExpression { public string Name { get; set; } public string Number { get; set; } public IRelationPredicateBucket Get() {...} } And the strong typed partialview in the main view: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ProjectSearch>" %> <%= Html.TextBoxFor(x=>x.Name)%> <%= Html.TextBoxFor(x => x.Number)%> .... When I submit the form, the Search property don't get bound properly. Everything is empty.The action takes an argument of ProjectSearch type. Why the Search don't get bound as supposed ?

    Read the article

  • PHP: MVC and Model

    - by Pirkka
    Hello I`ve been wondering this one thing about creating models. If I make for example Page model. Is it the both: It can retrieve one row from the table or all the rows. Somehow Im mixing the objects and the database. I have thought it like this: I would have to make a Page-class that would represent one row in the table. It also would have all the basic CRUD-methods. Then I would have to do a Pages-class (somekind of collection) that would retrieve rows from the table and instantiate a Page object from each row. Is this kind of weird? If someone could explain to me the idea of model throughout.. Im again confused. Maybe Im thinking the whole OOP too difficult.. And by the way this forum is great. Hopefully people will just understand my problems. Heh. I was a long time procedural style programmer and now in 3 months I have dived into OOP and MVC and PHP frameworks and I just get more excited day by day when I explore this stuff!

    Read the article

  • Model-binding an object from the repository by several keys

    - by Anton
    Suppose the following route: {region}/{storehouse}/{controller}/{action} These two parameters region and storehouse altogether identify a single entity - a Storehouse. Thus, a bunch of controllers are being called in the context of some storehouse. And I'd like to write actions like this: public ActionResult SomeAction(Storehouse storehouse, ...) Here I can read your thoughts: "Write custom model binder, man". I do. However, the question is How to avoid magic strings within custom model binder? Here is my current code: public class StorehouseModelBinder : IModelBinder { readonly IStorehouseRepository repository; public StorehouseModelBinder(IStorehouseRepository repository) { this.repository = repository; } public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { var region = bindingContext.ValueProvider.GetValue("region").AttemptedValue; var storehouse = bindingContext.ValueProvider.GetValue("storehouse").AttemptedValue; return repository.GetByKey(region, storehouse); } } If there was a single key, bindingContext.ModelName could be used... Probably, there is another way to supply all the actions with a Storehouse object, i.e. declaring it as a property of the controller and populating it in the Controller.Initialize.

    Read the article

  • URL-Encoded post parameters don't Bind to model

    - by Steven Klein
    I have the following Model namespace ClientAPI.Models { public class Internal { public class ReportRequest { public DateTime StartTime; public DateTime EndTime; public string FileName; public string UserName; public string Password; } } } with the following method: [HttpPost] public HttpResponseMessage GetQuickbooksOFXService(Internal.ReportRequest Request){ return GetQuickbooksOFXService(Request.UserName, Request.Password, Request.StartTime, Request.EndTime, Request.FileName); } My webform looks like this: <form method="POST" action="http://localhost:56772/Internal/GetQuickbooksOFXService" target="_blank"> <input type="text" name="StartTime" value="2013-04-03T00:00:00"> <input type="text" name="EndTime" value="2013-05-04T00:00:00"> <input type="text" name="FileName" value="Export_2013-04-03_to_2013-05-03.qbo"> <input type="text" name="UserName" value="UserName"> <input type="text" name="Password" value="*****"> <input type="submit" value="Submit"></form> My question is: I get into the GetQuickbooksOFXService function but my model has all nulls in it instead something useful. Am I doing something wrong?

    Read the article

  • Detect whether or not a specific attribute was valid on the model

    - by Sir Code-A-Lot
    Having created my own validation attribute deriving from System.ComponentModel.DataAnnotations.ValidationAttribute, I wish to be able to detect from my controller, whether or not that specific attribute was valid on the model. My setup: public class MyModel { [Required] [CustomValidation] [SomeOtherValidation] public string SomeProperty { get; set; } } public class CustomValidationAttribute : ValidationAttribute { public override bool IsValid(object value) { // Custom validation logic here } } Now, how do I detect from the controller whether validation of CustomValidationAttribute succeeded or not? I have been looking at the Exception property of ModelError in the ModelState, but I have no way of adding a custom exception to it from my CustomValidationAttribute. Right now I have resorted to checking for a specific error message in the ModelState: public ActionResult PostModel(MyModel model) { if(ModelState.Where(i => i.Value.Errors.Where((e => e.ErrorMessage == CustomValidationAttribute.SharedMessage)).Any()).Any()) DoSomeCustomStuff(); // The rest of the action here } And changed my CustomValidationAttribute to: public class CustomValidationAttribute : ValidationAttribute { public static string SharedMessage = "CustomValidationAttribute error"; public override bool IsValid(object value) { ErrorMessage = SharedMessage; // Custom validation logic here } } I don't like relying on string matching, and this way the ErrorMessage property is kind of misused. What are my options?

    Read the article

  • Using java to create a logistic model - arrays and properties

    - by Oliver Burdekin
    I'm currently trying to create a java model that will solve a problem we have. On a voluntary expedition each week we have some people leaving and some new people arriving. Accommodation is in tents. The tents sleep different numbers of people and certain rules apply. Males and females cannot be mixed and volunteers can be one of four types - school children/ research assistants/ scientific staff/ school teachers So types of volunteer and sexes cannot be mixed. Each week the manager spends hours trying to work this out so I've offered to make this model to keep my coding skills up. At present I'm working with arrays. Each tent is a 2D array [4][x] where x is the number of people it sleeps (each person sleeping there has 4 attributes). Each person is a 1D array with 4 attributes [4]. The idea is to check where people can go, cause the minimum movement for people staying on and solve this logistic problem. Does anyone have any better suggestions as to how to solve this? At present I'm finding it necessary to write a lot of code setting up and querying arrays. Any help is appreciated.

    Read the article

  • How can I add subdomains of default accepted domain of Exchange 2010

    - by Christoph
    I have an Exchange 2010 that has several accepted domains. Now I want this server to accept - besides the default SMTP domain - all subdomains of the default domain. The documentation in Technet states When you create an accepted domain, you can use a wildcard character (*) in the address space to indicate that all subdomains of the SMTP address space are also accepted by the Exchange organization. For example, to configure Contoso.com and all its subdomains as accepted domains, enter *.Contoso.com as the SMTP address space. It is, however not possible to add e. g. *.contoso.com if contoso.com is already configured. Exchange complains in this case that the domain is already configured. It is also not possible to edit the "value", i. e. the domain name of an accepted domain. I know that I cannot modify the default accepted domain, but changing it to another does not help either, because the domain name itself can never be edited. The last idea was deleting the accepted domain and re-creating it with "*." prepended. This is, however, also impossible because it is of course not possible to delete or modify the default address policy and if a domain name is used in an address template it cannot be removed from the accepted domains. The question is: How can I make my Exchange 2010 server accept any subdomain of its default accepted domain with a wildcard?

    Read the article

  • 9000+ different subdomains 301 to main domain, .htacess apache

    - by Karim
    I bought a domain that had various subdomains such as Kim.domain.com/whatever john.domain.com/whatever1 Lizo.domain.com/whatever2 Simon.domain.com/whatever1 And this was in the thousands, and also had links to these pages I'd like to do a 301 redirect for all these urls into http://domain.com Any idea how this could be done? This is for a apache web server and needs to be done via .htaccess I have implemented the solution from reading the answer below. RewriteEngine On RewriteCond %{HTTP_HOST} !^www. domain.com$ RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*)$ http:/ / www. domain.com/$1 [L,R=301] However I have a slight problem, I would like to redirect all subdomains + subfolders to http://www. domain.com/ With the exception of http: //domain. com/subfolder/, in which case I would like to redirect to http: // www.domain. com/subfolder/ [i.e. exception for no subdomain] I'm guessing I need to add an exception, what can I do to implement this. Note: example URLs above have had spaces added to them to prevent spam blocks for blocking the post.

    Read the article

  • Proxy Issues with Javascript Cross Domain RSS Feed Parsing

    - by Amir
    This is my Javascript function which grabs an rss feed via the proxy script and then spits out the 5 latest rss items from the feed along with a link to my stylesheet: function getWidget (feed,limit) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest() } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP") } xhttp.open("GET","http://MYSITE/proxy.php?url="+feed,false); xhttp.send(""); xmlDoc=xhttp.responseXML; var x = 1; var div = document.getElementById("div"); srdiv.innerHTML = '<link type="text/css" href="http://MYSITE/css/widget.css" rel="stylesheet" /><div id="rss-title"></div></h3><div id="items"></div><br /><br /><a href="http://MYSITE">Powered by MYSITE</a>'; document.body.appendChild(div); content=xmlDoc.getElementsByTagName("title"); thelink=xmlDoc.getElementsByTagName("link"); document.getElementByTagName("rss-title").innerHTML += content[0].childNodes[0].nodeValue; for (x=1;x<=limit;srx++) { y=x; y--; var shout = '<div class="item"><a href="'+thelink[y].childNodes[0].nodeValue+'">'+content[x].childNodes[0].nodeValue+'</a></div>'; document.getElementById("items").innerHTML += shout; } } Here is the the code from proxy.php: $session = curl_init($_GET['url']); // Open the Curl session curl_setopt($session, CURLOPT_HEADER, false); // Don't return HTTP headers curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Do return the contents of the call $xml = curl_exec($session); // Make the call header("Content-Type: text/xml"); // Set the content type appropriately echo $xml; // Spit out the xml curl_close($session); // And close the session Now when I try to load this on any domain that's not my site nothing loads. I get no JS errors, but I in the Console tab in firebug I get "407 Proxy Authentication Required" So I'm not really sure how to make this work. The goal is to be able to grab the RSS feed, parse it to grab the titles and links and spit it out into some HTML on any website on the web. I"m basically making a simple RSS widget for my site's various RSS feeds. My Javascript is wack Also, I'm really a beginner with Javascript. I know jQuery pretty well, but I wasn't able to use it in this case, because this script will be embeded on any site and I can't really rely on the jQuery library. So I was decided to write some basic Javascript relying on the default XML parsing options available. Any suggestions here would be cool. Thanks! What's with the x and y They way my site creates RSS feeds is that the first title is actually the RSS feed title. The second title is the title of the first item. The first link is the link to the first item. So when using the javascript to get the title, I had to first grab the first title (which is the RSS title) and then start with the second title that being the first title of the item. Sorry for the confusion, but I don't think this is related to my issue. Just wanted to clarify my code.

    Read the article

  • MVVM- Expose Model object in ViewModel

    - by Angel
    I have a wpf MVVM application , I exposed my model object into my viewModel by creating an instance of Model class (which cause dependency) into ViewModel , and instead of creating seperate VM properties , I wrap the Model properties inside my ViewModel Property. My model is just an entity framework generated proxy classes. Here is my Model class : public partial class TblProduct { public TblProduct() { this.TblPurchaseDetails = new HashSet<TblPurchaseDetail>(); this.TblPurchaseOrderDetails = new HashSet<TblPurchaseOrderDetail>(); this.TblSalesInvoiceDetails = new HashSet<TblSalesInvoiceDetail>(); this.TblSalesOrderDetails = new HashSet<TblSalesOrderDetail>(); } public int ProductId { get; set; } public string ProductCode { get; set; } public string ProductName { get; set; } public int CategoryId { get; set; } public string Color { get; set; } public Nullable<decimal> PurchaseRate { get; set; } public Nullable<decimal> SalesRate { get; set; } public string ImagePath { get; set; } public bool IsActive { get; set; } public virtual TblCompany TblCompany { get; set; } public virtual TblProductCategory TblProductCategory { get; set; } public virtual TblUser TblUser { get; set; } public virtual ICollection<TblPurchaseDetail> TblPurchaseDetails { get; set; } public virtual ICollection<TblPurchaseOrderDetail> TblPurchaseOrderDetails { get; set; } public virtual ICollection<TblSalesInvoiceDetail> TblSalesInvoiceDetails { get; set; } public virtual ICollection<TblSalesOrderDetail> TblSalesOrderDetails { get; set; } } Here is my ViewModel , public class ProductViewModel : WorkspaceViewModel { #region Constructor public ProductViewModel() { StartApp(); } #endregion //Constructor #region Properties private IProductDataService _dataService; public IProductDataService DataService { get { if (_dataService == null) { if (IsInDesignMode) { _dataService = new ProductDataServiceMock(); } else { _dataService = new ProductDataService(); } } return _dataService; } } //Get and set Model object private TblProduct _product; public TblProduct Product { get { return _product ?? (_product = new TblProduct()); } set { _product = value; } } #region Public Properties public int ProductId { get { return Product.ProductId; } set { if (Product.ProductId == value) { return; } Product.ProductId = value; RaisePropertyChanged("ProductId"); } } public string ProductName { get { return Product.ProductName; } set { if (Product.ProductName == value) { return; } Product.ProductName = value; RaisePropertyChanged(() => ProductName); } } private ObservableCollection<TblProduct> _productRecords; public ObservableCollection<TblProduct> ProductRecords { get { return _productRecords; } set { _productRecords = value; RaisePropertyChanged("ProductRecords"); } } //Selected Product private TblProduct _selectedProduct; public TblProduct SelectedProduct { get { return _selectedProduct; } set { _selectedProduct = value; if (_selectedProduct != null) { this.ProductId = _selectedProduct.ProductId; this.ProductCode = _selectedProduct.ProductCode; } RaisePropertyChanged("SelectedProduct"); } } #endregion //Public Properties #endregion // Properties #region Commands private ICommand _newCommand; public ICommand NewCommand { get { if (_newCommand == null) { _newCommand = new RelayCommand(() => ResetAll()); } return _newCommand; } } private ICommand _saveCommand; public ICommand SaveCommand { get { if (_saveCommand == null) { _saveCommand = new RelayCommand(() => Save()); } return _saveCommand; } } private ICommand _deleteCommand; public ICommand DeleteCommand { get { if (_deleteCommand == null) { _deleteCommand = new RelayCommand(() => Delete()); } return _deleteCommand; } } #endregion //Commands #region Methods private void StartApp() { LoadProductCollection(); } private void LoadProductCollection() { var q = DataService.GetAllProducts(); this.ProductRecords = new ObservableCollection<TblProduct>(q); } private void Save() { if (SelectedOperateMode == OperateModeEnum.OperateMode.New) { //Pass the Model object into Dataservice for save DataService.SaveProduct(this.Product); } else if (SelectedOperateMode == OperateModeEnum.OperateMode.Edit) { //Pass the Model object into Dataservice for Update DataService.UpdateProduct(this.Product); } ResetAll(); LoadProductCollection(); } #endregion //Methods } Here is my Service class: class ProductDataService:IProductDataService { /// <summary> /// Context object of Entity Framework model /// </summary> private MaizeEntities Context { get; set; } public ProductDataService() { Context = new MaizeEntities(); } public IEnumerable<TblProduct> GetAllProducts() { using(var context=new R_MaizeEntities()) { var q = from p in context.TblProducts where p.IsDel == false select p; return new ObservableCollection<TblProduct>(q); } } public void SaveProduct(TblProduct _product) { using(var context=new R_MaizeEntities()) { _product.LastModUserId = GlobalObjects.LoggedUserID; _product.LastModDttm = DateTime.Now; _product.CompanyId = GlobalObjects.CompanyID; context.TblProducts.Add(_product); context.SaveChanges(); } } public void UpdateProduct(TblProduct _product) { using (var context = new R_MaizeEntities()) { context.TblProducts.Attach(_product); context.Entry(_product).State = EntityState.Modified; _product.LastModUserId = GlobalObjects.LoggedUserID; _product.LastModDttm = DateTime.Now; _product.CompanyId = GlobalObjects.CompanyID; context.SaveChanges(); } } public void DeleteProduct(int _productId) { using (var context = new R_MaizeEntities()) { var product = (from c in context.TblProducts where c.ProductId == _productId select c).First(); product.LastModUserId = GlobalObjects.LoggedUserID; product.LastModDttm = DateTime.Now; product.IsDel = true; context.SaveChanges(); } } } I exposed my model object in my viewModel by creating an instance of it using new keyword, also I instantiated my DataService class in VM, I know this will cause a strong dependency. So , 1- Whats the best way to expose Model object in ViewModel ? 2- Whats the best way to use DataService in VM ?

    Read the article

  • Exchange Server 2007 Send and Receive Connectors

    - by Mistiry
    I have gotten awesome advice from users on here for getting Exchange on Windows SBS 2008 set up. I think this is the final piece and I'm ready for roll-out! I need to set up Exchange so that it RECEIVES mail from our existing mail server as a Forward [aliases on the existing mail server to forward mail from [email protected] to [email protected]] (not using the POP3 Connector), and SENDS mail through that server as well (sends from [email protected] to [email protected] and then out to the world, showing in the headers as from [email protected] or at absolute least have the reply-to set as this). Alternatively, as long as the .net email address doesn't show in the From and replies are directed to the .com account, email can go from Exchange to the outside world without directing through the existing mail server. External Domain: domain.com Internal Domain: domain.local Internet Domain Name Set in SBS Console: domain.net When I go to http://remote.domain.net I get the Remote Web Workspace, and can login to both Sharepoint and OWA. I can send an email from OWA to a GMail account. I receive it from [email protected], which is an alias of [email protected]. I cannot, however, send an email from OWA to ANY domain.com email addresses. I am also not receiving any email to this Exchange account (except for NDRs). When I try sending an email to a domain.com account, here is the error (I had to replace all < and with { and }): Delivery has failed to these recipients or distribution lists: [email protected] The recipient's e-mail address was not found in the recipient's e-mail system. Microsoft Exchange will not try to redeliver this message for you. Please check the e-mail address and try resending this message, or provide the following diagnostic text to your system administrator. Generating server: IFEXCHANGE.domain.local [email protected] #550 5.1.1 RESOLVER.ADR.RecipNotFound; not found ## Original message headers: Received: from IFEXCHANGE.domain.local ([fe80::4d34:abc5:f7fd:e51a]) by IFEXCHANGE.domain.local ([fe80::4d34:abc5:f7fd:e51a%10]) with mapi; Tue, 17 Aug 2010 14:14:14 -0400 Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: binary From: John Doe {[email protected]} To: "[email protected]" {[email protected]} Date: Tue, 17 Aug 2010 14:14:12 -0400 Subject: asdf Thread-Topic: asdf Thread-Index: AQHLPjf+h6hA5MJ1JUu1WS4I4CiWeA== Message-ID: {E4E10393768D784D8760A51938BA456A029934BA30@IFEXCHANGE.domain.local} Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: {E4E10393768D784D8760A51938BA456A029934BA30@IFEXCHANGE.domain.local} MIME-Version: 1.0 I hope I explained the situation well enough for someone to be able to explain to me what I'm missing. If I could, I'd be putting a 10K bounty, but unfortunately I've got only 74 reputation (hey, I'm a newbie here!). I'm pretty sure the obvious "RecipNotFound" error is why its not working, my question is how to resolve this. The email account exists, it receives mail just fine, yet when I send it from the Exchange server it fails. EDIT In OC-Hub Transport, the Email Address Policies has 2 entries. "Windows SBS Email Address Policy" is set up to: Include All Recipient Types, no conditions, and SMTP %[email protected]. "Default Policy" set to: Include All Recipient Types, no conditions, and SMTP @domain.net. Three Authoritative Accepted domains domain.com domain.local (Default) domain.net Remote Domains tab has two entries. Default with domain * Windows SBS Company Web Domain with domain companyweb.

    Read the article

  • null values from listbox, are not evaluated in the model binding of ASP.NET-MVC

    - by Jorge
    The model validation doesn't evaluates the attributes linked to listbox values if you don't select at least one of them. This way is not possible to do a model evaluation using DataAnnotations in order to inform required values. The controller: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using TestValidation.Models; namespace TestValidation.Controllers { [HandleError] public class HomeController : Controller { private SelectList list = new SelectList(new List<string>() { "Sao Paulo", "Toronto", "New York", "Vancouver" }); public ActionResult Index() { ViewData["ModelState"] = "NOT EVAL"; ViewData["ItemsList"] = list; return View(); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Index(MyEntity entity) { if (ModelState.IsValid) { ViewData["ModelState"] = "VALID"; } else { ViewData["ModelState"] = "NOT VALID!!!"; } ViewData["ItemsList"] = list; return View(); } public ActionResult About() { return View(); } } } The View: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TestValidation.Models.MyEntity>" %> <asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"> Home Page </asp:Content> <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <h2> Validation Test</h2> <p> <% using (Html.BeginForm()) {%> <fieldset> <p> ModelState: <%= Html.Encode((string)ViewData["ModelState"])%> </p> <p> <label for="Name"> Name:</label> <%= Html.TextBoxFor(m => m.Name)%> <%= Html.ValidationMessageFor(m => m.Name)%> </p> <p> <label for="ItemFromList"> Items (list):</label> <%= Html.ListBoxFor(m => m.ItemFromList, ViewData["ItemsList"] as SelectList)%> <%= Html.ValidationMessageFor(m => m.ItemFromList)%> </p> <p> <label for="ItemFromCombo"> Items (combo):</label> <%= Html.DropDownListFor(m => m.ItemFromCombo, ViewData["ItemsList"] as SelectList)%> <%= Html.ValidationMessageFor(m => m.ItemFromCombo)%> </p> <p> <input type="submit" value="Submit" /> </p> </fieldset> <% } %> </asp:Content> The Model: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ComponentModel.DataAnnotations; namespace TestValidation.Models { public class MyEntity_Validate : ValidationAttribute { public MyEntity_Validate() { this.ErrorMessage = "Validated!. Is <> Toronto"; } public override bool IsValid(object value) { return ((string)value == "Toronto"); } } public class MyEntity { [Required] public string Name { get; set; } [MyEntity_Validate] public string ItemFromList { get; set; } [MyEntity_Validate] public string ItemFromCombo { get; set; } } } Any help would be very much appreciated. Thank you.

    Read the article

  • How to model a relationship that NHibernate (or Hibernate) doesn’t easily support

    - by MylesRip
    I have a situation in which the ideal relationship, I believe, would involve Value Object Inheritance. This is unfortunately not supported in NHibernate so any solution I come up with will be less than perfect. Let’s say that: “Item” entities have a “Location” that can be in one of multiple different formats. These formats are completely different with no overlapping fields. We will deal with each Location in the format that is provided in the data with no attempt to convert from one format to another. Each Item has exactly one Location. “SpecialItem” is a subtype of Item, however, that is unique in that it has exactly two Locations. “Group” entities aggregate Items. “LocationGroup” is as subtype of Group. LocationGroup also has a single Location that can be in any of the formats as described above. Although I’m interested in Items by Group, I’m also interested in being able to find all items with the same Location, regardless of which group they are in. I apologize for the number of stipulations listed above, but I’m afraid that simplifying it any further wouldn’t really reflect the difficulties of the situation. Here is how the above could be diagrammed: Mapping Dilemma Diagram: (http://www.freeimagehosting.net/uploads/592ad48b1a.jpg) (I tried placing the diagram inline, but Stack Overflow won't allow that until I have accumulated more points. I understand the reasoning behind it, but it is a bit inconvenient for now.) Hmmm... Apparently I can't have multiple links either. :-( Analyzing the above, I make the following observations: I treat Locations polymorphically, referring to the supertype rather than the subtype. Logically, Locations should be “Value Objects” rather than entities since it is meaningless to differentiate between two Location objects that have all the same values. Thus equality between Locations should be based on field comparisons, not identifiers. Also, value objects should be immutable and shared references should not be allowed. Using NHibernate (or Hibernate) one would typically map value objects using the “component” keyword which would cause the fields of the class to be mapped directly into the database table that represents the containing class. Put another way, there would not be a separate “Locations” table in the database (and Locations would therefore have no identifiers). NHibernate (or Hibernate) do not currently support inheritance for value objects. My choices as I see them are: Ignore the fact that Locations should be value objects and map them as entities. This would take care of the inheritance mapping issues since NHibernate supports entity inheritance. The downside is that I then have to deal with aliasing issues. (Meaning that if multiple objects share a reference to the same Location, then changing values for one object’s Location would cause the location to change for other objects that share the reference the same Location record.) I want to avoid this if possible. Another downside is that entities are typically compared by their IDs. This would mean that two Location objects would be considered not equal even if the values of all their fields are the same. This would be invalid and unacceptable from the business perspective. Flatten Locations into a single class so that there are no longer inheritance relationships for Locations. This would allow Locations to be treated as value objects which could easily be handled by using “component” mapping in NHibernate. The downside in this case would be that the domain model becomes weaker, more fragile and less maintainable. Do some “creative” mapping in the hbm files in order to force Location fields to be mapped into the containing entities’ tables without using the “component” keyword. This approach is described by Colin Jack here. My situation is more complicated than the one he describes due to the fact that SpecialItem has a second Location and the fact that a different entity, LocatedGroup, also has Locations. I could probably get it to work, but the mappings would be non-intuitive and therefore hard to understand and maintain by other developers in the future. Also, I suspect that these tricky mappings would likely not be possible using Fluent NHibernate so I would use the advantages of using that tool, at least in that situation. Surely others out there have run into similar situations. I’m hoping someone who has “been there, done that” can share some wisdom. :-) So here’s the question… Which approach should be preferred in this situation? Why?

    Read the article

  • Domain transfer from Yahoo to Godaddy. Google apps downtime

    - by Kedar
    I am moving my domain from Yahoo to Godaddy (cause yahoo charges ridiculously hugh amounts than others). My problem is I use this domain for Google apps and one of those is my custom email. So here are a few questions that I have - 1) Godaddy told me there is going to be a 48 hours of downtime. Is there anything that I can do to minimize the downtime? 2) Will I lose all the email that I get during this downtime? or they be stored in the cloud and bulk emailed me once my domain is up with Godaddy? If they are lost is there any workaround to forward them to my gmail during the downtime (i know sounds stupid, but I have to ask). Any help is much appreciated. Thanks in advance.

    Read the article

  • Is there a registry key change that will by-pass the Windows Domain Join Welcome page?

    - by user1256194
    I'm scripting some Windows Server 2008 R2 builds using Power Shell. Some software needs to be installed after the server has joined the domain. Since I want to automate everything, I'm looking to by-pass the domain controllers Welcome page using a registry hack script. I work for a large company and the Active Directory people are unwilling to change group policy. I figure if it's a registry key I can script the change, install the software, replace the key and reboot as the final step. Is there a registry key change that will by-pass the Domain Join Welcome page?

    Read the article

  • What is the best way to register a domain name in China?

    - by Trevor Allred
    What is the best (cost and safety) to register a .cn domain name? We recently received 2 emails from companies (px-vps.org and one other) in China saying that another company was trying to steal/register our .com domain name in china (.cn). They then gave us a list of 15 domains from China to India that we should register through their company. Now they are saying we need to register for a 5 year minimum at $100 per domain. It's starting to sound like a $10,000 scam. We called 101domains and they said it would be $30 for the registration fee and $30 for the law firm in Shanghai. Who should I go through to avoid spending a lot of money and be sure we don't get ripped off in the process?

    Read the article

  • What should be taken into consideration when deploying Windows 8 in a domain environment?

    - by GaTechThomas
    Edit: Reformulating the question: We have ordered new laptops but before they arrive, our development team is trying to decide whether to install Windows 8 or stick with Windows 7. We have already tested on isolated machines, but we have not yet been allowed to add the machines to the domain. Before we approach the networking group to discuss adding Windows 8 machines to the domain, we need more information on what changes / issues to expect in moving from Windows 7. Are there any aspects we should consider that are specific to Windows 8 clients? Thus far, I've gotten the following feedback: Windows Administrative Shares are disabled New set of Group Policy templates Changes to proxy server settings Additional items along these lines would be helpful. We're not looking for items related to Windows GUI changes, but instead primarily items related to having the machine live and be used on the domain.

    Read the article

  • How to make other computers connected to my workgroup able to browse my web server via my private local domain www.mydomain.local?

    - by Motivated Student
    Background I have a broadband connection. The fiber optic cable running from outside to my building is connected to a converter unit. The output of the converter is connected to a router. The router also provides 8 LAN ports to which the computers are connected. Shortly speaking, all computers are interconnected in a workgroup as opposed to a domain. My computer hosts an IIS web server using a private or local domain name www.mydomain.local. I has added 127.0.0.1 www.mydomain.local to the hosts file in the server C:\Windows\System32\drivers\etc so I can browse the site from within the server. So far so good. How to make other computers connected to my workgroup able to browse my web server via my private local domain www.mydomain.local? Note: Again, I am a newbie. I have no idea what I should do next.

    Read the article

  • How would I / could I obtain an reasonably comprehensive list of domain names?

    - by Simon
    I know that domain names are constantly changing, and I know there are a lot of them, but there is clearly a region of the domain name space which is stable. How would I go about getting a list, even a very big one? Such a thing must logically exist, even if it is in a distributed form, because the web's DNS servers resolve names to IP addresses. So in theory if I could poll all the DNS servers in the world at a moment in time I would have the complete list of mapped names. Is there a practical way of doing that? As an aside, does anyone have any good estimates of how many domain names exist at the moment?

    Read the article

  • Which GPO is making my Domain Controller my clients' DNS server?

    - by Harry Muscle
    I maintain a small domain (about 20 clients) and we need to make some changes to the DNS server that's being used by the clients. All the clients have been hard coded to use the domain controller as their DNS. Since these are new machines, and I never changed their DNS settings, I'm guessing there must be a GPO that's causing them to use the domain controller as their DNS. Since we don't have any GPO other than the default one yet, it's got to be the default GPO, however, I have looked through all the GPO settings and none of them refer to anything related to DNS. So I'm wondering if there's anything else that might be causing this. Any help or advice is highly appreciated. Thanks, Harry

    Read the article

  • How do I add client computers to a Windows SBS 2008 domain?

    - by Jonas
    We have a LAN and the router is the DHCP server. We have a server with Windows SBS 2008, it has the IP address 192.168.1.2 while the router has the IP address 192.168.1.1. I have set "DNS Relay" on the router to 192.168.1.2. I have tried to add a client computer to the SBS domain by visiting http://connect from the client computer. But that page doesn't exist. I can visit http://192.168.1.2/ then the default startpage for IIS7 is shown. I'm logged in as a local Administrator on the computer that I tries to add to the domain. How do I add the client computer to the SBS 2008 domain? The router is an D-Link DFL 200, and I have now set the "DNS Relay" to "Use address of LAN interface" instead of a specific IP-address. But it doesn't work.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >