MVC :: Aggregate Object Pass As A Hidden Value?

Sep 16, 2010

How to use Html.Hidden for aggregate object?
For Example, I have Model1 which aggregates Model2.

Model:
class Model1
{..
public Model2 model2;
..
}
class Model2

[Code]....

View 2 Replies


Similar Messages:

How To Pass The Query String Using Hidden Fields In Vb.net

Feb 7, 2011

How to pass the query string using hidden fields in vb.net...

View 3 Replies

Web Forms :: Onclientclick Pass Hidden Field Value Aspx?

Mar 26, 2010

i would like to call the external js file's function onclientclick event, but how can i pass the parameter, which i get from the hidden field value from the same aspx file.

<asp:button id="btn" onclientclick="javascript:test(hidden_field);"/>

View 4 Replies

MVC :: How To Pass JSON Object As Dictionary Object

Oct 23, 2010

In MVC3 Beta version i have action result same like

public ActionResult Save(Dictionary<string, string> dicObject)

I want to pass JSON Object in POST Method from javascript and need to get as dictionary object

How can i do this? can you write example if possible?

View 5 Replies

MVC :: Object Properties Get Lost While Posting When Using Hidden Fields In View?

Jun 30, 2010

I am using hidden fields to save some preset data, but upon postback they appear to disappear.

Here's what my controller actions look like:

[Code]....

The view is coded like this:

[Code]....

But when the POST action receives the object back, some of the fields have become null. The FormCollection, however, contains all values. I realize I could just take everything from the formcollection but it's probably better practice to use the object, right?

View 4 Replies

Pass Data Between Forms - Error "Object Reference Not Set To An Instance Of An Object"

Mar 3, 2010

i am trying to pass data between forms.

Public selected_Month As String
Public Property Month() As String
Get
Return selected_Month
End Get
Set(ByVal value As String)
selected_Month = value
End Set
End Property

form1: where i am assigning a value

Dim my_Class As New Class1
my_Class.Month = ddl_Month.Text.ToString()
form2: where i am geting a value
Dim my_Class2 As New Class1
MessageBox.Show(my_Class2.Month.ToString())

when i run this code, i am getting error like Object reference not set to an instance of an object.

View 6 Replies

C# - Can Pass A .net Object Via Querystring

Jan 25, 2011

I stucked at a condition , where i need to share values between the pages. I want to share value from Codebehind via little or no javascript. I already have a question here on SO , but using JS. Still did'nt got any result so another approach i am asking.

So I want to know can i pass any .net object in query string. SO that i can unbox it on other end conveniently.

Update

Or is there any JavaScript approach, by passing it to windows modal dialog. or something like that.

What I am doing

What i was doing is that on my parent page load. I am extracting the properties from my class that has values fetched from db. and put it in a Session["mySession"]. Some thing like this.

Session["mySession"] = myClass.myStatus which is List<int>;

Now on one my event that checkbox click event from client side, i am opening a popup. and on its page load, extracting the list and filling the checkbox list on the child page.

Now from here user can modify its selection and close this page. Close is done via a button called save , on which i am iterating through the checked items and again sending it in Session["mySession"].

But the problem is here , when ever i again click on radio button to view the updated values , it displays the previous one. That is , If my total count of list is 3 from the db, and after modification it is 1. After reopening it still displays 3 instead of 1.

View 5 Replies

C# - Pass In An Object When Using An IoC Container?

Mar 8, 2011

I am doing a project in ASP.NET MVC in which I want to implement an IoC container. I am new to IoC containers and have been searching to find a solution to my problem, but so far to no avail.

The problem is dat data is distributed across various databases. Once a user is logged in, the database for the user is retrieved from an authorization database and then set in the user session. That user session is passed on to the services and repositories when they are constructed, so they can use it when they need it to access the database.

A typical bare stripped service (without interfaces and ioc) looks like this:

private CompetitionRepository _CompetitionRepo;
public CompetitionService(DataContext dataContext)
: this (new CompetitionRepository(dataContext))
{ }

[code]...

The "DataContext" contains a couple of properties with which the correct database is selected for the session. Because the Services and Repositories don't have access to the session itself (which is outside of their scope) they need this object.

View 1 Replies

How To Pass Value Object Class Dynamically

Jul 14, 2010

i have 10 classes and i want to send the class in a paramenter dynamically to call a method for example int addmember(aslogic.base obj) smilary i want to pass class in the parameter.

View 4 Replies

WCF / ASMX :: How To Pass Object To Web Service

Nov 4, 2010

I'd like to pass an object (Digital Persona featureset) to a web service. Can't seem to find a good way to serialize it.

View 4 Replies

MVC :: Pass Object From Action To View

Jan 20, 2011

I have the following action executed when a user selects an item from the dropdown;

[Code]....

The object paymentApplicationRefund is populated. I want to get the contents of this object to put in a Html.Textbox(). How do I proceed??

View 11 Replies

Allow Client Pass My Object Through Webservice?

Nov 12, 2010

I want to write a webservice, and in one of its methods, I want user to pass one my object's instance as parameter. It will greatly reduces number of parameters, and help user call this method more effectively. I create some class, but when distributing them to client, only class name remains, all properties and methods are gone, just like this

public class CameraPackages
{
private readonly List<CameraPackage> _packages;
public CameraPackages()
{
_packages = new List<CameraPackage>();
}
public void AddNewCamera(CameraPackage package)
{
_packages.Add(package);
}
public void RemoveCamera(CameraPackage package)
{
if(_packages.Contains(package))
_packages.Remove(package);
else
throw new ArgumentException();
}
}
into this: (in Reference.cs)
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3082")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class CameraPackages {
}

How can I do to allow user use my object?

View 1 Replies

MVC :: Pass Javascript Object Value To Controller?

Feb 9, 2010

Consider the following data

<xml>
<id>10</id>
<value1>15<value1>
</xml>

I need to use this data as an input to ajax request. For eg. consider a dropdownlist change event, I need to pass these values to the controller.

sample code

//dropdown change event
$("#TestReqID").change(function() {
var id = 10;
var testResults = "abc";
var inXML = "<xml>";
inXML = inXML + "<id>" + id + "</id>";
inXML = inXML + "<value1>" + testResults + "</value1>";
inXML = inXML + "</xml>"
$.getJSON("/Home/UpdateTest/Json/" + inXML, function(data) {
//success code goes here
});
});

in HomeController

public ActionResult UpdateTest(string obj)
{
if (HttpContext.Request.IsAjaxRequest())
{
/*
Need to parse data in "obj" from ajax request
*/
IPTests test = _service.GetIPTest(Convert.ToInt32(id));
return new JsonResult { Data = new { ipTestId = "0", testResults = "" } };
}
return View(test);
}

instead of xml string is it possible to use javascript object like

[Code]....

View 2 Replies

C# - Pass Object From Webserver To Client?

Jun 9, 2010

I developed a C# web application that calls a web-service which returns a base64 encoded array (PDF file). I then convert that array into a UCOMIStream object (I know it is obsolete, but the DLL that I am using requires it as a parameter). I use the following code to do the conversion which works perfectly. I can pass this object to the DLL so that I can print the PDF.

This works great on the Webserver, but the requirement is to print it locally.

Byte[] bBuffer = statementOut.statementcycle.statementdata.content;
int size = bBuffer.Length;
IntPtr mem = Marshal.AllocHGlobal(size);
Marshal.Copy(bBuffer, 0, mem, size);
// Create an OLE Stream object.
System.Runtime.InteropServices.UCOMIStream str; //obsolete but the createstreamonhglobal outputs it
CreateStreamOnHGlobal(mem, true, out str);

The DLL resides on the client so I am able to use ActiveX to create the object using javascript and/or VBscript;however, I have not been able to figure out how to get the stream object to the client to pass to the DLL.

View 2 Replies

Pass A Sql Connection Object By Reference?

Mar 7, 2011

using vb.net/asp.net 2005.

I am trying to pass a sql connection object by reference ("ByRef") like so but when I'm inside the function that i'm passing it to it sees the connection as closed, what am i doing wrong?

[Code]....

View 1 Replies

Can Pass An Object Between Separated Applications By Web Service

Dec 26, 2010

I have a web service Writed By VB.net Lang return a DataSet Contain many rows , I tried to Call this Web Service From Java applicationput Java Language cant Deal with dataSet , So I need to Convert the Dataset to an Object

<WebMethod()> _
Public Function GetLogBook(ByVal EmployeeNumber As String, _
ByVal EmployeeName As String) As DataSet
Dim ds As New DataSet
Dim conn As New
[code]...

View 3 Replies

WCF / ASMX :: Can Pass Object In Rest Service Uri

Jan 18, 2011

can Pass object in Rest Service Uri

View 1 Replies

How To Pass 'user' Object From Aspx To Silverlight 4

Dec 28, 2010

First, we are constrained to using an existing web framework that handles authentication and authorization. The web project uses forms authentication and writes to an encrypted cookie. The user information is exposed to the aspx pages as a property:

LoggedInUser.Current

This has several properties including the userId and role list.

I've looked at using initParams, but haven't been very successful there (edit: I couldn't do it dynamically originally). I've created a simple POCO entity with a [Key] attribute, but I need to at least be able to pass the userId from the aspx page to the imbedded silverlight.

What is the easiest way to pass a dynamic object from aspx to silverlight 4?

[Code]....

Then used Slugster's example to use the values on the Silverlight side.

Warning: Passing user information via init params exposes the info as plain text to the user viewing the page (they just have to view the source). We ended up using an authentication domain service and using the same user object as the aspx

View 2 Replies

.net - Identifying The Aggregate Roots?

Mar 9, 2011

Let us assume the following relationships (diagram). A FundCompany has Funds, and Accounts. There is also a FundAccount which creates a many-to-many relationship (as well as other attributes at the relationship level) between Accounts and Funds. Lastly an Account has one or more Beneficiary.The FundCompany is an aggregate root as it's at the top of the pyramid. Neither Account nor Fund can exist without the FundCompany. FundAccount cannot exist without both Fund and Account; does that make them both aggregate roots? Or is Fund still the only aggregate root, having to go through it to perform operations on FundAccount entities? The fact that the Account also has Beneficiaries, which cannot exist without the Account, does that also signal Account being an aggregate root?

All of the entities on this diagram will require CRUD operations and screens in my application. The reason I'm bringing this is up is most often every UI screen will store the ID of the row/entity it's referencing. So for example a user clicks "Details" on a table with Funds, I might need to retrieve a fund via its ID. My understanding is that if an entity needs direct access then it's an aggregate root in itself. However this would make a lot of entities aggregate roots by default.Based on the answers to above questions I have to map these operations to the proper aggregate root's repository.

View 1 Replies

DataSource Controls :: Pass Object As SessionParameter In ObjectDataSource?

Dec 28, 2010

Is it possible to pass a domain object as session parameter in an ObjectDataSource. I'm doing this:

<asp:ObjectDataSource ID="ParticipantsDataSource" runat="server" OnInit="SqlDataSource_Load"
SelectMethod="LoadParticipants" TypeName="SB.Web.units.Players">
<SelectParameters>
<asp:SessionParameter Name="user" SessionField="User" Type="SB.BusinessLogic.DomainEntity.User" />
</SelectParameters>
</asp:ObjectDataSource>

But I get the error message that I can't create an object of the type System.TypeCode from the string containing SB.BusinessLogic.DomainEntity.User for the property Type.

View 1 Replies

Security :: Pass Membership Identity Object Across Domain?

Aug 20, 2010

I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?

View 2 Replies

Pass Key Of Grid To Business Class Via Object Data Source?

Sep 15, 2010

In ASP.NET Webforms have an ASP.NET GridView connected to a C# class via an object data source

I have an ID set up as a DataKeyName in the grid. How do I pass this to the C# class when I update the grid?

View 15 Replies

Pass Key Of Grid To Business Class Via Object Data Source

Jan 21, 2011

In ASP.NET Webforms have an ASP.NET GridView connected to a C# class via an object data source

I have an ID set up as a DataKeyName in the grid. How do I pass this to the C# class when I update the grid?

View 2 Replies

C# - How To Pass The Data Path For Object Flash Tag From The Root Directory

Sep 21, 2010

I'm using urlrewriting to rewrite my url. Let me introduce my problem by bellow example: Here is old url: http://localhost/test/pages.aspx?pageid=1 I have 2 cases to rewrite:

http://localhost/test/url-rewriting-get-start.aspx
http://localhost/test/url-rewriting/get-start.aspx

The first case is ok, but I would like to use the second case. In this case I must use root path for image, css and object tag (for flash):

With image, I modified to: <image src="~/images/icon.jpg" runat="server"/>
With css, I modified in head tag: <head runat="server">

But with the object tag, I don't know how to set root for the data, movie parameter:

<object data="anim/head.swf?xmlPath=./menu_flash.html" type="application/x-shockwave-flash" width="962" height="228">
<param name="movie" value="anim/head.swf" />
<param name="quality" value="high" />

View 2 Replies

DataSource Controls :: How To Pass An Object To The Selectmethod Of The Objectdatasource Control

Mar 31, 2011

how to pass an object to the selectmethod of the objectdatasource control?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved