473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problem creating web control...

Hello, everybody,

I'm having a problem creating a control...All I want to do is a simple poll
system, so I need to input (trough a ListitemCollection) the values from the
user.

The problem is I'm getting an error each time I try to modify the elements,
I don't know why....

If anyone can help, I would appreciate...

Raphaël...



Imports System.ComponentModel

Imports System.Web.UI

Imports System.Web.UI.WebControls

<DefaultProperty("Text"), ToolboxData("<{0}:WebCustomControl1
runat=server></{0}:WebCustomControl1>")> Public Class WebCustomControl1

Inherits System.Web.UI.WebControls.WebControl

Dim _text As String

<Bindable(True), Category("Appearance"), DefaultValue("")> Property [Text]()
As String

Get

Return _text

End Get

Set(ByVal Value As String)

_text = Value

End Set

End Property

Public Property Itens() As ListItemCollection

Get

If Not IsNothing(viewstate("FirstTime")) Then

Return viewstate("Itens")

Else

Dim lstCol As New ListItemCollection

Dim lst As ListItem

lst = New ListItem("ASP.NET", 0)

lstCol.Add(lst)

lst = New ListItem("ASP", 0)

lstCol.Add(lst)

viewstate("FirstTime") = ""

Return lstCol

End If

End Get

Set(ByVal Value As ListItemCollection)

viewstate("Itens") = Value

End Set

End Property

Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)

MyBase.Render(output)

End Sub

End Class
Nov 18 '05 #1
0 1162

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
2
by: anand | last post by:
Hi all, I have created a custom control which displays Image using Graphics.. I am using this control in a different windows application. I am dynamically creating the control and putting that...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
3
by: Calvin Lai | last post by:
Hi all, I have a problem in creating web user control *programatically*. Problem as follows: 1. WebUserControl1 contains a server side table named Table1 2. WebForm1 contain a server panel...
2
by: Richard Lionheart | last post by:
Hi All, I generated a WebForm and created a Virtual Directory for it IIS. But I got an error message (shown below) saying something like my app lacked appropriate privileges. David Wang...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
2
by: JJ | last post by:
Using asp.net 1.1 I am trying to have a consistent look for the webcontrols. Right now, every time I use textbox controls, I manually change the font property, size property, and other property...
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
8
by: Daveo | last post by:
Dear all, We recently migrated a SQL database from one server to another. Now, when you try to run some code in an Access Database which links to the SQL one, you get a 3704 error "Operation is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.