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

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

Should you let external classes access webform controls?

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net

I was wondering if you should write code so that external classes and functions of that external class can access the webform controls in the main class???

Or should you only use the external class to process some data, return that data back to the main class (that instantiated that external class object) and then have an internal function in the main class to deliver the data to the control? (back to the screen)

View Complete Post

More Related Resource Links

How can I access a webform control from another external class/namespace?


Currently, I have many controls and objects such as Chart1 of mschart as part of the public partial class _Default : System.Web.UI.Page.

At the bottom, I've created a second class that is not part of the _Default webform class.  How can I access the webform controls from this second class?

For example, I want to do

Chart1.Series["Series1"].Points.AddXY((pointIndex + 1) * 40, datapoints[pointIndex]);

I want to pass pointIndex integer and the datapoints array.

I know that Chart1 was created protected global access modifier in the designer.cs but when I changed it to public, it still had a problem.


Access Classes in an aspx page that is in folder in asp.net


I have classes in App_Code:
Connection.cs, ClientData.cs ....

I have a folder Authenticated within it have an aspx page Client.aspx

How do I access the page through Client.aspx ClientData.cs the class, because there is a mistake for me to define the class as I do, please help me!

Share Point integrated SSRS reports rendering when access from external site


Our client has a SharePoint (moss2007) site on Windows 2008, SQL2008 R2 Enterprise, and Reporting service is integrated with SharePoint

The authentication on the share point integration is set to windows, else the authentication for the SSAS datasource gives and error

The extranet zone ( forms) and intranet (Customer Forms) and default (Windows) zones are all access from inside the firewall and the reports render in each with no issues, as the datasources are configured to pass a sql username and password.

However, report rendering is a problem from the internet (external site), the following error is displayed:

An unexpected error occurred while connecting to the report server. Verify that the report server is avai

The condition of creating assembly for external access permission?

To create an EXTERNAL_ACCESS or UNSAFE assembly in SQL Server, one of the following two conditions must be met: 1. The assembly is strong name signed or Authenticode signed with a certificate. This strong name (or certificate) is created inside SQL Server as an asymmetric key (or certificate), and has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission (for external access assemblies) or UNSAFE ASSEMBLY permission (for unsafe assemblies). 2. The database owner (DBO) has EXTERNAL ACCESS ASSEMBLY (for EXTERNAL ACCESS assemblies) or UNSAFE ASSEMBLY (for UNSAFE assemblies) permission, and the database has the TRUSTWORTHY Database Property set to ON. The two conditions listed above are also checked at assembly load time (which includes execution). At least one of the conditions must be met in order to load the assembly. This is a explanation on msdn.I think if only one of these condition is met,it will work. But after I do the first condition,I still can not create an assembly with EXTERNAL_ACCESS permission except SET TRUSTWORTHY on. should the two condition be met?  

External List - Access Selected Items

Hello, The situation;- An external list in SP 2010 from SQL A custom ribbon/button that calls via JS a Dialog box(Application page) and passes the selected items IDs Some code behind to process items after confirmation from user. Question is how to access the selected items in the code behind. As far as I can tell the JS 'getselecteditems' only returns the list ID, which in the case of a standard list is fine, but with an External list returns something like '_B00234' - how do I use this or how to return a more meaningfull ID? (I would rather work in my confort zone VB/C# than JS to process items) casey

Authentication for External Users to Access MOSS 2007 Resources

Our MOSS 2007 supports users from two domains that authenticate using windows.  Our clients WindowsXP in domain#1 and WindowsVista in domain#2 (which has presented problems authenticating to MOSS 2007.  I would like to give access to external users outside of those two domains.  However, our management does not want to establish trusts between domains.  What would be the best practice to accomplish this?  Additionally, will MOSS 2010 or Forefront resolve these issues?

WPF: Accessing Journal history of Frame by external button controls.

I am wondering if there is an easy way to use back and forward navigation of the frame journal but using buttons that are not part of the frame.  Thank you in advance.

Problems with access to external lists in SharePoint 2010

Our environment is SharePoint 2010 Enterprise, Windows Server 2008 R2 Standard and SQL server 2008 R2.   We have External lists that access a local database in SharePoint SQL Server. When new lists are added and permissions are given in the SharePoint Central Administration the domain users had to be in the Windows administration group to access the lists.   Recently in the same environment the domain users were removed from Windows Administration user group and could access the external lists.   In another similar test server we found adding the domain users to Windows Administration does not give the new domain users access to External lists.   The inconsistency is the issue. Has anyone seen this issue or provide a possible solution?

SQL 2008 External access returns wrong address for Report Manager

Hello, I have problems with the external access for report server. My report server is running in a local server on port 80, which can be accessed through http://servername/reports I have set up external access to the report server through http://servername.domain.com:8081/reports , so I set up a redirection from public port 8081 to port 80 on the local server. When I write the address http://servername.domain.com:8081/reports in a browser, I get asked for user authentication(Windows domain user), which is accepted, but after that I get an error because the URL automatically changes to http://servername.domain.com/Reports/Pages/Folder.aspx (without the port 8081) If I write http://servername.domain.com:8081/Reports/Pages/Folder.aspx , it works. I can see the report manager home page and browse through my reports. But there are some links in the page that are built improperly, since they still point to the wrong URL (without port 8081). These are e.g. the Help link, the Report Builder link, the Details view link.  So I think there is something wrong with the response the report server sends, when I write ".../Reports" and returns ".../Reports/Pages/Folders.aspx" I haven't found any configuration file or property where this response is specified, neither where the report

Permissions:disable controls by roles(access pages too)(dynamically :each new role has special grant

HelloI have an application of many pages of consultation and same time I have a module of adding users by roles and creating accounts by role.(the application is ready but i cant manage the roles)the tutorials that i found are very useful to manage roles but its roles fixed before(administrators,supervisors)(http://www.asp.net/security/tutorials/creating-and-managing-roles-vb) if I add a new role (agent) i want to grant to this new role a new access to pages(different access than admin and supervisor) and disable new controlswhy not using checkbox to every new role checking a field related to databaseis it possible?if yes ,how can i begin?Thanks

Change to AD username causes trouble for external access to WSS 3.0

I have one WSS 3.0 site hosted on a standalone server. I have extended the site into an external zone that authenticates with Digest authentication. This has been working fine for the past year or so. We have been looking into changing the user account naming scheme for Active Directory, and have been testing the change out on my own account. In doing so, I am still able to access our Sharepoint site from the Intranet zone on our internal network, but not from the external web address. I have tried removing my account from the site collection, and even going into the WSS_Content.AllUserData SQL table and changing the account name from DOMAIN\OldUserName to DOMAIN\NewUserName. No matter what I have tried, I get "HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials. Internet Information Services (IIS)" when I try to log in with any username.   Help?

Do you have to instantiate all objects/controls on the webform in the behind code page?


Hello everyone.

I have a MSchart control in my webform called Chart1 which is part of the namespace:  System.Web.UI.DataVisualization.Charting.Chart 

I am developing a multi-user (simultaneous connection) to a webform that manipulates controls and displays data on the graph.  Anyhow, I am immediately calling the Chart by using the reference: Chart1.Series.etc.etc.  or Chart1.Series.Addpoints. etc.etc.

My main question is, do I need to do a System.Web.UI.DataVisualization.Charting.Chart Chart1 = new System.Web.UI.DataVisualization.Charting.Chart();  inside  my page_load so that each user gets their own object instance of the Chart1 object?

So that way, if a second user changes the XY data, while the first user just changes the axis, then when the first user re-loads the updated graph, he does not get wrong data (overwritten) by the second user during a cross-session usage?

So must I create an object instance for all users for the MSchart control?


External Sharepoint 2007 Personal Site Access



I would like to have our current Sharepoint 2007 Personal Sites accessible externally to the end users via https and forms based authentication.

Can anyone advise the steps/best way to achieve this?






Not able to access web controls



I am new to asp.net. I am creating a very basic project.

I have a Default.aspx page under WebSite1 folder and also I have App_Code folder under WebSite1 folder. There is a class appCode.cs under App_Code folder.

There are some controls on Default.aspx page like label1, label2, textbox1 etc., I want to access these controls from appCode.cs class.

Can anyone pls answer that how could i achieve that.


Enabling external access to SharePoint via ISA web publishing rule


The current setup is something like this:

The SharePoint 2007 farm is a member of DomainA (2008 R1), as is the ISA2006 array that publishes SharePoint using FBA.  Delegation from the ISA FBA to SharePoint is set to negotiate and Kerberos is set up.  All company user accounts are in DomainA.  All access to SP by users is via ISA (odd, I know, but we are bit like a 3<sup>rd</sup> party supplier with a single client in that regard)

This works fine for company users but now I need to allow access to external users.  The 2 requirements I’ve got (and am struggling with) are:

1.       External users should be required to authenticate against ISA first, as it the case for company users

Access controls in DataTemplate


I am having troubles accessing controls inside datatemplate from my code. I have seen a lot of examples on the internet but haven't managed to get any of them working in my application, so hopefully someone can help me out here. My application has defined a custom control (masterpage). The code follows here:

using System.Windows;
using System.Windows.Controls;

namespace MasterPage
  public class MasterPageControl : Control
    public static DependencyProperty MainContentAreaProperty =
      DependencyProperty.Register("MainContentArea", typeof(DataTemplate), typeof(MasterPageControl));

    public static DependencyProperty HeaderContentAreaProperty =
      DependencyProperty.Register("HeaderContentArea", typeof(DataTemplate), typeof(MasterPageControl));

    static MasterPageControl()
      DefaultStyleKeyProperty.OverrideMetadata(typeof(MasterPageControl), new FrameworkPropertyMetadata(typeof(MasterPageControl)));

    public DataTemplate MainContentArea
      get { return (DataTemplate)GetValue(MainContentAreaProperty); }
      set { SetValue(MainContentAreaProperty, value); }

    public DataTemplate HeaderContentArea
      get { return (DataTemplate)GetValue(HeaderContentAreaProperty); }
      set { SetValue(HeaderContentAreaProperty, value); }

Granting external non-domain users SharePoint 2007 access?

Hello all,

As you can well surmise, I've installed SharePoint 2007 on a server and require assistance. We have two sites. The primary site is for internal use only and the other site, a sub-site, is for communications and collaboration with select colleague organizations who are not members of our domain. How can I add these users to allow them access to this sub-site without giving them user accounts in our domain?

What I have done so far is enable SSO and add our users to have rights on the root site. That all works. I then created the sub-site. As a test from a thread I found, I added my GMail account username as a local user account on the SharePoint server. This did, indeed, allow me to add that user and give him rights to login, but I discovered that there is no way to modify the user's profile and, thusly, cannot specify an email address. What good is SharePoint is you can't get email notifications from it?

It then occured to me to create a new user group in the DC and create accounts for them there while at the same time limiting their access to only the SharePoint server and not have any local or remote login rights. Interestingly, the accounts will login after three tries, and then shows blank pages.

Anyway, what I need is to get these users in, have enough profile information that they can receive email from the server as neede
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