473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trick or Treat? About Server Control

<%@ Page Language="C#" Debug="true"%>
<SCRIPT language="C#" runat="server">
void Alt(Object From,EventArgs aEventArgs){
Info.Text=((LinkButton)From).Text;
}
</script>
<HTML>
<BODY>
<form runat="server">
<%
Menu.Text="Home";
%>
<asp:LinkButton Id=Menu OnClick=Alt RunAt=Server/>
<br>
Text:<asp:Label Id=Info runat=Server />
</form>
</BODY></HTML>

------------------------------------
If:
Menu.Text="Home"
is work,why Alt() can't get the control's property(Menu.Text has
nothing)?
if not,we indeed see the text on UI.
I miss what here?

Nov 19 '05 #1
3 1064
what are you trying to retrieve with the line:
Info.Text=((LinkButton)From).Text;
There is nothing with the Id From?

try change that line to read
info.Text = Menu.Text;

"farmer" <sd******@sina.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
<%@ Page Language="C#" Debug="true"%>
<SCRIPT language="C#" runat="server">
void Alt(Object From,EventArgs aEventArgs){
Info.Text=((LinkButton)From).Text;
}
</script>
<HTML>
<BODY>
<form runat="server">
<%
Menu.Text="Home";
%>
<asp:LinkButton Id=Menu OnClick=Alt RunAt=Server/>
<br>
Text:<asp:Label Id=Info runat=Server />
</form>
</BODY></HTML>

------------------------------------
If:
Menu.Text="Home"
is work,why Alt() can't get the control's property(Menu.Text has
nothing)?
if not,we indeed see the text on UI.
I miss what here?

Nov 19 '05 #2
Grant Merwitz wrote:
what are you trying to retrieve with the line:
Info.Text=((LinkButton)From).Text;
There is nothing with the Id From?

try change that line to read
info.Text = Menu.Text;


Id From is not a Control'Id directly,it is current Event Object,also
saying:"Sender","Src",or any variable name we name it like the method
defines:

void Alt(Object From,EventArgs aEventArgs){
...
...

Nov 19 '05 #3
Sorry about that.,
So used to writing "Object Sender" i never even picked that up

Strange how its not working though. Sorry, no more suggestions

"farmer" <sd******@sina.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Grant Merwitz wrote:
what are you trying to retrieve with the line:
Info.Text=((LinkButton)From).Text;
There is nothing with the Id From?

try change that line to read
info.Text = Menu.Text;


Id From is not a Control'Id directly,it is current Event Object,also
saying:"Sender","Src",or any variable name we name it like the method
defines:

void Alt(Object From,EventArgs aEventArgs){
...
...

Nov 19 '05 #4

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

Similar topics

6
2025
by: Ray | last post by:
I have a main form with a subform. The main form has a combo box which lists all the clients which in turn are displayed in the subform. The subform is bound to the combo box and all work well....
5
1568
by: Alex Nitulescu | last post by:
Hi. Because I'm a beginner in creating controls, I spent more than two *&^#$ hours to create this "login" as a custom control and to make it work properly: ...
29
3645
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
4
1225
by: Boni | last post by:
Dear all, Is there some trick to put controls on a particular control but in other thread. Example: A control is a part of bigger application and application thread freezes somtimes. So a...
3
1245
by: rodchar | last post by:
hey all, anybody have any neat ways to handle control state on a web page? for example i have a lot of buttons on my page that i have to constantly enable and disable on postback but it gets kinda...
7
2588
by: Wanjun Yu | last post by:
Hi All, On my windows form, when the user hits the return key, I'll need to treat it as a tab key. i.e. when the user hits a return, the focus will move to the next item in the tab-order on the...
15
4319
by: Zhang Weiwu | last post by:
http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml webpage to IE as application/xml I used that trick and now every one of my xhtml webpage have following first 4 starting...
3
2140
by: DR | last post by:
I heard there is some trick to referencing statics in C# CLR stored procedure without having to mark the assembly as unsafe. Does anyone know this? This is usefull as the case of needing a little...
5
2659
by: Craig Buchanan | last post by:
I would like to monitor a POP3 mailbox with multiple clients. However, I want to ensure that each message is processed by only one client. In essence, I would like to treat a POP3 mailbox like a...
0
7225
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
7123
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
7326
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
7383
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...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
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...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.