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: 1/19/2005 3:16:42 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 17 Views: 26 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
18 Items, 1 Pages 1 |< << Go >> >|
chicagonovice
Asp.Net User
Setting custom property on page at design time1/19/2005 3:16:42 PM

0/0

I've created a class which inherits from System.Web.UI.Page which in turn is inherited by all my pages. In my class I have a property that I can set programmatically at run time but which I can't seem to set at design time. I'm not sure what I'm missing and all the references I can find refer to setting up controls, not a page; and I think that they act rather differently.

If you could give me a hint or point me in the direction of a good article I'd be very grateful.


Thanks
webbes
Asp.Net User
Re: Setting custom property on page at design time1/19/2005 3:34:38 PM

0/0

What language? C# VB ....
chicagonovice
Asp.Net User
Re: Setting custom property on page at design time1/19/2005 5:23:05 PM

0/0

VB. But does it matter?
webbes
Asp.Net User
Re: Setting custom property on page at design time1/19/2005 10:10:58 PM

0/0

how do you set the property?

like this:

Public MyProperty as String

or like this:

private _myProperty as String

Public Property MyProperty() As String
Get
Return _myProperty
End Get
Protected Set(ByVal value As String)
_myProperty = value
End Set
End Property


the first won't work in designer the second will

cheers,
Wes

P.S. giving an example is much easier if you know which language someone's using!
chicagonovice
Asp.Net User
Re: Setting custom property on page at design time1/19/2005 10:27:38 PM

0/0

Thanks for the reply. I'm setting it like the second example:


Private _ScrollPersistence As ScrollOptions

Public Property ScrollPersistence() As ScrollOptions
Get
If ScrollPersistence = Nothing Then
Return ScrollOptions.PostbackPersistence
Else
Return Me._ScrollPersistence
End If
End Get
Set(ByVal Value As ScrollOptions)
Me._ScrollPersistence = Value
End Set
End Property



I'll reiterate that this is a property in a class inherited from System.Web.UI.Page. Does this make any difference to how this works (compared to a web control).
webbes
Asp.Net User
Re: Setting custom property on page at design time1/20/2005 8:39:32 AM

0/0

I got to check my books to be sure, but as far as I know the Page inherits from the System.Web.UI.Control so there shouldn't be a difference. But I've found one mistake. You've forgotten the underscore in:
If _ScrollPersistence = Nothing Then

but this might be a copy/paste error.

Ehm... if you need a ScrollControl I got one that needs testing but should work. Maintains scroll on the page or on any element on the page ... so please let me know.

Cheers,
Wes
AndrewSeven
Asp.Net User
Re: Setting custom property on page at design time1/23/2005 3:39:44 AM

0/0

Do you mean you want to set it in html like a control tag's properties?
ChicagoNovice
Asp.Net User
Re: Setting custom property on page at design time6/14/2005 4:12:55 PM

0/0

No - I mean I want to see it in the properties window like pageLayout or snapToGrid
webbes
Asp.Net User
Betreft: Re: Setting custom property on page at design time6/15/2005 7:59:55 AM

0/0

Now we are getting there,

Search for the System.ComponentModel class and you'll find your answer and a lot more info....

http://www.c-sharpcorner.com/Code/2003/May/ReusableComponents.asp you'll find a simple example here

Cheers,
Wes

ChicagoNovice
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/15/2005 1:04:09 PM

0/0

I've built components before and added my own properties without a problem, however I want to add properties to my custom page class and have these appear in the properties window.  Unless I'm missing something elementary this is a different proposition.
superconsultant
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/16/2005 6:51:18 PM

0/0

I think your problem is you inherit from System.Web.UI.Page instead of  System.Web.UI.WebControls.WebControl.
ChicagoNovice
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/16/2005 8:16:47 PM

0/0

Surely if I'm trying to create a page subclass then I need to inherit from Page and not WebControl.  If I inherit from WebControl then I'm going to lose things like IsPostBack and a host of other necessary items.
superconsultant
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/16/2005 10:15:58 PM

0/0

All you are saying is true. But thing like being able to edit WebControl properties at design time in Properties Window require control to be inherited from System.Web.UI.WebControls.WebControl.

ChicagoNovice
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/20/2005 1:10:54 PM

0/0

So the short answer is that I can't add properties to a page that can be seen in the properties window at design-time?  Surprise [:O]
superconsultant
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/20/2005 3:15:24 PM

0/0

If you don't inherit from WebControl,  No.

ChicagoNovice
Asp.Net User
Re: Betreft: Re: Setting custom property on page at design time6/20/2005 6:02:27 PM

0/0

And if I do inherit from WebControl I can't use my class as a page?  Just want to make sure I'm clear.

mw:17:61
Asp.Net User
Re: Setting custom property on page at design time6/21/2005 1:03:09 PM

0/0

Setting  [non default] value for property means that samewhere in the code at run time will be an assignment statement. When you are talking about design time initialization perhaps you think of something that can be changed without re-compiling the whole solution. than you may put assignment into <script runat=server...>  block, not in code behind.

<%@Page ..
<script runat=server...

 MyProperty = aValue;

...

Are you talking about this? or you want to see the name of the property in property browser window


+&up;
ChicagoNovice
Asp.Net User
Re: Setting custom property on page at design time6/21/2005 1:38:03 PM

0/0

I was talking about seeing the property in the property browser window so that the developers for whom I've developed the page don't need to know in advance of the property; they will just see it in the property browser and be able to set it.
18 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Special Edition Using Microsoft Office FrontPage 2003: Special Edition Authors: Jim Cheshire, Paul Colligan, Pages: 1080, Published: 2003
Alison Balter's Mastering Access 11 Authors: Alison Balter, Pages: 1440, Published: 2003
Programming Microsoft Visual Basic 6.0: [master Object-oriented Programming Techniques for Rapid 32-bit Development] Authors: Francesco Balena, Pages: 1276, Published: 1999
Pro .NET 2.0 Windows Forms and Custom Controls in C#: From Professional to Expert Authors: Matthew MacDonald, Pages: 1037, Published: 2005
Professional Web Parts and Custom Controls with ASP.NET 2.0 Authors: Peter Vogel, Pages: 449, Published: 2005
Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005 Authors: Matthew MacDonald, Pages: 1036, Published: 2006
The Visual Basic Object and Component Handbook Authors: Peter Vogel, Pages: 668, Published: 2000
Pro SQL Server 2005 Integration Services: Intergration Services Authors: James Wightman, Pages: 548, Published: 2007
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005

Web:
Setting custom property on page at design time - ASP.NET Forums Re: Betreft: Re: Setting custom property on page at design time ... Re: Betreft: Re: Setting custom property on page at design time ...
Cutting Edge: Custom Design-time Control Features in Visual Studio ... The design-time behavior of a control can be enhanced by setting predefined .... in the @Register directive used to link the custom Web control to the page. ...
CodeProject: Creating Custom Controls-Providing Design Time ... DesignerSerializationVisibility attribute specify the type of persistence to use while serializing a property on a control at design time. Setting this ...
VB Helper: HowTo: Provide design time support for a custom control ... Keywords, custom control, design time, support, icon, smart tag, .... Finally, whenever the user modifies a value on a property page the page class calls ...
Page 4 - Custom Controls and Design-Time Support: Part 1/2 Page 4 - Custom Controls and Design-Time Support: Part 1/2. ... These include two attributes that set the default event and property. ...
Custom Design Time UI in .NET If the value given for the property at design time is different from ... Design namespace. This class acts as a base class for custom type ...
Amr Elsehemy | Custom Controls Design Time Support Part 14: Extra ... Custom Controls Design Time Support Part 14: Extra Property Tab. by Amr Elsehemy 8. February 2008 .... Page List. My Open Source Controls ...
Setting Custom Properties and UI Hints on Dynamically Created View ... Otherwise, set the custom property on the indicated attribute ... ApplicationModule interface to the custom * interface BC4J design time creates for us when ...
Debugging Design-Time Controls Summary: Walks through the process of debugging any custom design-time control when it is .... Figure 8. Setting the breakpoint in your custom property ...
Defining and Using Custom Attribute Classes in C# .NET also allows you to create your own custom Attribute classes. ... NET attributes that the property sheet uses at design-time in the Visual Studio . ...

Videos:
Santa Monica Council Meeting Santa Monica Council Meeting
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared to Ruby-on...
www.moldytoaster.com polled three days and got--one vote, declared County Member elect. Sibthorp shall be a man of weight and influence, "giving to (h)airy nothing a loca...
EarningsCast - Google Q2 2006 Earnings Call in Full. EarningsCast creates Podcasts of Company Earnings Calls. You can see the full complement at http://www.earningscast.com. This is the Q2 2006 Google e...




Search This Site:










server application unavailable

open a hyperlinked file as read only

what does mvp stands for?

newbie has coding problem (2 qs)

reg : view state

url regex

is there any alternative to codesmith .....

clientscriptmanager.registerforeventvalidation?

http request header

how to use regex backreference to pull databse table content / or pass too function.

advantage of registering javascript

change line

view xml of stored procedure result

encrypting web.config programatically with vb.net

error 554 response

convert hex to int

add google adsense javascript code at runtime

proejct dll's not copied to web project

container.dataitem in a formview

what should be the way to store a public static variable for user-defined control?

id and password verification

asp.net website help

ajax question

retrieving data from database and writing it to page

***** oledbdatareader missing records !!!

error handling techniques

check if file exists

is there any way to convert word document to pdf

quick question about integers...

convert web url into an image

  Privacy | Contact Us
All Times Are GMT