I've created a function in my vb class file that creates dynamic tables. I'm planning to use this to create tables dependent on a button being clicked. The function references a placeholder in my aspx page but I'm getting "placeHolder1 is not declared".How can I access controls on my form from my class file? [code]
my proble is the following: I have a class MyClass and another class Modifier, which has a method ModifyMyClass(ByRef mc as MyClass) that receives a MyClass instance as ByRef parameter to modify it. A smell of the code is:
I have a 'property management class' that contains several functions and properties. I have several other classes that use the 'management class' as a property to derive the value of several of its other properties.Is there a way for me to reference the outer class from the 'management class' functions without having to pass it as a parameter? I ask because several different classes can have this 'management class' as a property and am having a hard time typing the parameter.
I have a class in which some of the fields are also classes.I can put values in the "normal" properties, but in the others when o try to assign values it gives the: "Object reference not set to an instance of an object"But the code compiles fine.
dados_Defenicao = New ServiceReference1.draftClaimEntryDefinition dados_Defenicao.arCode = "123" dados_Defenicao.claimMarket.warrantyType = "w" - Here it gives the error
I have a class in which some of the fields are also classes.
I can put values in the "normal" properties, but in the others when o try to assign values it gives the: "Object reference not set to an instance of an object"
But the code compiles fine.
dados_Defenicao = New ServiceReference1.draftClaimEntryDefinition dados_Defenicao.arCode = "123" dados_Defenicao.claimMarket.warrantyType = "w" - Here it gives the error
If we are within the derived class then ofcource we can use MyBase keyword to access base class's object reference . That's fine , how can we take that base class's object reference outside that derived class's definition.My following code will explain what i want . Actually that is giving error right now, but it is explaining my requirement .
Public Class Base Public x As String End Class
[code]....
Actually there is error in ReadOnly Property BaseReference's Getter . Error is "Error 1 'MyBase' must be followed by '.' and an identifier. " how can i get base class object reference in Main method ?
I have a Parent Class Called Fuselage that containsfour child classes called Forebody, CenterBody, AftBody, and CrossSection. CrossSection classcontains objects common to Forebody, CenterBody, and Aftbody (example: width). How do I access thewidth property in CrossSection from within the classForebody?
Public Class Fuselage Dim Forebody As ClsSection Dim Centerbody As ClsSection
I need to create a new instance of a class that needs a member of the calling class. But i can't pass a reference to the calling class through the constructor.The solution i am looking for is something like this:
Public Class ChildClass Public Sub New(args) _MyMember = GetMemberFromCallingClass()
[code]....
I want this to work without having to manually pass any references or variables from the calling class to the new instance of ChildClass.
The book "Beginning ASP .NET 4 in VB 2010" contains the following:NOTE: TaxableProduct inherits from Product.You can also cast in the reverse directionfor example, cast a Productreference to a TaxableProduct reference. The trick here is that this
I am new to MVC.I have a string that I built from a controller called parsedCustomerNames. In web forms I can make the placeholder visible from the codebehind and then populate a control with the string. How would I be able to do this in MVC.
I have a repeater and within that repeater, I have an item template. Now this template is formatted with a couple of tables, but for this question I have removed them to make things easier to read:
In other words the values of the last row used are stored in every key, value dictionary combination. How do you prevent this from happening? It is clearly associated with the use of the temp variable, as the dictionary changed as the temp variable changes. Is there a way to only copy the values from the array rather then associate the dictionary with the changing values of the array?
I have an asp program that needs to validate data for textboxes that are dynamically created and put into a placeholder. Each textbox has to have a value when the user hits the Save button. I have the following code:
Dim testCheck As Boolean = True For Each txt As TextBox In pnlTests.Controls If txt.Text = "" Then
I have a particular link that I'm trying to convert to an ASP:LinkButton place holder so that I can control it's visibility based on the user type: <asp:LinkButton id="linkColumnsSelect" runat="server" Text="Select CSV Columns for Export" Href="javascript: void(0)" Visible="True" />
I was able to remove the PostBackUrl by adding "javascript: void(0)" to the Href property, but now I have the problem of getting a real ID that I can use in javascript. As it currently stands, this creates an ID for the item of ctl00_ContentPlaceHolder1_linkColumnsSelect, however I need that ID to be "linkColumnsSelect" on the client side and still work server side (for jQuery coding reasons that involve looping). Is that possible? Or do I just need to adjust my jQuery to account for the placeholder segments of IDs?
I have a page that includes javascript which I only want to run under certain conditions. To do this I have placed the scripts into an asp: placeholder.This actually seems to work but when I run a debug on the page I get the following warning.Element 'placeholder' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.If I move the placeholders into the body of the page the warning goes, but that means I'm left with scripts in the body which I also want to avoid. Does anyone have any hints on the best practice for this scenario? [code]
A little pseudo code to provide some background:I have an ASPX with a placeholder and a buttonWhen the button is clicked it adds a web user control (uc1) to my placeholderThe uc has a button
It is in the file ClientProfile I have placed in both App_Code and also App_Code/Models
In my code behind I have the following
[CODE]...
The last word, "ClientProfile" has the scary squiggly red line below it. It is not recognizing my class.Even the Intellisense is not picking up te class. Do I have to register the class file in any way?
how can I add a class of a different project to my current project as a reference?I tried Right click_-> add existing item --> ( The class from the other project) then it gives me error.I am not sure how can I use that class as my reference to my current project?
I'm converting a VB6 app to vb.net.The code creates objects using the CallbyName function with the classes name & and method being read from a database.I want to rewrite the classes in vb.net and have the same behaviour as I read in the name of an object from the database, instantiate it, and call one of it's methods.I don't know ahead of time what the names of the classes will be, so I can't make a reference to them in my project.
I'm trying to use reflection to get the instance of a class in vb.net. I have a class 'A' in my web project and to test it, i create a new aspx page and try to write the following:
Dim t as Type = Type.GetType("A")
This returns "Nothing". But if i do this:
Dim inst as A = new A() Dim t as Type = inst.GetType() t's type is "A"
So how come i can't get the type with GetType even if the name is exactly the same? It does works for things like System.Math though
I'm working with a website written in aspx.net over vb. I have a placeHolder, and I create a table of names inside this PlaceHolder, each name has an HtmlInputCheckBox next to it. Im doing this in the aspx.vb file, when the page is uploading. Then, when the user wants to send mail, he presses a button and than I need to access the checkboxes, and I'm having problems with this, the Sub doesn't know the checkBox object.
Within my webpage I am loading usercontrols within a placeholder. Each of these user controls triggers a postback when an ajaxcontroltoolkit rating is changed. The problem I am having is that if I use [code]The Load_EvaluationList is what loads the user controls, if I place the IsPostBack check around those two, the controls disappear, what could be the problem
I need to remove the "padding" or "image place holder" before the text on a ToolBarButton (not a ToolStripButton). There is not ImageList set for the ToolBar, but there is still a blank space before the text on the left hand side of the ToolBarButton.
This is an ASP.NET 2010 web app written in vb. I use several Session variables. I want to pass them all to a central class and let the class manage them. However, I am having some trouble. Here is the code on the calling page:
Dim arrGoodSessions() As String ={"nameofsession1", "nameofsession2", "nameofsession3"} Utilities.ManageSessionVariables(arrGoodSessions)
It calls that static Utilties class. I have set a reference to System.Web. Here is the code in the class:
This attempts to simply read in some names of session variables and then cycle through all session variables and remove any I didn't list. This works when all of the cod eis on the page. But when I move this to the class, it doesn't recognize Session.Contents.
Dim v as integer public sub storeVar(byval s as integer) v = s end sub
[code].....
I need to save a reference of variable s in Class2 in variable v in Class1.(i.e. when the value of s changes v also changes (and vice versa)Is this possible since vb.net doesn't have pointers?Will it work if I change "byval" to "byref"?
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.
I'm converting a pretty large chunk of code into a Class so that it can be re-used more easily, but am having a problem with one of the Methods. I have a method that uses the following line:'GET HANDLE OF ANY POPUP WINDOW ASSOCIATED WITH MAIN FORM [code]The "Me.Handle" part won't work, but I don't know what to replace it with so that it knows to use the handle of the main application's form that is using the Class.Do I need to get all Process that match my application's and store the Process' handle?
Public Class Form1 Public Contestant As New ContestantClass Public HighScore1 As New ContestantClass Public HighScore2 As New ContestantClass Public HighScore3 As New ContestantClass [Code] .....
The problem I'm having is the first time I take a value, it gets inserted in the right section. The second time I insert a value, it inserts it in the correct place AND updates the previous value I inserted with the new value. So apparently when I'm doing: HighScore1 = Contestant It's pointing contestant AT highscore1 rather than taking the name, company, and score from contestant and then storing it in highscore1. How I can pass that info by value rather than by reference?