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

How to access properties of buttons/labels on a login control ?

Using asp.net 2.0.

I have this code:
protected void Page_Init(object sender, EventArgs e)
{
Login1.LoginButtonText = MyFuncion();
string testtext = Login1.LoginButtonText;
}
It doesn't work.

protected void Page_Load(object sender, EventArgs e)
{
Login1.LoginButtonText = MyFuncion();
string testtext = Login1.LoginButtonText;
}
It doesn't work either.

I put a breakpoint on the "string testtext" line, and I see in the
debugger than the string is correctly being returned by the funcion
"myfunction()" and LoginButtonText property is supposedly to have this
value.
But on the page, the Login1.LoginButtonText is still containing the
default value I setup in design time.
Maybe I'm just not putting this code in the correct place and that's
why the text is set back to its original value later, I tried preinit,
but I got "object not set" errors there.

Maybe I should not use this LoginButtonText property that BTW, I get no
idea where it comes from. I'd like to use something like
"Login1.LoginButton.Text = myfunction()", but it seems the LoginButton
button is not accessible from nowhere.

So, how do I change the text of the loginbutton in the login form on
the fly ?

Oct 22 '06 #1
1 1477
You have to drill into the template, find the control and set properties on
most controls. The button is internal to the control.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
<cr************@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Using asp.net 2.0.

I have this code:
protected void Page_Init(object sender, EventArgs e)
{
Login1.LoginButtonText = MyFuncion();
string testtext = Login1.LoginButtonText;
}
It doesn't work.

protected void Page_Load(object sender, EventArgs e)
{
Login1.LoginButtonText = MyFuncion();
string testtext = Login1.LoginButtonText;
}
It doesn't work either.

I put a breakpoint on the "string testtext" line, and I see in the
debugger than the string is correctly being returned by the funcion
"myfunction()" and LoginButtonText property is supposedly to have this
value.
But on the page, the Login1.LoginButtonText is still containing the
default value I setup in design time.
Maybe I'm just not putting this code in the correct place and that's
why the text is set back to its original value later, I tried preinit,
but I got "object not set" errors there.

Maybe I should not use this LoginButtonText property that BTW, I get no
idea where it comes from. I'd like to use something like
"Login1.LoginButton.Text = myfunction()", but it seems the LoginButton
button is not accessible from nowhere.

So, how do I change the text of the loginbutton in the login form on
the fly ?

Oct 22 '06 #2

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

Similar topics

17
by: Jelmer | last post by:
Hi, I am mildly familiar with ms access developement and I have been asked to port and document a ms access app. I expect the porting (97 to XP) to be fairly straightforward. However documenting...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: ctyrrell | last post by:
Does anyone know of any restrictions of controls on Access forms that makes them ineligible for Context-Sensitive help? Are some types of controls not able to be made context-sensitive? I have...
5
by: Wolfgang | last post by:
Dear all, I've a lot of buttons named button1..button100 and want to change some of there propertys. Maintaining the overview I'm looking for a possibility for something like: ...
1
by: Rahim | last post by:
i want to change all the label control style Properties, server control properties at runtime how should i call all the label at runtime, which is present at webform, any collections???? i...
2
by: amith.srinivas | last post by:
Hi all, From a word macro in VBA, I am trying to create a report in access DB. The report is based on a query with a parameter. I am using Set rpt = Application.CreateReport rpt.RecordSource =...
2
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
10
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Not sure if I quite follow that. 1....
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.