.net - Setter Not Visited When Using .Add?

Dec 19, 2011

I am trying to set a flag when a collection is modified - the logical place to do that seemed to be in the setter method. The problem is when I use this code

[Code]...

View 4 Replies


ADVERTISEMENT

Asp.net - Getting Previous Page Visited?

May 5, 2012

I'm trying to get thee previous page visited in ASP.NET using VB.NET using the following code:

Partial Class _Default Inherits Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim previousPage As String = Page.Request.UrlReferrer.ToString
If (Request.UrlReferrer <> Nothing) Then

[code].....

I get this error:

Object reference not set to an instance of an object.

at:

Dim previousPage As String = Page.Request.UrlReferrer.ToString

What I want to do is get the previous page visited so I can get a session variable.

View 2 Replies

Asp.net - Last Five Pages Visited Cookie?

Jul 1, 2009

I have a series of product pages and all I'd like to do is store the last 5 products viewed in a cookie so it can be displayed as a site-history. The problem I have isn't adding the five initial items to the cookie, its when they view 6, 7 or 10 items.Currently I have this flawed logic (i have replaced the cookie name (xxx) for brevity);

Dim i As Integer = 0
Dim productcount As Integer = 0
If HttpContext.Current.Request.Cookies("xxx") Is Nothing Then
Dim gingernuts As New HttpCookie("xxx")

[code]....

View 3 Replies

Created A Getter And Setter

Aug 12, 2010

I created a getter and Setter in Visual Basic. I have some questions though. Please look at the code below.

A.) At line 1 below, should "pieces" be declared as Private?

B.) In the IDE at lines 4 and 7 the IDE keeps changing those variables to uppercase so that the property name "Pieces" is the same as the variable name "pieces".Should I instead define the integer pieces with an underscore: _pieces ?That is the only way I can get around the IDE forcing the variable to become uppercase. [code]

View 4 Replies

Note A Webpage Visited?

Jul 5, 2009

I've written an VB application and have successfuly got it into the form of a web page using Visual Web Developer (VWD).The application has a link which opens up another web page in a new window. I would like it that code triggered by a Button on this application will only run if the web page has been opened via this link. In VB it was easy as clicking a Button object made code run (which opened up the WebBrowser within the application) and I could therefore include a line of code such as eg. trigger=1 (and then later I could use "if trigger=1 then"). But in VWD Toolbox objects "Link" and "Button Link" take you directly to the web page (ie they are hyperlinks), without giving me the opportunity to include my "trigger=1" line.

View 3 Replies

.net 2008 Show Visited Websites?

Nov 13, 2011

I would like to be able to show all the websites visited on a machine.

View 1 Replies

Arithmatic Conversion In Getter/Setter

Aug 24, 2010

In my application I need to allow for someone to enter in a floating point value.However that value will be rounded up to an integer.The challenge here is that I am using a getter and setter.If I try and use mixed data types in the getter setter,[code..]

View 1 Replies

Get Combobox To Display The Websites Visited?

Feb 27, 2009

im trying to get my combobox to display the web sites visited

my code so far is

ToolStripComboBox3.HistoryToolStripMenuItem.DropDownItems.Add(item1)

Which does not work

View 4 Replies

Properties - Call Setter From Within Getter?

Jul 29, 2011

I have a class like this:

Public Class MyClass
Private _intList As New List(Of Integer)
Private _avg As Decimal

[code]....

The Getter is calculating average and calls Setter to save the value. For some reason I cannot understand, the average is always 0. For example:

Dim c As New Class2()
c.Add(1)
c.Add(2)
c.Add(3)
Console.WriteLine(c.Avg.ToString()) ' This will print 0

What is the cause of this?

View 4 Replies

Setter Value - How To Update Flag Property Of Row

Nov 10, 2009

I've got 2 classes, one called row and one called value. The row class has an array of value as one of its properties. The row class also has a property called flag which will contain an enum for how it has changed. On the setter for value I was hoping to update the flag property of row, but I cant work out how to do it via modern OO. Here's the

Public Class Row
'Variables
Private values_local() As Value
Private flag_local As DataFlags
'Properties
Property values() As Value() .....

View 1 Replies

2008 Show All The Websites Visited On A Machine

Jan 7, 2009

I would like to be able to show all the websites visited on a machine.

View 3 Replies

Create Property Setter Delegate Via DynamicMethod?

May 28, 2010

I'm building an abstract class that handles some common operations for all of my data access objects. The class will utilize generics, so I can't make direct calls to constructors, business object properties, etc. Reflection is way too slow for what I want to accomplish, so I am using a DynamicMethod, ILGenerator, and Delegate caching instead (sample will follow).

The method I'm currently working on is a Private Shared method that populates a list of business objects using records from a data table. I'm having a problem building the property setter via IL. I'm getting an object reference error, but I'm not sure how to fix it. I believe the error comes from the "target" being Nothing, but the parameter I'm passing as the target is not Nothing at the time of invocation. Here are some snippets of what I've got so far:

'class declaration -- TList is strongly-typed list of T
Public MustInherit Class DataAccessBase(Of T, TList)
...
'delegate declaration

[code]...

I'm assuming the obj is not being passed correctly as the target, thus causing the target to be Nothing.

View 4 Replies

Dynamic Property Setter With Linq Expressions?

Jan 5, 2011

I want to create a simple function that does the following:

Sub SetValue(Of TInstance As Class, TProperty)(
ByVal instance As TInstance,
ByVal [property] As Expression(Of Func(Of TInstance, TProperty)),

[code].....

View 1 Replies

Logging Internet Explorer Visited Site?

Dec 2, 2009

i want to now how to start creating program that can record in a text fileor in a listbox all sites visited by internet explorer or firefox in any pc.

View 2 Replies

WebBrowser - Adding (Most Visited Site) Feature?

Mar 8, 2012

We've been set a task to build a really basic web browser with one advanced function. I've done the web browser with the basic functionality. The advanced feature is a "most visited site" feature. I need to create some kind of listbox, that keeps track of all the websites visited (when the go button is pressed) and arranges them in the most popular order (i.e. the one that has been clicked the most). Furthermore, it states that substrings should be used so that for example if you go to [URL] and go to [URL] that counts as 1 hit. I'm sure its something to do with arrays, but he did say you will need to use multiple procedures/strings/functions....

View 3 Replies

Giving Focus To A Control Depending On Last Form Visited?

May 3, 2012

how can I put this idea in code to say: if TheLastFormVisitedIsFormCustomers then

CurrentForm.myTextBox.Focus End If

In simple english. How can I retrieve the name of the last form visited in code and give focus to a textbox control depending on the last form visisted.

View 2 Replies

Nhibernate Projection List - Could Not Find Setter For Property

May 23, 2011

I have issue with a Nhibernate projection list, It keeps saying it Could not find a setter for property 'Commname' in class 'Label6.Domain.Product' or could not resolve property "pl.commname"
the property "commname" is a part of the object productslangs.

My product object looks like this:
Public Overridable Property Latinname() As System.String
Get
Return _Latinname
End Get
Set(ByVal value As System.String)
[Code] .....

View 1 Replies

History Save And ComboBox1 Visited Site Navigation Codes For 2010 Professional Homemade Web Browser

Jan 21, 2011

I'm currently making a Web Browser, and I was wondering how I can save History after I close the program/form and clicking on the site I visited last and navigate to the link with a single click?

View 2 Replies

.net - If An Interface Defines A ReadOnly Property, How Can An Implementer Provide The Setter To This Property

Jun 10, 2011

Is there a way for implementers of an interface where a ReadOnly property is defined to make it a complete Read/Write Property ?

Imagine I define an interface to provide a ReadOnly Property (i.e., just a getter for a given value) :

Interface SomeInterface
'the interface only say that implementers must provide a value for reading
ReadOnly Property PublicProperty As String
End Interface

This means implementers must commit to providing a value. But I would like a given implementer to also allow setting that value. In my head, this would mean providing the Property's setter as part of the implementation, doing something like this :

Public Property PublicProperty As String Implements SomeInterface.PublicProperty
Get
Return _myProperty

[code]....

View 5 Replies

Moq's VerifySet Be Called - "Expression Is Not A Property Setter Invocation"?

Apr 10, 2010

I am trying to test that a property has been set but when I write this as a unit test: moqFeed.VerifySet(Function(m) m.RowAdded = "Row Added") moq complains that "Expression is not a property setter invocation" My complete code is

[Code]...

View 1 Replies

Reflection - Find From A Property Info Object If That Property Has A Non Public (Private / Protected) Setter?

Aug 27, 2009

I searched on the forum / Internet for the solution how a PropetryInfo object (of a Public property) can reveal if it has a Private Protected Setter ... it was all in vain .... all help I found was about how to "Set" value of a public property having a Private Setter.I would like to know if I have a PropertyInfo object of a public property, how would I know if its Setter is Non Public?

I tried, in a exception handling block, where I did a GetValue of the PropertyInfo object and then called SetValue by setting the same value back... but to my surprise it worked well and didn error out.

[Code]...

View 1 Replies







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