.net - Using A Class Defined In App_Code In Web.config

Sep 6, 2011

I have a class named CustomWebAuditEvent defined in App_Code/CustomWebAuditEvent.vb and I'm trying to use it in a eventMappings of my Web.Config

[Code]...

View 2 Replies


ADVERTISEMENT

Can't Access Class From Code-behind. Class Is App_Code Folder?

Feb 15, 2011

I have a very simple class that is located within my App_Code folder in my VS2008 web application project. I am trying to instantiate an instance of this class from my code-behind file. Intellisense does not seem to be seeing my class and I am not sure why. I am using VB.NET which I am admittedly not that familiar with as compared to C#. Perhaps I am missing something. I would bet it has something to do with something I am missing in VB.NET.Here is my simple class (for testing):

[Code]...

View 2 Replies

Asp.net - Moving Common Routines To The App_Code Class?

Jan 22, 2010

I have some common code that I would like to share between pages and I have been messing around with App_Code classes which is great but I would also like to use code that affects drop down lists example:

Sub Set_FirmType(ByVal Sender As Object, ByVal E As EventArgs)
subcategories.Visible = "false"
supplycategories.Visible = "false"

[code]....

Is their a way to put this in my App_Code class?

View 1 Replies

Asp.net - Getting Configuration Settings From Web.config/app.config Using Class Library

Mar 26, 2009

I have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc).

I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings.

Here is part of my app.config for my windows forms application:

<applicationSettings>
<PhotoImportRobot.My.MySettings>
<setting name="ADIImageRoot" serializeAs="String">

[Code]....

View 3 Replies

Asp.net - Class Needs Info From Either The Web.config Or App.config

Jul 6, 2011

Our main application has both a asp.net and winforms component. There is a class that is used by both sides and needs info from either the web.config or app.config files. The class itself does not know if it's on the client side or on the web server (at this point). We are getting errors when it's attempting read app.config when it's on the web side. Is there a way for the class to tell if it needs to read web.config or app.config?

View 1 Replies

Using App.config In A Class Library

Jun 30, 2008

I was dangerously close to high-jacking another thread, so I thought I should create my own. We make class libraries so we won't duplicate code, but what about settings? I have a large solution that I've created a project in for common material, which includes an app.config. The problem is that a class library isn't an "app" so my functions can't get to the values. How do I get around this?

View 20 Replies

Filesystemaccessrule Has Not Been Defined As A Class?

Mar 20, 2010

I have been looking at some sample code, which includes the following line

Dim rule As FileSystemAccessRule = CType(Me.ACEDetails.SelectedNode.Tag, FileSystemAccessRule)

I'm a bit confused, because filesystemaccessrule has not been defined as a class anywhere in the code.

View 1 Replies

Class Library Config File?

Sep 18, 2009

I have written a vb.net class library that pulls the url for a web service out of my.settings. However, at runtime it no longer bothers to read the class.dll.config file that it made.I want to deploy this dll in different environments and be able to custom choose the relative webservice via the class.dll.config file.

View 3 Replies

Config File On Class Library?

Mar 16, 2006

Got a solution with 3 projects, a Web Service, a WinForms (MyUI), and a Class Library (Foo).

MyUI calls methods in the DLL that access the web service. The DLL has project config settings that store the URL of the web service. I compile the solution and it compiles all 3 projects. In the DLL's bin dir it puts the foo.dll and foo.dll.config files. However, in the WinForms bin dir it puts the MyUI.exe, MyUI.exe.config, and foo.dll; it doesn't include the foo.dll.config. When I run the MyUI.exe from its bin dir, it appears to work, and is obviously getting the config settings from somewhere because it doesn't crash and successfully contacts the web service. However, if I copy the foo.dll.config file into the MyUI's bin dir, and change config settings and re-run, it appears to ignore my changes completely.

In the Class Library I setup the config settings through the project properties dialog under the Settings tab. I access them from code using My.Settings.

How do I modify the config settings post-compile?

View 1 Replies

Asp.net - Added Reference Class Is Still Not Defined?

Oct 28, 2010

I have a web site project where I need to use the System.Security.Cryptography.Xml.SignedXml class. I added the Dll System.Security as a reference and imported the namespace into my project. It compiles successfully but when I debug the project I get a compilation error:

Compiler Error Message: BC30002: Type 'System.Security.Cryptography.Xml.SignedXml' is not defined.

What gives? Edit: I run Windows XP Pro 64bit OS

View 1 Replies

BitmapPalette Class Is Not Defined In VB (express)

Oct 31, 2011

BitmapPalette class is not defined in VB (express). What should I do ? Add a reference (which one) ? Declare myself the class in my project but that won't be the common class ?

View 4 Replies

VS 2008 : Set A Property From Within The Class It Is Defined In?

Aug 7, 2009

How do I set a property from within the class it is defined in?

View 2 Replies

VS 2010 Type CLASS Not Defined?

May 29, 2010

I have been having some trouble today with a User-Control of mine. Is what is happening is when I try to build an application with the control in it, the Form.Designer has an Error saying that Namespace.ControlClass is not defined. I have no idea what the problem might be and hope that one of you do.The weird thing is that the Control Builds just fine and I can drag it from toolbox to the form and THAT works. Also, it works just fine in Design-time. It didn't start erroring until either, I upgraded it to VS2010 or until I changed it a bit today. If necessary, I can post it here.

View 2 Replies

Class Library Config Files And My.Settings

May 19, 2010

Say I have a Class Library project with its own .dll.config, and a forms application. I want to confirm that it is impossible to reference the .dll.config file from the .exe.config file and still use My.Settings.

For example: I have SomeClassLibrary project, with SomeSetting that I can access through My.Settings.SomeSetting. I also have SomeFormsApp project. This is what I want my SomeFormsApp.exe.config to look like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>

[Code].....

From my readings, this seems impossible. I either need to copy the content of SomeClassLibrary.dll.config into SomeFormsApp.exe.config, which is tedious and error prone when copying from multiple class libraries, or I need to use ConfigurationManager, which bypasses My.Settings and its typed, Intellisensed goodness.

View 9 Replies

Class Library Getting Settings From Own App.config NOT The Application's?

Jun 2, 2009

I'm having trouble with my application settings and I'm wondering if anyone else has seen this.

I have a Librabry with a connection string. In the project for the library it has its own app.config:

<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="OBInfrastructure.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>

[Code]...

View 1 Replies

Class Library Project With A Config File?

Jan 19, 2012

I have a Class Library project with a appSettings.config file included into the project. The file is not embedded. So I have a ClassLibrary.dll with a appSettings.config beside in the bin.I have another project which is a Web Service. It has a reference on ClassLibrary.dll with a Copy Local=true. When I build the Web Service, the ClassLibrary.dll is brought into the bin of the Web Service. However, the .config doesn't follow.Do I need to do some postbuild event to copy the .config file or there is another setting I can set?

View 3 Replies

Cant Set Value On A Class Property Thats Defined As A String Array

Nov 3, 2009

I have created a class that contains a property array, but I cant use the setters and getters.

[Code]...

View 2 Replies

Copy User-Defined Class Object?

Mar 12, 2010

I would like to make a "deep copy" of a class object that I have defined. See Visual Basic 2005 Code below

Dim MyStuff1 as new MyClass
Dim MyStuff2 as new MyClass
mystuff1.getbyID(anID)
mystuff2 = mystuff1

Unfortunately the statement "mystuff2 = mystuff1" makes a "shallow copy" of mystuff1. Therefore, if mystuff1 is redefined then so is mystuff2. What do I have to do in MyClass to implement a deep copy method such that operations on mystuff1 and mystuff2 are independent?I would prefer something like

mystuff1.deepcopy(mystuff2)
or
mystuff2 = mystuff1.deepcopy()

View 4 Replies

Dynamic Array Variable Defined In Class ?

Dec 25, 2010

I have a small problem, classes and threading with classes. The problem I have is a dynamic array variable defined in class. In the code below, when error pauses the code, I can see the data in the correct form but I can't write rigth code that writes the data to richtextbox.

Public Class Form1
Public k() As Integer
Private Class zaratma

[CODE]....

View 4 Replies

Type Not Defined Error When Creating Class

Feb 26, 2012

First I put it inside a Module and it works just fine. However when I created a Class and put it inside it, it showed up some errors. (they are in the code's comments)

Public Class MyImageClass
'function to merge 2 images into one
Public Function Merge(ByVal img1 As Image, ByVal img2 As Image) As Image 'Type 'Image' is not defined
Dim bmp As New Bitmap(Math.Max(img1.Width, img2.Width), img1.Height + img2.Height) 'Type 'Bitmap' is not defined
[Code] .....

I tried importing the System.Drawing namespace to this class which didn't change anything either. I've never really touched the OOP side of VB.NET before, this is my first attempt creating a class.

View 5 Replies

Apply For Each Loop On An Array Of User Defined Class?

Jul 18, 2011

I was knowing that For Each loop can only be applied to those classes that implement IEnumerable interface . But recently i accidentally wrote a code that is using For Each on my class's objects collection and my that class is not implementing IEnumerable interface .Below is the sample code that i am testing on :

Sub Main()
Dim personList() As Person = New Person(2) {}
personList(0) = New Person("s1", "s2")

[code].....

View 4 Replies

How To Group Properties End Fields In User Defined Class

Mar 21, 2011

Suppose I want to build a class like

Class MyClass inherit Something

Dim A as string Bim B as integer

End Class When I am writing code, and i want to use thesenew properties or fields, the intellisense shows me the new properties and fields mixed with those inherited. Is there a way to show them all grouped togheter separated from those inherited ( a part giving them a common prefix in the name)?

View 2 Replies

User Defined Data Type Versus Class?

Feb 9, 2010

I am in the process of migrating from VB6 to VB 2008. In a pixel grid system I have thousands of cells with about 15 properties each. In VB6 I employed the user-defined datatype "udtCell()" as my array structure. Is this still a good approach - or should I perhaps make Cell a class?

View 2 Replies

Unable To Access AppSettings From App.Config In A Class Library Project

Mar 1, 2012

I am trying to access appSettings using the following syntax and I have used it before in my many website projects but not in a class library project. In this class library project I cannot even access the AppSettings Keys. Is there any way I could access the AppSettings Key from my class? Is the class library project's app.config or project structure behave in a different way?

[Code]...

I have already added Project Reference to System.Configuration and imported in my class. When I run my code it says, "Object not set to an instance of any object".

View 2 Replies

Numeric Textbox Class - Number Format Info Not Defined

Jun 22, 2010

This is a Library code I got from Microsoft for format a textbox into a numeric format...but it's doesn't works because error message "numberFormatInfo is not defined".

Public Class NumericTextBox
Inherits TextBox
Private SpaceOK As Boolean = False
' Restricts the entry of characters to digits (including hex),
' the negative sign, the e decimal point, and editing keystrokes (backspace).
[Code] .....

View 1 Replies

C# - Make Sure That The Class Defined In This Code File Matches The 'inherits' Attribute?

May 28, 2012

Sometimes in my web applications I used to get this sort of error, I have no clue why is it coming however if I refresh the page few times the page is loading normally.I am using .net framework 2.0 and visual web developer 2005.

View 1 Replies

Pre-defined Class In .net 2.0 To Hold A Single Generic-typed Mutable Field?

Jun 20, 2011

In a number of my projects, I find myself declaring a rather boring class:

[Code]...

to e.g. allow an object to give information to another object in such a way that the information can be mutated later wherever it goes. For example, in a Dictionary(Of String, Holder(Of SomeImmutableType)) it's possible to update the thing of SomeImmutableType without having to change the Dictionary itself (since the Dictionary's entry for a given key will always contain the same Holder object, that Holder object may be used as a lock).

[Code]...

View 2 Replies

Calling Method From App_Code?

Mar 26, 2012

I have method that exisit in APP_CODE class and I want to call it from Class Library what is the best way to do that?

View 1 Replies

Asp.net - Add Two Language Code Files I.e. C# To App_Code?

Feb 28, 2010

While adding two language code files i.e. C# and VB.NET to App_Code, got an error The files ... file names ... use a different language, which is not allowed since they need to be compiled together.Is there a way to add two different language files?

View 1 Replies

Set Head Tags In A Function In App_code?

Mar 11, 2010

The below function has to be put within my common functions file in app_code folder. how do I do it?It gives error like this:Reference to a non-shared member requires an object reference

Public Sub setHeadTags(ByVal title As String, ByVal description As String, ByVal keywords As String)
Dim metaDescription As HtmlMeta = DirectCast(Page.Master.FindControl("metaDescription"),

[code].....

View 2 Replies







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