CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 12/7/2003 6:01:57 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 27 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
rajesh_gande
Asp.Net User
custom web control12/7/2003 6:01:57 PM

0/0

I created a custom web control using three DropDownListBoxes and added that to my toolbox. When I dragged my control on to the page it is showing a simple arrow (web control indicator). What can I do to make the control to be appear on the page with there dropdown boxes. Please help me. Below is the code for the control.

Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls

<DefaultProperty("Text"), ToolboxData("<{0}:RajeshTimePicker runat=server></{0}:RajeshTimePicker>")> Public Class RajeshTimePicker
'Inherits System.Web.UI.Control
Inherits System.Web.UI.WebControls.WebControl
Implements INamingContainer


Dim Hrdblist As New DropDownList()
Dim Mindblist As New DropDownList()
Dim AMPMdblist As New DropDownList()


<Bindable(True), Category("Appearance"), DefaultValue("empty")> Property SelectedTime() As String
Get
Dim vTimeStr As String
vTimeStr = Hrdblist.SelectedItem.Text & ":" & Mindblist.SelectedItem.Text & _
AMPMdblist.SelectedItem.Text
Return vTimeStr

End Get

Set(ByVal Value As String)
EnsureChildControls()
'_text1 = Value
showtime(Value)
End Set
End Property


Protected Overrides Sub CreateChildControls()

popdblists()
Dim Hrlabel As New Label
Hrlabel.Text = "HR"
Dim Minlabel As New Label
Hrlabel.Text = "MIN"
Dim emtlabel As New Label
Hrlabel.Text = " "
Controls.Add(New LiteralControl("</h2>"))
Controls.Add(New LiteralControl("HR "))
Controls.Add(Hrdblist)
Controls.Add(New LiteralControl("</h2>"))
Controls.Add(New LiteralControl("<h2>Min "))
Controls.Add(Mindblist)
Controls.Add(New LiteralControl("</h2>"))
Controls.Add(AMPMdblist)
Controls.

'Controls.Add(Mindblist)
'Controls.Add(emtlabel)
'Controls.Add(AMPMdblist)

End Sub
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
CType(Controls(1), DropDownList).SelectedIndex = 1
CType(Controls(2), DropDownList).SelectedIndex = 4
End Sub

Private Function showtime(ByVal fvdatetime)

If (fvdatetime Is "empty") Then
Hrdblist.SelectedIndex = 0
Mindblist.SelectedIndex = 0
AMPMdblist.SelectedIndex = 0
Else

Dim moment As DateTime = fvdatetime

Dim vHr As Integer = moment.Hour
Dim vMin As Integer = moment.Minute

If vHr = 12 Then
Hrdblist.SelectedIndex = 12
Else
Hrdblist.SelectedIndex = (vHr Mod 12)

End If

Mindblist.SelectedIndex = vMin / 5

If vHr / 12 > 1 Then
AMPMdblist.SelectedIndex = 1
Else
AMPMdblist.SelectedIndex = 0
End If
End If
End Function
Private Sub popdblists()
Hrdblist.Items.Add("00")
Hrdblist.Items.Add("01")
Hrdblist.Items.Add("02")
Hrdblist.Items.Add("03")
Hrdblist.Items.Add("04")
Hrdblist.Items.Add("05")
Hrdblist.Items.Add("06")
Hrdblist.Items.Add("07")
Hrdblist.Items.Add("08")
Hrdblist.Items.Add("09")
Hrdblist.Items.Add("10")
Hrdblist.Items.Add("11")
Hrdblist.Items.Add("12")

Mindblist.Items.Add("00")
Mindblist.Items.Add("05")
Mindblist.Items.Add("10")
Mindblist.Items.Add("15")
Mindblist.Items.Add("20")
Mindblist.Items.Add("25")
Mindblist.Items.Add("30")
Mindblist.Items.Add("35")
Mindblist.Items.Add("40")
Mindblist.Items.Add("45")
Mindblist.Items.Add("50")
Mindblist.Items.Add("55")


AMPMdblist.Items.Add("AM")
AMPMdblist.Items.Add("PM")

End Sub
End Class
russnem
Asp.Net User
Re: custom web control12/9/2003 5:03:36 PM

0/0

Sounds to me like you need to create a designer for your control and override GetDesignTimeHtml. You can create a designer like so:
#Region " Designer "

Public Class MyControlDesigner
Inherits System.Web.UI.Design.ControlDesigner

Public Overrides Function GetDesignTimeHtml() As String
Return "<TABLE width=""40%"" cellspacing=0 cellpadding=0 border=1><TR><TD width=""100%"">" & Date.Now() & "</TD></TR></TABLE>"
End Function
End Class
#End Region


Then, as an attribute for your control you can have the following:

DesignerAttribute(GetType(MyControlDesigner), GetType(IDesigner))

Hope this helps,
Russ
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
ASP.NET 2.0: A Developer's Notebook Authors: Wei Meng Lee, Pages: 326, Published: 2005
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Microsoft SharePoint: Building Office 2003 Solutions Authors: Scot P. Hillier, Pages: 392, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. Leblond, Pages: 989, Published: 2005
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Essential ASP. NET with Examples in C#: With Examples in C# Authors: Fritz Onion, Pages: 393, Published: 2003

Web:
15 Seconds : Creating a Web Custom Control Conrad Jalali shows how to build Web custom controls by creating one that displays checkboxes in a categorized, hierarchical view.
Walkthrough: Developing and Using a Custom Server Control This is useful if the custom control will be used in multiple pages in a Web application. The following procedure describes how to specify the tag prefix ...
Creating Custom Web Controls in C# This navigation bar is actually generated dynamically for each page by a Custom Web Control. Let's start by looking at the first part of the code. ...
CodeProject: Rating Control using custom web control. Free source ... Jul 14, 2008 ... Custom web control using asp.net; Author: Ravinder007; Section: ASP.NET Controls ; Chapter: Web Development.
Creating Web Custom Controls with Visual Studio.NET, Part I ... There are principally three ways of creating web custom controls and we're going .... It is a custom control that inherits from Control or WebControl with a ...
CodeProject: Building an ASP.NET custom web control: a textbox and ... In this article we will have a look at implementing a custom web control. This web control will inherit from the TextBox web control, and will automatically ...
ASP.NET Custom Web Control ASP.NET Custom Web Control C# Help c-sharp. ... NET custom web control shows some information about the host it runs on. It's an example of how to build ...
CoDe Magazine - Article: Custom Web Controls Demystified, Part 2 Last issue I gave you a 'hit-the-ground-running' introduction to custom Web control development and showed you how to build a renered control and an ...
15 Seconds : Creating a Custom Web Control To Consume an XML Web ... Robert Chartier demonstrates how easy it is to create a Web server control that consumes any Web service. It will simplify integration with other sites and ...
User Controls and Custom Server Controls, Part 2 | O'Reilly Media In Part 2 in this series of excerpts from ASP.NET in a Nutshell, learn ASP.NET custom server controls.

Videos:
How to make a web browser in VB6 In this video I show how easy it is to make a custom web browser in VB6. I even show you how to make your browser Mozilla based. Here is the URL to ...
MODx 0.9.5 PHP Application Framework. Ajax CMS. SEO CMS MODx is an open source PHP Application Framework that helps you take control of your online content. It empowers developers and advanced users to giv...
How To Install WordPress With One Click http://imnirvana.com/ -- In this video you will see how easy it is to install WordPress on your site using Dream Host's One-Click Install feature in ...
Intego ContentBarrier X4, parental control software for Mac ContentBarrier X4 sets up a protective wall around your computer. Its predefined categories let you choose what you don't want your children to see, ...
World of Warcraft GM I just made this video with commands and other stuff that you need on your server. Not only how to make server but how to add custom weapons too. Enj...
DeepSec 2007: Daniel Fabian - Browser Hijacking Current XSS attacks make use of the document object model to steal session credentials from unsuspecting users, allowing the attacker to impersonate ...
Spider-Man: Web of Shadows launch trailer eDome - http://www.edome.net http://plaza.fi/edome/arvostelut/locoroco-2-ennakko http://plaza.fi/edome/arvostelut/stalker-clear-sky http://plaza.f...
30-30 RK Rotary Koater Video | Testing Machines Inc. The 30-30 RK Rotary Koater by Testing Machines Inc. The RK Rotary Koater is a flexible coating, printing and laminating machine. The base unit is ava...
real estate internet marketing http://www.InternetInvestorsClub.com/ Real Estate Internet Marketing is the most time & cost efficient way to generate buyer or seller leads. To Lear...
Shmoo1847 EoinMiller &Adair Collings - Auditing Cached Credential With Cachedump Recorded at the www.ShmooCon.org HACKING AND COMPUTER SECURITY CONFERENCE, March 23, 2007 in Washington, D.C. Content produced by www.MediaArchives.c...




Search This Site:










discountasp.net new server help.

tagprefix and mulitple namespaces problem

replicating functionality of xml control with xsltcommand?

how does repeater regenerate

hosting with crystal reports

.net templated control design time support

a looking for a 3rd party control that performs file uploads and downloads

how to get login server control functionality like "convert to template" in designer

i want to setup property value in property page but there "object reference not set to an instance of an object."

build an extender provider component for asp.net

i cant use my computer as web server

generating images on-the-fly

event accessor in vb.net

treeview does not callback in netscape 7.2?

nested databound control

best web hosting company for .net projects

access the control in user control by java script

header/footer control

can anyone convert this? please!!!!!!!!!!

compositecontrol made up of complex children?

newbie ? re: c# and vs

can someone list out the new server controls?

problem with button_click in webpart

quoted attributes in rendered elements

anyone use halfpricehosts.com?

no control after button click

server controls displaying visual elements

accessing a user-control's properties from within another

persisting a collection in a webcontrol

who are the big boys?

  Privacy | Contact Us
All Times Are GMT