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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Create a New object on an already New object view?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

What is the best way to show a Create view on demand for a lookup item.

For instance, your on a Create view for a Product and you have a Combobox to select a Category, and link beside it to create a new Category. Once you click it another form appears as a popup or another window, you then create the Category and close the popup/window and then refresh the Combobox and auto select the new value.

Can someone provide such an example?



View Complete Post

More Related Resource Links

Create COM object from ProgID in a separate domain

Hi, How should I create COM object from ProgID in a separate app. domain? After I created corresponding Type object by means of Type.GetTypeFromProgID, I cannot use neither Activator.CreateInstance nor <MySeparateAppDomain>.CreateInstance because both require assembly name as one of the arguments... but as I said before I have no RCW assembly - just a ProgID. Those Activator.CreateInstance overloads which have argument of AppDomain type do not accept argument of Type type, only argument "assembly name" (of String type). And neither of <MySeparateAppDomain>.CreateInstance overloads accept argument of Type type (all require assembly name and type name). Any ideas?!

Proxy failed to create remote object on the server

Hi, I am using .net remoting for inter-process communication between two processes on the same machine 1.   The first process is one of the Office application: Ecxel /   Word /   PP 2.   The other process is another application that interacts with one of the above. For that it needs office application object. For example: Excel The solution is comprised with 3 projects: Project #1: The remote object is a simple Called RemoteOfficeApplication – that simply wraps the required application object (Word / Excel / PP).   Project #2: The Server is a simple Office add-in, written with a Visual Studio Extensibility -> Shared project. This add-in is instantiated whenever Excel is lunched. This project reference project #1. Code: var channel = new TcpChannel (5003); ChannelServices.RegisterChannel(channel,true ); RemotingConfiguration.RegisterWellKnownServiceType( typeof (RemoteOfficeApplication.RemoteOfficeApplication ), “AppObj”, WellKnownObjectMode .Singleton);   Project #3: The Client is the process that requires the application object. This project also reference project #1. Code:   //Get Remote object proxy object remoteAppObject = Activator.GetObject(typeof(RemoteOfficeApplication.RemoteOfficeApplication), “tcp://localhost:5003/AppObj" ); //Cast the proxy var r

How to create an extremely large array/object (> 2 GB) without using jagged arrays ?

Hello,I had implemented a matrix scaling algorithm in Java (64-bit) for a university project and have now implemented the code in C# with .NET 3.5 64-bit. One of the operations I did in Java was creating a rectangular array with double[][] = ... (in C# this is a jagged array!) to store a symmetric matrix which is used as input for the algorithm. Since I was using matrices with n up to 30720, memory usage for the single matrix object was around 8 GB in it's maximum and with matrix multiplication around 20 GB.So... now I implemented this in C# and I am shocked to see that double[,] (rectangular arrays) can only be 2 GB in size even on 64-bit! That means that for matrices with n larger than ~15000 I will get OutOfMemory Exceptions although there is a huge amount of free memory (I have two quad core systems with 12 GB and 24 GB Ram). When I use jagged arrays in C# (i.e. double[][]) I can create larger matrices. That is because I have one small array with the size of the row number (i.e. n) and then for each row an array of size n, but they are all single objects so I don't reach the 2 GB per object limit. The problem with jagged arrays is that they are horribly slow for matrice calculations compared to rectangular arrays and even slower compared to single dimension arrays.Actually I intended to rewrite my code and simulate the matrices in single arrays (see sample code below) bec

How to create Object in Object Test Bench

Hi,I used Object Test Bench to test my classes in VS 2008 professional edition . Right click on Class name and then selected create instance ,then its Constructor, there comes a dialog box, that just gives a message and a TextBox field is present there, i filled that field with any name and clicked OK.Then error message comes that "Create Instance Failed" and its error code is "0x80004005" . What's this ? How to instantiate object of my classes ?

How to Create SiteCollection through SharePoint Object Model?

hi all, i want to create site collection through programmatically. i used below code but iam getting error as "object reference not set to instance of an object"   SPSite site = new SPSite("http://servername:7833/");   SPWebApplication oweb = site.WebApplication;   SPSiteCollection sitecol = oweb.Sites; sitecol.Add( "sites/sitename", "sitename", "welcome to site collection", 1033, "STS#0", "Domian\\user", "User Display name", "user mailID"); oweb.Update();   iam getting an error at sitecol.add line the error is "Object reference not set to an instance of an object". please suggest me in order to remove the error. please suggest me if is there any other way to create site collection through programmatically. thanks in advance..

View Definition for SP 2010 Client Object Model

Hello, I am looking for where in the SP Client Object Model that I would find where the View Definitions are Located. For various reasons, I am displaying in my own custom listview a list of Documents and I would like these list results to share the same look as if the user was looking at the list in SharePoint.Please note this is NOT web based, but an application. Can someone give me a hint as to how to pull a view definition? Thanks, Andrew

Create a datetime object as dd/mm/yyyy

Hi i want to create a datetime object in the way dd/mm/yyyy but the defualt behaviour of datetime object is mm/dd/yyyy. I want this because my user enters date in dd/mm/yyyy format and i want to apply different additions and subtrations on this format. I know how to display dates in different formats. 

Details View Biding Custom Object with Enum properties fields

Hello, I'm trying to bind custom object to details view. The problem is that enum property fields are not show.Is there any way to show enum property fields in details view ?I put some example code below (I do not specify any rows mappings, they are generated dynamically because different kind of objects are bound to details view):// My object public class OrderItem { public ItemKindEnum unitemizedItemKind { get { return (ItemKindEnum)this.unitemizedItemKindID; } } ... } // Details view configuration <asp:DetailsView ID="dvOperationDetails" runat="server" DefaultMode="ReadOnly" ... />

Automation server can't create object

Automation server can't create object  I have this code working another server but not it stopped working  [CODE] <%@Language=JScript%> <% var mail = Server.CreateObject("CDONTS.NewMail"); mail.BodyFormat  = 0; mail.MailFormat  = 0; mail.ContentBase = ""; mail.To = "mZaragoza@xxx.com"; mail.From = "moisesz@xxx.com"; mail.Subject = "subject"; mail.Body = "tmpBody"; %> [/CODE] Error  Microsoft JScript runtime error '800a01ad'  Automation server can't create object  /app/test/mail3.asp, line 3  I have this code working another server but not it stopped working <%@Language=JScript%> <% var mail = Server.CreateObject("CDONTS.NewMail"); mail.BodyFormat = 0; mail.MailFormat = 0; mail.ContentBase = ""; mail.To = "mZaragoza@xxx.com"; mail.From = "moisesz@xxx.com"; mail.Subject = "subject"; mail.Body = "tmpBody"; %>Error Microsoft JScript runtime error '800a01ad' Automation server can't create object /app/test/mail3.asp, line 3 

How to create one instance of COM object that can be accessed from custom fields/workflows

Hi, Ive got a COM-object that is used to perform some actions on another server, and i can use only one instance of it ... But : 1. my custom fields must interact with it for fetching data 2. my custom workflows must interact with it for posting data So the question is : How to create only one instance of COM-object which can be fully accessible from custom fields/workflows ( custom too ) Thanks :)

Use the NEW keyword to create an object instance.

Private Sub textadd(ByVal sender as Object, ByVal e as System.Windows.Controls.TextChangedEventArgs)         txtfirstname.Text = txtdisplayname.Text 'TODO: Add event handler implementation here.     End Sub I almost wasted hours on figuring this error, I don't know how to fix this I got this error

Create List Sharepoint Client Object Model Access Denied



I am trying to create a silverlight application by making use of the SharePoint 2010 Client Object Model using the following code:

private void CreateList(object sender, ClientRequestFailedEventArgs e)
  ClientContext ctx = new ClientContext("http://server");
  ListCreationInformation lc = new ListCreationInformation();
  lc.Title = "FlexiTime";
  lc.Description = "";
  lc.TemplateType = (int)ListTemplateType.GenericList;
  List newList = ctx.Web.Lists.Add(lc);
  System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(CreateListCallback), ctx);

private void CreateListCallback(object s)
  var context = (ClientContext)s;  

The error I receive is as follows:


Urgent How to Create it ,Object Data Source ,Linq and sql or other any way


my query is



my data is

HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    Edlink
HR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    Edlink
HR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    Edlink
HR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010  

Unable to Create Object Variable for Linq Data Class


For some unknown reason I suddenly am unable to create an object variable for a Linq Data Class. If I create a new project and try the process again with the same database everything works as advertized.

The code I am using is Dim db As New RoggDataContext  which gives me an error on the object variable "db": Overload resolution failed because no accessibility 'NEW'  accepts this number of arguments.

I have looked inside every file in the Web Project like the web config to check the connection string, gobal, and designer.vb looking for any errors whit no JOY.  I also tried to create a new form and code behind with a button and received the same error.

This is mind blowing because as I already stated, I can create a new Web Site and the problem goes away.

Any help is appreciated!



How to use a object from the cache in a mvc View


I am working with asp.net mvc and i am trying to get acces to a object that is in the cache.
In the Application_Start() of Global.asax.cs i create and store an object in the cache like this:

Translator translator = new Translator();
HttpContext.Current.Cache.Insert("Translator", translator, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration);

Translator holds a dictionary with translations.

Now i want acces to this object from the cache to use functions and get values from the dictionary.

How can i do this?

I know i can acces it like this HttpContext.Current.Cache.Get("Translator") or Cache.Get("Translator") in the views
But how can i use the functions of the object ? The meaning of the cache is to have a object that is accesable througout the webapp right ?

Do i have to make an object and asses the value of the Cache.Get("Translator") to it, so i can use the functions or is there another solution?

How to create global object and let everybody use it and several questions


i want to create a global object and my all users should be using it


here comes several questions


my web server is working like a web farm

there is hosted only 1 website but it has 12 w3wp.exe 

my session state is aspnet_state


so if i use global object how many times will it be created

i mean how does this thing works


also all users will be excessively accessing this object

would this cause problem ?


and how can i create this object and use it


also can this object be hash table


thank you

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