Calling A Sub And Pass In Parent Object?

Jul 6, 2009

I have a statement that will call a Sub.

Charts(CurChartNo) = Server.CreateObject("ChartFX.WebServer")
Call InitChart()

Inside this sub, I will assign values to the properties of the Charts object that is

Public Sub InitChart()
Charts(CurChartNo).RGB2Dbk = &HC0FFFF&
Charts(CurChartNo).Chart3D = False

[code]....

But the Charts is not recognized in the Sub. This is current program under ASP, I am converting to ASP.Net.

View 3 Replies


ADVERTISEMENT

Function - Pass Object Versus Reference Object In Parent?

Dec 1, 2011

I am working on a application that has quite a few functions involved and have been thinking of the following: If I have a function that has a few paramaters, is it more efficient to pass the objects to the function(Example 1) or reference the objects in the parent(Example 2)? Does it matter if the objects are large or not?

Example:

Class mainform
Public myGenericList As New List(Of String)
Public myDatarowArray() As DataRow

[Code].....

View 6 Replies

Asp.net - How To Pass An ID From Parent ListView To A Child Repeater Inside The Parent ListView

Oct 12, 2011

I have a listview "CategoriesList" and i have a repeater "NewsRepeater" inside the listview "CategoriesList"

<asp:ListView ID="CategoriesList" runat="server" DataKeyNames="CatID" DataSourceID="CategoriesListODS"
EnableModelValidation="True">

[Code]....

how to pass the catID from the listview and make it as SelectParameters in ObjectDataSource "NewsRepeaterODS"?

View 1 Replies

Calling Both Parent And Inherited Methods With The Same Name?

Mar 30, 2012

It's been a while since I've had the time to browse through here, answer questions and ask some of my own. Just got a job at a custom business software developing company! But I do have a question I'd like some clearing up on.

What I have here is 2 classes, one inherits the other. Both function similar so a lot of the methods are the same for each. The one in particular is Reset_Class()

Here is a sample code of what I'm trying to do.. My question is, is it correct?

vbnet
Public Class Form1
Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As

[Code].....

View 6 Replies

VB Calling Parent Form Methods In A Usercontrol

Sep 29, 2010

control that contains a button. the user control is placed on my main form. when the button on the user control is clicked I need to to call a method that is located in the mainform.vb

View 2 Replies

VB Calling Parent Form's Methods In A Usercontrol?

Aug 9, 2009

control that contains a button. the user control is placed on my main form. when the button on the user control is clicked I need to to call a method that is located in the

View 9 Replies

Cannot Cast An Object To Its Parent Object In Visual Basic

Aug 19, 2011

In C# we can do something like this:

Honda a = new Car(); and that works but the same one doesn't work in Visual Basic.NET (I am fairly new to Visual Basic)

Dim a as Honda = new Car and it says Unable to cast object of type 'SampleApp.Car' to type 'SampleApp.Honda'.

Here is my sample code:

Module Module1
Sub Main()
Dim a As B = New A

[Code]....

View 3 Replies

When Calling New On An Object - Can The Object Being Created Refer Back To Its Caller

Nov 11, 2010

I hope the question makes sense, anyways. I'm looking to know if in VB.NET, when we call an object's constructor, is there some kind of a reference that points back to the caller? I'm interested because of a corner case where I want the object being created to first be able to validate the existence of some data in the caller before it allows itself to be created. If this validation fails, I plan on throwing an exception. This corner case will never happen at runtime unless the object being created is used improperly by a programmer. The object being created is not inheriting the object I want it to validate, so I can't do anything with the MyBase qualifier.

It's bit of a "future-proofing" issue that I have a (bad) habit of doing. Not critical -- I can always leave stern comments behind as a last resort. Wanted to know if this was possible.

View 3 Replies

Pass Datagrid Values To Parent Window?

Oct 20, 2009

i've small problem in vb.net .i've mdi container form,in child form datagridview is there previoues,next buttons in parent form.

How to pass datagrid values to parent window?

i'm new to vb.net.Pls help me any one.

View 2 Replies

Pass The Id Of The Parent To The Create View Of A Child?

Sep 30, 2010

I'm new to MVC2 and my question should be pretty basic. At least I thought so until I could'nt find any answer on the web, so here I am.

I have a parent object Pool that can have 0 to many children Question.

In my Details view of Pool, in addition to the Pool's property, I render his childs using RenderAction on the Question action List, so far, so good.

Inside my List view of Question (which is always rendered inside the Details view), I want a button to start the Create action of the Question object. My problem is, I don't know how to pass the Pool object, which is the model of my Details view, to the Create action so that I can link my Question to the right Pool.

Is there a way to access the "Master" Model inside the "included" view via RenderAction and if not, what's the best way to implement a work around.

View 2 Replies

Object Reference Not Set To An Instance Of An Object When Calling A Function

Jun 13, 2012

I call the function GetDataTable and when it gets to the return line, I get the error message: Object reference not set to an instance of an object.

Dim DB As New DBConn
Dim gd As New DataAccess.GetData
Dim DT As New DataTable

[Code].....

Updated. I'll see if I can update with the DataAccess.GetData code. I didn't originally put it in there because our shop use it all the time and have no issues with it.

View 1 Replies

Restrict Instantiation Of An Object To Only One Other (parent) Object?

Apr 27, 2010

VB 2008 .NET 3.5 Suppose we have two classes, Order and OrderItem, that represent some type of online ordering system. OrderItem represents a single line item in an Order. One Order can contain multiple OrderItems, in the form of a List(of OrderItem).

Public Class Order
Public Property MyOrderItems() as List(of OrderItem)
End Property
End Class

It makes sense that an OrderItem should not exist without an Order. In other words, an OrderItem class should not be able to be instantiated on its own, it should be dependent on an Order class to contain it and instantiate it. However, the OrderItem should be public in scope so that it's properties are accessible to other objects. So, the requirements for OrderItem are:

[Code]...

View 3 Replies

Forms - Pass Variable From Child To Parent Like A Function

May 23, 2012

I have created 2 forms (Parent & Child), i want to store the unique textbox value to a variable into the parent form.

[Code]...

View 2 Replies

Pass A Listbox Selecteditem In Usercontrol To Parent Form?

Oct 19, 2010

I have a user control which contains several buttons and a listbox. Clicking a buttondetermines what items are in the listbox. When a user clicks an item in the listbox I want the selecteditem passed to the parent form.

View 6 Replies

ASP.NET - Pass The Value Of The TextBox As The Value Of The Whole Control To Use In The Calling Code?

Apr 9, 2010

I created a DatePicker user control (ASP code below, no code behind) which is simply a textbox, image button, and a sometimes visible calendar.

[Code]...

Can I somehow tie or pass the value of the TextBox as the value of the whole control to use in the calling code? EDIT: My actual goal here is to be able to tie the SelectedDate as a parameter of a database query. I was able to select values for the other parameters in a controls dropdown list in a query parameter configuration window.

View 2 Replies

C# - Pass An Integer As A String Parameter To A Method Without Calling .ToString()?

Mar 12, 2010

In VB.NET, it is entirely possible to pass an integer as a string parameter to a method without calling .ToString() - it's even possible to call .ToString without the ()'s. The code will run without a problem, VB will interpret the integer as a string without having been told to. In C#, these would cause compilation errors - you are required to call .ToString() and to call it correctly in that situation before it will compile. Is there a way to make the VB compilation process check for the same things as the C# compilation process? Would it be best practice in a mixed team to force this check?

View 3 Replies

Asp.net - Pass Cancel Or Update Button Click From Popup Back To Parent Page?

Apr 25, 2012

I have a popup aspx page that receives data from a parent page gridview Edit click. There is a great deal of parsing of data from parent page to pop up as the data is being translated in pop up, then sent back to parent page to be reassembled in the original text block before update.

When the popup passes the data back or is canceled, the parent page gridview is still in Edit mode.I would like to pass the Cancel or Update button click from the popup to the parent page gridview so it can complete the update or cancel event without asking the user to click the corresponding command button link from the gridview edit mode, to Update or Cancel.

UPDATE: There is also a jquery UIBlocker on the Parent page to prevent the user from returning to the page until the PopUp page processing has been completed. Below is the critical code:

PARENT Page:
function parentFunc(a) {
// Unblocks on return from popup page.
$.unblockUI({});

[code]...

Had a problem with preventing the popup from reloading. So there is an if condition in the load event. A dynamic number of controls are built on the popup as literals. So the Page Init event and Page Load event fire on non Postback to rebuild the controls.

View 1 Replies

DLL Calling An Object In The EXE?

Mar 18, 2009

I'm building a DLL with several "master" objects that need access to the app LINDataContext.The DLL will serve several projects with different dataContexts, so I need the DLL can call the object that it's inside the EXE.What is the best or elegant way to do it?Edit: ClarificationCode example of what I'm trying to do:

'DLL
'---
Public MustInherit Class MasterObject(Of T As Class)

[code].....

View 3 Replies

Parent Property For A Non Visual Object?

Feb 21, 2010

Is there a way for an object to call the object that contains it, like how a FrameworkElement has a Parent Property?Bill Gates look out!

View 4 Replies

Calling A SWF Object From Another Form?

Jun 26, 2011

Version: visual basics 2008

Problem:

Form 1 contains a SWF object, which is called FlashGame (it has a movie set, which is a game)

Form 2 contains a button to set a variable on the FLashGame.

Example

Call FlashGame.SetVariable("variable will be here", 1)

That simple coding works when the button to call that SetVariable command is on the same form as the FlashGame, but I need them to be on different forms.

View 1 Replies

Checking An Object's Parent Types By String?

Apr 15, 2011

I'm trying to figure out how find an object's type when it is a subclass of another object and I only know the string value of the object's type's name.I created the follwing classes:

HTML

Public Class word
End Class
Public Class noun[code]....

The problem is, using 'GetType' to check pn against a string value, I can only see that pn is a properNoun, not that its parent classes are noun and word.Is there a way to check pn against the string value "noun" or "word" and get back a positive result, indicating that pn is indeed a noun and a word as well as a properNoun?

View 2 Replies

Calling A COM Object (MSScriptControl.ScriptControl) From .Net?

Oct 24, 2011

I am currently trying to maintain a VB6 module that it is being called from a vbscript. The module needs to have a reference to the MSScriptControl.ScriptControl COM object. However, I obtain a 80040154 error. I went ahead and registered the component using the C;WindowsSysWOW64Regsvr32.exe but then I get that the entry-point DllRegister was not found.

View 3 Replies

Calling Method In Anonymous Object?

Sep 15, 2011

Calling method in anonymous object?This works:

Call (New MyForm).Show

View 13 Replies

LINQ - Query Children Object If Parent Count Is = 1

Apr 17, 2012

I have a the following Class structure. Company > List(of Departments) > List(of Employees) I want to Query a Company to find out if it has a department of the following name and a Employee in that department with the following ID! How could I query this. The way I have the code it expect to return one department so I have it doing

[Code]...

View 2 Replies

How To Pass Object As Sub

Jan 20, 2012

This code copose from Class including tow sub first sub to insert data in DB Ms access- second code: to check if there is same number of Tel if there is not same number will excute the first code insert, if there is same number of Tel it will show messagebox the problem that I faced is by how to pass object(InsertData) from CheckN sub. It showed me error : Expression is not a method

[Code3]...

View 1 Replies

Calling A Method Over Variable Of Type Object In Vb And C#

Jul 5, 2009

in vb I can do that

sub SetFocusControl(byref ctl as object)
ctl.Focus
end sub

in c# the compiler complaint that object doesn't have a Focus method

void SetFocusControl(ref object ctl)
{
ctl.Focus();
}

how can I do the same in c#?

View 3 Replies

Calling A Session Variable In A Class Object In Asp.net?

Aug 29, 2011

How can I access the values stored in a session object with a class in asp.net?

View 3 Replies

Calling Class Functions After Declared As An Object?

May 4, 2012

I want to see if there is a way to do this... I'm Using vs2010 with the WP7 SDK. (VB.NET)

I am declaring this in the global scope.

public objGame as object then say i have classes: Game1 and Game2 for the sake of the example we'll just say both classes have an Update() function

I want to set objGame = Game1 (or Game2) and then be able to call objGame.Update()

View 3 Replies

Calling Object Event Sub - Timer Procedure

Jun 3, 2011

I'm developing this procedure using a timer object. The thing is the procedure is not in the timer's event procedure but I want it to depend on the timer's interval when executing, it's just not calling the timer procedure. How can u declare objects and use their event procedures in code.

View 2 Replies

Constructing An Object And Calling A Method Without Assignment

Apr 15, 2010

I'm not entirely sure what to call what C# does, so I haven't had any luck searching for the VB.Net equivalent syntax (if it exists, which I suspect it probably doesn't).

In c#, you can do this:
public void DoSomething() {
new MyHelper().DoIt(); // works just fine
}

But as far as I can tell, in VB.Net, you must assign the helper object to a local variable or you just get a syntax error:

Public Sub DoSomething()
New MyHelper().DoIt() ' won't compile
End Sub

Just one of those curiosity things I run into from day to day working on mixed language projects - often there is a VB.Net equivalent which uses less than obvious syntax. Anyone?

View 2 Replies







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