.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

MVVM - Multiple ViewModels of same type --> Singel instance of view

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :WPF
 

I have a ViewModel that contains a property WorkSpaces:

public ObservableCollection<ServiceViewModel> WorkSpaces{get; set;}

The WorkSpaces I bind to a ContentControl that contains as ItemTemplate a DataTemplate which contains a TabControl

<ContentControl Content="{


View Complete Post


More Related Resource Links

Need an MVC Guru !!! Best Practice to have multiple Strongly Type Models ...inside a single View ??

  

So far I've seen demos of MVC that have simple pages, one for login, one for register, one for listing a table ...

In order to understand better the transition for WebForms developers into MVC patterns, I would like to understand how can I put together multiple CONTROLS (like the one provided by the default MVC project that VS2010 creates for us ...and make it work.


OK so as an example, imagine we want to change the LogonUserControl.ascx to allow us to login (so to show UserName and Password textboxes and Logon button) from the Home Page.

1) We update the Control as follow:


2) We update the HomeController.cs file to handle the Logon Button Post event as follow:


 

We needed to move some code from AccountController to HomeController in order to get the control to work under the Index view. So ...with little luck it seems to work !!!


Now the problem happens when you navigate to the Register view, considering that now we are not any longer on the HomeController "domain" but we are under AccountController.

Register page shows perfectly and

Gmail style multiple Sign-in type combo...is it possible in asp.net?

  

I am developing a multi-company application and want my users to give the functionality like the following to switch companies.

http://gmailblog.blogspot.com/2010/08/access-two-gmail-accounts-at-once-in.html

Is this possible? then how?

Please help


Thanks



Activation error occured while trying to get instance of type Database, key "DBName"

  

Im using Enterprise library 5.0
I have a scenario, where I have to access two different databases in my application.

Basically this application is a webservice,delployed on my local for testing purpose.
I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.

Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.

<dataConfiguration defaultDatabase="MYCON1" />
<connectionStrings>
<add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"
providerName="System.Data.SqlClient

" />
<add name="MYCON2" connectionString="Data Source=Server2;Initial Catalog=dbName2;User Id=Username2;Password=password2;"
providerName="System.Data.SqlClient" />
</connectionStrings>


Database myDB=EnterpriseLibraryContainer.Current.GetInstance<Database>(); --> works fine for the default database (MYCON1)


Database myDB=EnterpriseLibraryCo

VS 2010 XAML Design View Load always fail with a Type Load Exception

  
Create a new WPF project in VS and change nothing. The Design View will fail to load with the error below. Error    1    Could not load type 'Microsoft.Expression.DesignModel.Core.ISharedInstanceBuilder' from assembly 'Microsoft.Expression.DesignModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Microsoft.Expression.DesignModel is an assembly from Expression Blend. I ever installed Blend 4 RC and uninstall and install Blend 4. I Reflector the assembly I have under Blend 4 bin folder. And cannot find a interface named ISharedInstanceBuilder. But the WPF project is a Template project without any changes. How it get related with Blend 4? And how to fix it? Thanks.  

Data Source View Gives incorrect Error--Different Data Type

  
Hi, I'm creating a report model (2008 R2).  I am trying to create a relationship between two tables.  One FKs to another--same name and type (tinyint) columns.  But the Data Source View editor doesn't allow this, giving the message "...source and destination column have different data types".  But the columns are the same types.  I ahd this once before  acouple of years ago and don't remember how I got around it. Does anyong have ideas?  

Multiple databases on same instance - performance hit?

  
Hi I am not a SQL person to please excuse me if my terminology is wrong :) We are running SQL 2005 at the moment on Windows 2003 SP2 servers. We have multiple SQL servers spread around in each of our data centres. We have an application we're going to be bringing in that needs it's own SQL database. We need to decide whether we build a dedicated SQL server for this or just create a new database on an exisiting SQL instance. The advantages of the former are that we don't max out any existing servers and affect the performance of other databases, whereas with the latter we save the cost of having to build a new server. For those of you that use SQL heavily, what's the general way of doing things? I know that SQL is memory, disk intensive etc so not sure.

Feature Upgrade Functionality - Adding a new Content Type and List Instance

  
I've successfully used the upgrade functionality in SP 2010 to upgrade my list structures as needed. So far, these updates have been adding new fields to existing content types. Now, I have some new fields, content types and list instances to add, and am having trouble getting this accomplished. The scenario is this: - A new content type with a single custom field (also new), and a list instance for this new content type - A new field that is a lookup back to the new list instance defined above. This new field is added as an existing content type. - In my feature.xml, I have the Element Manifest specified with both new fields and an AddContentTypeField element for the new field being added to an existing content type:   <ApplyElementManifests> <ElementManifest Location="V1_04\Elements.xml"/> </ApplyElementManifests> <AddContentTypeField ContentTypeId="0x0100..." FieldId="{8028A1C8-1147-4DF7-B5C3-8A1F84A30360}" PushDown="TRUE"/> The result of running the update on this feature is: - My new field that is part of an existing content type is added - My new field that is part of a new content type/instance is added - My new content type and list instance is NOT created, therefore my lookup is broken Any idea why my new Content Type and List Instance is not being created? Do I need to specify there

Feature Upgrade Functionality - Adding a new Content Type and List Instance

  
I've successfully used the upgrade functionality in SP 2010 to upgrade my list structures as needed. So far, these updates have been adding new fields to existing content types. Now, I have some new fields, content types and list instances to add, and am having trouble getting this accomplished. The scenario is this: - A new content type with a single custom field (also new), and a list instance for this new content type - A new field that is a lookup back to the new list instance defined above. This new field is added as an existing content type. - In my feature.xml, I have the Element Manifest specified with both new fields and an AddContentTypeField element for the new field being added to an existing content type:   <ApplyElementManifests> <ElementManifest Location="V1_04\Elements.xml"/> </ApplyElementManifests> <AddContentTypeField ContentTypeId="0x0100..." FieldId="{8028A1C8-1147-4DF7-B5C3-8A1F84A30360}" PushDown="TRUE"/> The result of running the update on this feature is: - My new field that is part of an existing content type is added - My new field that is part of a new content type/instance is added - My new content type and list instance is NOT created, therefore my lookup is broken Any idea why my new Content Type and List Instance is not being created? Do I need to specify there

Create view that amins to tables of another database on the same sql server instance

  
Hi to everybody, I found a situation ever met before. I develop on Dynamics NAV 5.01 and I have developed a method to be able to see some particular tables of an external database. In substance it deals with a property of tables of Dynamics NAV. When I create a table in NAV, I can create it in 3 different ways: table common to all the companies table  for company or table linked to a view.    This last case is mine, on the same db of NAV I have created a view with some fields, I have created in NAV a table linked with equal fields and types. Until here all normal.    The view, however, aims to another database that doesn't center anything with NAV but that it is on the same intance of SQL server.    The consumer that accesses NAV is a consumer type database SQL Server and has the permitted db_public and db_datareader on both the database. Then he can read the views on the db of nav both on the db of the other database.    When it tries to enter from the console of sql server, with the consumer database, all it works, if I do it by NAV, it show me an error "The server principal "username" is not able to access the database "some_database_name" under the current security context. (Microsoft SQL Server, Error: 916) "    If I add on the database NAV to the consumer, the role db_owner,

Using Multiple Childview inside View

  
I want to create a view which will include 2 sections. In first section user selects values from dropdown and then click Search button, And want to display results in same View.Second section should comes after click event.  How should i implement this in MVC. Am filling dropdown using Viewdata so clicking on search button invoke action in controller. public actionresult search(){} /// in this action am loading all dropdowns with Viewdatapublic actionresult Searchresults( formcollection  post){  //search logicreturn view('search');}   problem am facing is when second action executes dropdowns starts looking for viewdata which is no more there. Can somebody help me

How to use single windows service to host multiple WCF Services instances (Each instance of WCF is i

  
How to use single windows service to host multiple WCF Services. I have a mutiple instance of same WCF service in different folder, each instance has unique service name and port. WCFService has reference to Reg-Free COM Reference, i have Native.WCFService.manifest in each folder. Ex: WCFService1 is in "C:\WCFService01\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config WCFService2 is in "C:\WCFService02\WCFService.dll, Native.OCWCFService.manifest, OCWCFService.dll.config Now i need host above services from single Windows Service. I am trying to create AppDomain for each above WCFService Instance from Windows Service and then host. Its working if i register COM dll in the server using regsvr32, but when i un register COM dll, i am getting unable to load COM component .... This looks like AppDomain is not loading COM DLL and Manifest files. Its looks strange but we need it in this way because we have production and test environment in the same server. Everything works fine if create a seperate Windows Service for each WCFService Instance, but my manager wants single Windows Service :). Any help whould be really appreciated.  ravi kumar reddy

Rebooting one Instance on a SQL 2008 Server with multiple instances installed

  
Hello, Hoping someone can answer the following questions ... If I have SQL Server 2008 with multiple Named Instances configured on it, can I reboot one Named Instance without rebooting any of the other Named Instances, or without having to reboot the entire server ? For example, if I have an application that needs to be re-booted and it requires the Database to be re-booted. Regards, JD

How to filter a List View by multiple values for one filter field?

  
Hi, I need to create a dynamically created link to a List View with a filter on one field, but with multiple values. Example: http://<server>/Lists/<list>/Allitems.aspx?FilterField1=Name&FilterValue1=John/Jack/Jonas which should give me all items where Name equals John, Jack or Jonas. Is this even possible?

Multiple selection in connected list view webpart

  
Hi all, I have a webpart page with 2 listview webparts connected via  ("Send Row of Data"/"Get filter values from"). This connection permits me to select one row on the first listview (parent) and the second (child) gets filtered by the defined filter column. My question is how can I choose multiple rows on the parent so I can filter the rows of the child with multiple filter values? It seems on can only select one row via the "Select" column... Is there a workaround... Many thanks,  

Installing multiple instances of SQL Server R2 creates permissions issues - first instance won't st

  
After installing two named instances of SQL Server 2008 R2 DataCenter edition (R2D2 and C3P0) I found the first instance would no longer start.  The errorlog showed the reason to be an invalid path. 2010-09-14 18:15:39.12 Server      Error: 17113, Severity: 16, State: 1. 2010-09-14 18:15:39.12 Server      Error 3(The system cannot find the path specified.) occurred while opening file 'C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary. Finding the files in the proper location I check the ACLs and found the Local Group created for the second instance on the ACL for the first instance.  That is to say for instance R2D2 I found MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0 instead of the MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$R2D2 that was originally there. C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA>icacls master.mdf master.mdf NT AUTHORITY\SYSTEM:(F)            BUILTIN\Administrators:(F)            MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0:(F) It seems that creating the second instance causes this problem.  I have been u

Multiple instance of User Control on Page - Button Click Event

  
Hi, I have this Web User Control, with 3 controls:<asp:TextBox ID="txtSearch" runat="server" /> <asp:RequiredFieldValidator ID="rfvSearch" runat="server" ControlToValidate="txtSearch" Display="None" /> <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" /> In code behind: protected override void Render(HtmlTextWriter writer) { rfvSearch.ValidationGroup = this.ID + "_validation"; txtSearch.ValidationGroup = this.ID + "_validation"; btnSearch.ValidationGroup = this.ID + "_validation"; base.Render(writer); } protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("ResultadoSearch.aspx?argumento=" + txtSearch.Text); } When I try to add two UserControl and I Click in btnSearch of second UserControl, txtSearch.txt returns value of first User control.How I can get the value of second txtSearch?
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend