Security :: PrincipalPermissionAttribute With An ObjectDataSource And A FormView

Mar 27, 2010

I have an ObjectDataSource which refers to a class in my business logic. I have added this code

[Code]....

to a method within the class. That is the method specified as the UpdateMethod of the ObjectDataSource. The ObjectDataSource is attached to a FormView. I am seeing the following behaviour: Before I add the attribute, the update function works as expected; With the attribute, if the user has TestRole then the update works as expected; With the attribute, if the user doesn't have TestRole then the update method does not execute, but no exception is thrown. So, the functionality is restricting access to the method exactly as it should. However, no exception is thrown when access is denied.

As an aside, I have tried adding the attribute to the class rather than to the specific method. With that in place, I do see an exception (if the user does not have TestRole) as soon as execution goes anywhere near the class. This cannot be my final solution though as different methods in the class need different restrictions. Obviously, I don't want the update to fail silently, I need the exception to be thrown so that I can handle it.

View 5 Replies


Similar Messages:

Security :: PrincipalPermissionAttribute?

Jan 12, 2011

I am using PrincipalPermissionAttribute to determine which methods can be called in my WCF based on roles.The only problem is that, after putting in these attributes in my c# code, i can no longer run/test locally. It has to be done on the server thats on the domain. Is there a way to disable PrincipalPermissionAttributes for loopback?

View 15 Replies

Use ObjectDataSource With Complex Objects And FormView Control?

Dec 30, 2010

I have a complex object. For example a SCHOOL object that contains a collection of PERSON object. How can I use the ObjectDataSource control with a FormView and flatten the complex object? An example display would be to display the school name and comma separate the students on the page. Is this possible?

public string Id
{
get { return m_id; }

[code]...

View 1 Replies

How To Get The Inserted Id Or Object After An Insert With The FormView/ObjectDataSource Controls

Feb 22, 2010

I have a series of classes that loosely fit the following pattern:

public class CustomerInfo {
public int Id {get; set;}
public string Name {get; set;}
public class CustomerTable {
public bool Insert(CustomerInfo info) { /*...*/ }
[code]...

View 1 Replies

Formview With Objectdatasource Generating Invalid Update Parameters?

Jun 23, 2010

I've a form view with various field in edit and an object datasource where I've defined my update parameters that my update method takes. I've set some of the fields in the edit template to read only because I want them to display.

Unfortunately they are getting passed in as update parameters somehow to my objectdatasource.
So, it is generating update parameters that causes my method to not match.

How can I exclude these parameters from getting sent to update?

View 1 Replies

ObjectDataSource And FormView: Add UI Edition Behaviour From Business Layer?

Nov 3, 2010

using an ObjectDataSource and a FormView.In the FormView I have a set of controls. When the FormView is in edition, I have in particular a ComboBox and a TextBox which are related as follows: when the ComboBox takes some special values, the TextBox must be read only or not. or the moment I get that behaviour as follows: the ComboBox triggers a postback when its selected item is changed and in the 'OnPreRender' of my page I get the value of the ComboBox and update the Readonly property of the TextBox accordingly.What I don't like with this method is that I don't use my object model which is consumed by the ObjectDataSource. The problem is simply that when the FormView is in edition there does not seem to be a way to get the instance of the object which is being edited. The 'DataItem' is null and I haven't found any way to automatically build a new object from the values in the controls to pass it to my business layer. Of course I could do the whole job myself by getting explicitly all the values in the controls, but that's not nice.

View 1 Replies

ADO.NET :: Connecting Linkbuttons In A Formview Control To An Objectdatasource's Method?

Jan 6, 2011

I am developing a multi tiered web application in which I have a Formview control on the main page.

I want to use link control buttons for inserting and updating records.

What I am not sure about is how to point them at the correct methods in my data class.

I now that this will require me to drill down into the formview to access the formView

View 3 Replies

Forms Data Controls :: How To Set The Selectedvalue Of A Dropdownlist With Another Objectdatasource Used For Formview

Aug 10, 2010

I'm using a FormView which has odsMain as the datasource. I am also using a dropdownlist which is being populated with objectdatasource odsddl.

I'd like to set the selectedvalue of the dropdownlist with the value contained in odsMain (the current record value for it). Is there any way this can be done?

View 6 Replies

DataSource Controls :: Linq / ObjectDataSource With Only A Few Database Fields On Formview

Feb 24, 2010

I am working on an application and am attempting to use Linq with and ObjectDataSource but I only want to display/update 50% of the fields that are in the corresponding table. It appears to me that for this to work correctly, I need hidden fields on my form for all of the data fields from the table that the user cannot access. Is this the only way to do this? I have the following in my update method of my ODS:

[Code]....

The problem is, only the fields that appear on the form have data in them.

View 1 Replies

Forms Data Controls :: GridView Inside FormView With ObjectDataSource

Mar 20, 2010

I have an ObjectDataSource giving me data similar to: OrderNumber OrderDate OrderValue OrderItems The first three are simple data types and the last has multiple occurrences of another class: OrderLineNumber OrderItem OrderQuantity The ObjectDataSource will only contain one row (which might make things simpler). So, there will be one OrderNumber, OrderDate and OrderValue; and then several occurrences of OrderItems (each containing OrderLineNumber, OrderItem and OrderQuantity).

I am displaying OrderNumber, OrderDate and OrderValue in the FormView - that work's fine, as expected. I have placed a GridView within the FormView and am failing miserably to get it to bind to OrderItems. I have tried the obvious things like specifying "odsWhatever.OrderItems" as the DataSourceID for the GridView, but to no avail.

View 4 Replies

Forms Data Controls :: FormView - Set ObjectDataSource And Readonly Properties

Mar 25, 2011

I have a FormView bound to an ObjectDataSource that is bound to a business logic object. The business logic object has a Readonly field called "Id". When I try to update the formview, I get the following error message: The 'Id' property on the type specified by the DataObjectTypeName property in ObjectDataSource 'ObjectDataSourceNewsArticle' is readonly and its value cannot be set. How do I get the ObjectDataSource or the FormView to recognise that the id field is readonly, and to not try to update it?

View 3 Replies

Forms Data Controls :: FormView Refresh Schema With ObjectDataSource Not Working

Jan 22, 2011

I'm having a problem with a FormView control that I have bound to an ObjectDataSource. The problem is that the FormView control is not automatically filled in with the public properties of the object linked by an ObjectDataSource control when I select refresh schema. Everything compiles and I can add fields manually, but there are a lot of properties in the class and I do not want to deal with adding all the fields by hand. It's not the end of the world of course if I have to add them manually, but I'm bothered more by the fact that it doesn't act the other formviews.

Has anyone ever experienced a problem like this? I have other objectdatasource controls with other formviews that properly refresh their schemas. I noticed that in the objectdatasource control that is giving me problems, the DataObjectTypeName field is not automatically set as it is in the others. However, after adding it manually it still doesn't refresh the schema. I'm using Visual Studio 2010. Defined in .aspx page:

[Code]....

The SPFModuleBLL class contains the GetModule2() method which is shown here:

[Code]....

View 3 Replies

Forms Data Controls :: ObjectDataSource Cannot Access GridView Control Inside FormView

Apr 16, 2010

Basically as the title of this thread states, I have a FormView that has a GridView inside it and my ObjectDataSource that populates this grid cannot access the Grid.

The Control Id needs to be the name of the Grid I want to access, however through the 'wizard' the Control parameter drop down cannot 'see' the grid I need, only the FormView that is in.

I have tried numerous ways to get round this and am struggling now..

I've tried the following...

ControlID="FormView.GridView1"

ControlID="FormView.FindControl("GridView1")

ControlID="<%= GetNameOfGrid %>"

and numerous other attempts that also failed that I now cant remember...

View 2 Replies

Forms Data Controls :: Formview Paging Not Working With Objectdatasource And Viewstate Setup?

Oct 7, 2010

I was able to get the formview bound to the objectdatasource, it works great for the first record, but when i select the next record it gives me error below is all my code, if there is something else that i need to post .

[Code]....

View 3 Replies

Web Forms :: Nested Formview - Link Parent Formview Control In Editmode With Child Formview Control In Insertmode

Apr 8, 2010

i have the following scenario: one formview. when in editmode there is a child formview linked to the other by a column value. i need to take the value of one of the values of parent formview controls and set it to a textbox of child formview in insert mode. I wish to know which event should I use in codebehind to bind both controls? (that escenario will have paging and must keep the binding as if it was master detail)

View 9 Replies

Security :: CreateUserWizard Inside FormView Control?

Jan 24, 2010

I have tried to use CreateUserWizard control inside Formview to avoid manual coding. CreateUserWizard control is a member of InsertItemTemplate of FormView control, I have bounded all the input controls inside CreateUserWizard to database fields but when I click on create user button I get following exception

SQLBindParameter not used for all parameters

after getting through some links I got to know that this may be beacause of mismatch between no of ? marks with specified insert paramters.

View 1 Replies

Security :: FormView In A LoginView On Updating Access To Form Fields?

Mar 21, 2010

We have a page that contains a loginView and in the LoggedinTemplate is a FormViewTemplate. The display part works fine.

Not all fields are databound due to special hadling needed on diaplay anu onUpdating. The display part works fine. However in the onUpDating procedure. I can't figure out HOW to gain Access to the field content in unBound FormView Fields. I need that to determine and set the output fields that need special handling.

I tried from the formView

[Code]....

View 2 Replies

Forms Data Controls :: Set Value To Textbox In Nested Formview From Parent Formview Label?

Apr 10, 2010

I have a nested formview. I need to set a value for a textbox when I'm in insert mode from parent formview which is editmode.

View 4 Replies

Forms Data Controls :: Formview That Use The Formview Iteminserted Event?

Jan 24, 2010

I have a formview that use the formview iteminserted event. The information inserts into the formview fine, but all cells blank out after the insert. How can I make it so I can show all the values I have inserted show up in the formview after the inteminserted event?

View 2 Replies

Forms Data Controls :: FormView Clearing Value Set In Page_load / Initialize A Date Field In The FormView to Today's Date?

Sep 2, 2010

I have a page with a FormView on it. The page is strictly for adding records to a Table. I have the FormView bound to an EntityDataSource and everything works greate except for one thing.

I want to initialize a date field in the FormView to today's date. So, in my page_load event I have:

if (!Page.IsPostBack)
{
//Initialize SetupDate to today.
TextBox setupdate = (TextBox)fvJob.FindControl("txtSetupDate");
setupdate.Text = DateTime.Now.ToShortDateString();
}

The first time this page loads, the txtSetupDate field is initialized.

Although, and subsequent loads of the page doesn't initialize the Text Box. I step through the code in the debugger and I can see that the code is executig, but something (the FormView bind?) is "clearing" the Text Box.

View 6 Replies

How To Put The Data In The Formview Control With The FormView

Jan 18, 2010

I have a formview that I am adding and editing items. I need to have a lookup button besides a textbox so I can click the button and show a webgrid listing items with their descriptions. Select one and enter the data in the formview control. I know how to put the data in the formview control with the FormView.FindControl method. But how can I add a lookup? Can I do this with a popup panel? And on the postback update the textbox control?

View 5 Replies

Forms Data Controls :: Accessing Master Formview Data From A Nested Detail Formview?

Sep 10, 2010

I would like to ask if it is possible to access data on a master FormView from a nested detail FormView.

I have a main form (master) with several tabs (detail) and would like to display a label with text from main form that is hidden by the tab at the moment of editting. My asp page looks like this.

[Code]....

Is it possible to get the value of the label CompanyTextLabel from CompanyTextBox using just ASP.NET expressions or something similar without writing c# code in .cs file?

View 4 Replies

C# - GridView And ObjectDataSource?

Oct 11, 2010

I have a grid view that bounded to an object data source that select data from type of student

public class student
{
int id;

[code]...

View 2 Replies

Binding A ListBox To An ObjectDataSource?

Apr 6, 2011

I tried binding a ListBox to an Object Data Source, but I can’t get the field to show up in the Data Source Configuration Wizzard for the ListBox. I got it working programatically populating the listbox using the DataReader but I’d like to be able to use the Object Data Source (Unless there are compelling reasons not to that I haven’t heard of yet.)

The code:

[code]....

View 12 Replies

How To Set ObjectDataSource Datasource To A Class

Jul 28, 2010

i created an objectdatasource and bind DetailView to it.i want to set the objectdatasource.datasource to a object (for example Member class that is an Entity) it means that i want to show just one record to this with my custom method that is MemberModel.GetMemberByNationalID(string nationalID)

View 1 Replies







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