473,322 Members | 1,409 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,322 software developers and data experts.

Object to controltype?

I wonder how i can get rid of the warnings.
I pass one control as object to a procedure.
However, the controltype differs per scenario, therefore i choose for AS
object.

I want to set a style in this procedure like:
mycontrol.Attributes.Add("style", "DISPLAY: none;")

It works fine, but i wanted to convert to a webcontrol or similar to get rid
of the warnings.

Hopefully i don't have to use another param for type?
Nov 19 '05 #1
4 1324
You could overload the method so that it takes either kind of control.
Alternately, you could use GetType (or in C# typeof) to get the type
and modify your code according to the type.

If both controls share a common base, you could have the method take
the base, but it doesn't sound like they do from your comments.

HTH
Andy

Nov 19 '05 #2
I read about session which expires and then they want to jump to login page.

That's not the problem for me imo.
Since the login remains authenticated.

The problem is that variables are lost and i want to jump to the default
page instead of the login.
(Why login?)

I'm using
Application_AuthenticateRequest() in the global asax to check on each
request.
Maybe i can change my code little in here to:
Continue somehow or jump to the default page.


Nov 19 '05 #3
That seems complicated, i'm using the VB part :)
I'm passing the control and i alreadt tried GetType() on the OBJECT var.
This is not allowed.
(Type not defined)

Since this param can be nothing also..


"Andy" <aj********@capcitypress.com> schreef in bericht
news:11**********************@o13g2000cwo.googlegr oups.com...
You could overload the method so that it takes either kind of control.
Alternately, you could use GetType (or in C# typeof) to get the type
and modify your code according to the type.

If both controls share a common base, you could have the method take
the base, but it doesn't sound like they do from your comments.

HTH
Andy

Nov 19 '05 #4
Sorry, diff. topic, will repost..
"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
I read about session which expires and then they want to jump to login
page.

That's not the problem for me imo.
Since the login remains authenticated.

The problem is that variables are lost and i want to jump to the default
page instead of the login.
(Why login?)

I'm using
Application_AuthenticateRequest() in the global asax to check on each
request.
Maybe i can change my code little in here to:
Continue somehow or jump to the default page.

Nov 19 '05 #5

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

Similar topics

1
by: Bijay Kumar | last post by:
Hi Guys, I was going through the source code of Object.cs in rotor. What I found is Equals() implemented as follows: public extern virtual bool Equals(Object obj); What I don't...
8
by: deko | last post by:
I'm hoping someone can sanity check my understanding of the Object Model for Forms/Controls. I'm having trouble drilling down into Control properties. First, I have a record set with the...
1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
2
by: Bruce Acciavatti | last post by:
I need to have a way to identify the individual text and label controls on a form within my VBA code in order to set the properties depending on conditions. There are 25 text fields, and I don't...
4
by: MasterChief | last post by:
I have an insert template textbox that is bound to a field in SQL. Since it is the insert template it really doesn't have anything in it. How do I set the default text? Like for example if I have a...
1
by: annbb | last post by:
I have a piece of code which resets all the control on a form ..but if I also put an option group on the form and the relevant code in the routine to reset it I get an error message saying that...
5
by: sparks | last post by:
I have a form that is broken down into 24 sub forms. these are all tied to one subform, they are filtered based on other things. But I need to change the sub forms source object based on a...
4
by: sparks | last post by:
I was doing this on a form to use a keydown event If ActiveControl.ControlType = acComboBox Then Well for some reason in a different database it would not work. It must have been a library or...
1
by: Dave | last post by:
Hello, I know that I can use the Parent property to get the name of the form that a subform is on, but what if I need the name of the subform/ subreport "box" on that form that contains my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.