Security :: How To Expose More Properties Under User Class

Jul 16, 2010

I am using a custom membership provider. I want to expose additional properties under User class.

So in my custom membership provider class I added few Properties (FirstName, LastName, Address, etc) and set their value in ValidateUser(). However back in aspx.cs if I type User. I do not see FirstName, LastName and Address in intellisense.

Is what I'm attempting to do even possible? Or do I need to resort to using my own custom user class? In which case I wouldn't need to use custom membership provider because I can program my custom user class to do everything that custom membership provider can do. Only thing is I would need to pass this user object in session object.

View 3 Replies


Similar Messages:

Web Forms :: Expose Server Control As Properties?

Feb 14, 2010

Is it possible to expose server control as properties? See below.

[Code]....

Now If i pass Panel1, it's string. Casting error. How do i get around this.

View 1 Replies

How To Expose Child Control Style Properties In A Custom Composite WebControl

Feb 23, 2010

I am writing a custom composite WebControl and want to expose styles of child controls it encapsulates to the ASP.NET designer. The code I currently have is similar to the skeleton below (which for simplicity only has one child control).

With the code below, I can see property "ChildPanelStyle" in the designer, but when I try to modify one of the properties (e.g. CssClass) in the designer, it immediately resets itself to its default value. It looks like the designer serialization isn't happening.

What am I doing wrong?

UPDATE

I've updated the sample with an additional style property that is managed directly by the custom control, rather than simply being the property of a child control.

The HeaderStyle property is persisted properly by the designer, but the ChildPanelStyle property isn't.

Of course I could manage all my styles like HeaderStyle, and apply them during rendering, but I'm hoping there's a simpler solution whereby child controls can take care of themselves, and I don't need any custom rendering.

[code]....

View 1 Replies

Forms Data Controls :: How To Expose The Properties Of A Hyperlink Column In A Gridview

Jan 3, 2010

how can I expose the properties of a hyperlink column in a gridview so I can program then in vb code? For example I want to change the property of the DataNavigateUrlFormatString programatically using vb code? How can I do this?

View 5 Replies

Web Forms :: Reusing Class Properties Invoked In Masterpage In A User Control

Feb 2, 2010

I'm working on a project that uses a master page. When the page loads I'm calling a class (which I feed and ID into) to get back certain values for a location that the user has selected. Things like town name etc.

On the home page I have a user control which has some statistics for that location too.

Is there a way that I can get the user control to pull values from the class invoked by the Master Page (which has already been fed the ID, hit the db and pulled back the values), rather than creating a new instance of the class within the user control and having to supply the ID and hit the db all over again? This is now I'm calling the class in the masterpage. I have a method "CheckForStoredLocation" that goes off and gets all the data I need.

[Code]....

View 4 Replies

Security :: Membership Provider, Cusomt User Properties?

Jul 7, 2010

I am using the Membership provider that is included in Framework 3.5. I need to be able to add properties to the user such as country and birth date. I have read about the alternative provider that microsoft distibutes called TableProvider where you can define extra properties in the webconfig. I hesitate a bit about using it as there where some stuff about adding rules to the database to allow access. Since i use a hosted server and i am almost clueless about database administration it got me enough worried to think out my own solution. A. any feedback about using table provider from people that have experience of it?

View 4 Replies

Security :: Any Asp_net Function For Accessing Profile Properties Of A User?

Dec 17, 2010

I am using my aspnet membership for storing user profile related information in the database and I am looking for a way to access that information out of database from a function like Member.GetProfile. I am just wondering of any of the membership classes give thet functionality that I can actually access the information out of Membership database.

Somebody suggested me follwowing thread:

[Code]....

I am "Profile" object is not recognized in my code I think they are trying to refer to some some instance of a class here by the word Profile but I am not sure what instance is that.

View 2 Replies

How To Expose A Panel As A Property In User Control

Aug 20, 2010

I have a user control with a panel on it:

CustomControl.ascx
<%@ Control Language="vb" CodeBehind="CustomControl.ascx.vb" %>
<asp:Panel ID="myPanel" runat="server"></asp:Panel>

I'd lke to expose that panel as a property that I can use at design time.

CustomControl.ascx.vb
<ParseChildren(True), PersistChildren(False)> _
Partial Public Class CustomControl
Inherits System.Web.UI.UserControl
#Region "Members and Properties"
<PersistenceMode(PersistenceMode.InnerProperty)> _
Public Property SomePanel() As Panel
Get
Return myPanel
End Get
Set(ByVal value As Panel)
myPanel= value
End Set
End Property
#End Region
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Write(myPanel.HasControls.ToString())
End Sub
End Class

And then bring the control onto a page like so:

<ucl:CustomControl runat="server">
<SomePanel>
<asp:Label ID="lblText" AssociatedControlID="txtBox" runat="server"></asp:Label>
<asp:TextBox id="txtBox" runat="server"></asp:TextBox>
</SomePanel>
</ucl:CustomControl>

When I run the page, HasControls is true but nothing is rendered. What am I doing wrong?

View 1 Replies

C# - Webservice Complex Types And Class Inheritance - Use The Properties Of The Base Class?

Mar 13, 2010

Using the following Webservice definition using aClientArgs as a complex type:

[System.Web.Script.Services.ScriptService]
public class Controller : System.Web.Services.WebService {
[WebMethod]
public void save_client(aClientArgs client)
{
// Save client data
}
}
Then defining aClientArgs as a sub-class:
public class aArgs
{
public string id = null;
public string name = null;
}
public class aClientArgs : aArgs
{
public string address = null;
public string website = null;
}
Returns the following WSDL fragment for the save_client args:
<save_client xmlns="http://tempuri.org/">
<client>
<address>string</address>
<website>string</website>
</client>
</save_client>
When I'm expecting the following:
<save_client xmlns="http://tempuri.org/">
<client>
<id>string</id>
<name>string</name>
<address>string</address>
<website>string</website>
</client>
</save_client>

So it appears that the .NET WebService is not treating inherited properties as arguments/variables for purposes of a web service. How do I get .NET to also use the properties of the base class?

View 1 Replies

How To Define Properties And Methods Of Class That Inherit Stream Class

May 15, 2010

here is the code, where i am confused what to write in all the properties and functions of the base class stream?

I want to inherit abstract class Stream, but confused about what to write?

[Code]....

I could'nt understand how to define these Properties,Sub and Functions. How i start?

View 20 Replies

Web Forms :: How To Expose User Control Custom Property At Its Code Behind File

Mar 10, 2010

I created a simple gridview user control with a custom property ProfileType which should load different records depending on the ProfileType value when attaching to a web page.

This is my web page:

[code]....

how I can expose user control custom property at its code-behind file.

View 2 Replies

Security :: Create User - Membership Provider Class?

May 14, 2010

It's new to me to use the membership provider class.I was able to inherits the MembershipProvider in my library(HDIMembershipProvider.vb) and a lot of functions are generated. When I created the form to create a user like this:

[Code]....

Once the user clicks submit, how this function can be called ?

[Code]....

Each time I submit, the function is never called.

[Code]....

View 1 Replies

C# - Get All Properties For A Class Name Using Reflection?

Mar 21, 2011

I am loading the dll as shown below,

Type[] _Type = Assembly.GetAssembly(typeof(StdAdapter)).GetTypes();

Now I want to get all the properties for a particular 'class name' which is being passed as a string.

View 3 Replies

Web Forms :: Class Properties Not Staying Set

Dec 20, 2010

I have an ASPX page (import.aspx) that creates a new instance of a class.

[Code]....

I set several properties during a function call in import.aspx:

[Code]....

I have confirmed that the properties are being set correctly via debugging the application.

I have a user control on import.aspx. There is a function on import.aspx that gets called by a button click on the user control.

This function is:

[Code]....

When the UploadApp function is called, CaseNo is NOTHING.

View 8 Replies

Configuration :: Get Profile Properties In A Class

Jul 7, 2010

I've added sone profile properties.

[Code]....

I get a error that raid does not exist. I've tried both ways t and

[Code]....

View 5 Replies

MVC :: Can't Reference To Some Properties In Model Class

Mar 31, 2010

I'm reading a bit of Pro ASP.NET MVC Framework and following a few tutorials written in the book. In the very first tutorial, creating a MVC site for dinner (PartyInvites), I encoutered this problem. While I try to reference some properties from Model class, the compilation error occured. Eg. the following code failed.

[Code]....

and the error message

Compiler Error Message:
CS1061: 'object' does not contain a definition for 'Name' and no extension method 'Name' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) I imported the Model folder into the controller too. I dunno what I'm missing here. Sorry, if it sounds a bit umm hard to understand cuz I just started picking up MVC this morning. Looking for any input.

View 5 Replies

Accessing A Class Properties In Function?

Apr 15, 2010

I am unsure of how to reference the properties of my class in a function. Here is how I see it in my head, but how do i go about this?

WebService.vb

[Code]....

UserClasses.vb

[Code]....

View 4 Replies

Set View Properties From Another Class / Interface?

Nov 16, 2010

There is a SearchPage which has a properties ErrorMessage, SuccessMessage etc. This is basically a MVP pattern so for each page(view) there is IView that contains definitions for all the properties

I am using decoratoe pattern to set these peoperties dependingon the message type. There is another Interface IBaseMessage which has a method DisplayMessage() and a class BaseMessage which implements the interface. This class has a definition of the view

Interface IbaseMessage
{
DisplayMessage()
}
baseMessage:IbaseMessage
{
public Iview _view{get; set;}
DisplayMessage()
{
_view.Warning ="<message>"
_view.error="<message>"
}

Here, I am not able to set the message to the view properties. I am getting the error as "Object reference not set to an instance of the object"

View 2 Replies

Web Forms :: Access Aspx Class Properties From Outside?

Aug 19, 2010

I have added a static string variable inside a web page with it's class named VersionBase. The class is public, the variable is public, why can't I simply do VersionBase.MyString from anywhere inside the project like I can do with any other class?

View 13 Replies

What Happens With Unused Properties Of A Class When An Object Is Instantiated

Aug 5, 2010

I am interested to know what happens with unused properties of a class when an object is instantiated?

Are there performance hits for having additional unused properties? What about complex properties that are accessing the database, but I'm not using them, are they still being loaded?

View 1 Replies

Chained Base Class Properties Not Injecting

Apr 2, 2010

I am successfully injecting base class properties with spring.net with just a class that inherits from a base abstract class. Lets say Class MyClass : MyBase, and I am successfully setting a property like this:

<object id="myInstantiableClass" type="myAssembly.MyClass myAssenbly" abstract="true">
<property name="MyBaseClassProperty" ref="anotherObjRef"></property> </object>

Where MyBaseClassProperty is a property on the base class. Now I have another abstract class between the old base class and the instantiable class and I am trying to set properties on both the abstract classes. So MyClass : MyNewBaseClass and MyNewBaseClass : MyBaseClass. I have an additional property on the new base class (MyNewBaseClassProperty) and I am trying to inject it like this:

<object id="myInstantiableClass" type="myAssembly.MyClass myAssenbly" abstract="true">
<property name="MyBaseClassProperty" ref="anotherObjRef"></property>
<property name="MyNewBaseClassProperty" ref="someOtherObjRef"></property>
</object>

The property on the old base class is being injected but the one on the new one is not - and I am not getting an error or anything (so I am pretty sure my config is good), that property is just null! I am on asp.net (not MVC) and the class MyClass is a user control (ascx).

View 1 Replies

MVC :: Assign Values To Base Class Properties?

Sep 29, 2010

In my controller have a FormViewModel which inherits from a domain class declared in dbml. In the constructor of the FormViewModel I want to do a shorthand assignment to the inherited class properties with the passed in object (ie thisPerson) without iterating through each property of the inherited class and assigning its value with corresponding property in the passing in object. Should I use super, base, this, or something else?

[code]....

View 1 Replies

Names Of The Private Properties Of A Public Class?

Mar 12, 2010

Names of the private properties of a public class?

I have the following class

[Code]....

View 3 Replies

C# - Generate HTML To Represent Class And Its Properties?

Mar 2, 2011

Currently I have a class that represents a document. This document needs to be displayed as HTML. I would like to have a method to call such as GetHTML() that would then call GetHTML() on any properties/sections of the document that needed to be rendered. I was initially thinking about using linq and XElement but am wondering if that may cause issues with certain tags in HTML. Would I better off using an HtmlTextWriter?

View 2 Replies

Updating Properties Of A Class With Dynamic References?

Feb 17, 2010

I have a vb.net class with properties defined as follows:

Private m_Property1 As String
Public Property Property1() As String
Get
Return m_Property1
End Get
Set(ByVal value As String)
If IsNothing(value) Then
m_Property1 = String.Empty
Else
m_Property1 = value
End If
End Set
End Property

I can then set the values as follows:

classname.Property1 = "myvalue"

How do I set the value of a property that is defined dynmically eg

Dim strPropertyName As String = "Property1"

View 2 Replies







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