473,799 Members | 3,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting Text of a button

Hello everyone,

i have a problem while setting the button text recently

for my case, i would like to set the text of the button on the aspx
page, i have write the code like below

<asp:button id="btn_submit " text='<%# GetText("abc.xm l","btn_text ")
%>' >

where the GetText is a function which will retrieve a string in xml
The page can run but the text cannot be display on the button. i am
sure that the function is work as i have tried it on the code-behind
like: btn_submit.text = GetText("abc.xm l","btn_text ") , it work fine
with no problem but it dont work while i try it in the aspx page.

Did anyone try it before and please give me some hints. Thanks everyone

Aug 20 '07 #1
4 1255
<%# ... is a databinding expression. You need to call DataBind method to
execute it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"NEMA" <re*******@gmai l.comwrote in message
news:11******** *************@z 24g2000prh.goog legroups.com...
Hello everyone,

i have a problem while setting the button text recently

for my case, i would like to set the text of the button on the aspx
page, i have write the code like below

<asp:button id="btn_submit " text='<%# GetText("abc.xm l","btn_text ")
%>' >

where the GetText is a function which will retrieve a string in xml
The page can run but the text cannot be display on the button. i am
sure that the function is work as i have tried it on the code-behind
like: btn_submit.text = GetText("abc.xm l","btn_text ") , it work fine
with no problem but it dont work while i try it in the aspx page.

Did anyone try it before and please give me some hints. Thanks everyone

Aug 20 '07 #2
Thanks

So how can i execute that function
i have also try <%= GetText("abc.xm l","btn_text ") %but it is not
work too

On 8 21 , 12 43 , "Eliyahu Goldin"
<REMOVEALLCAPIT ALSeEgGoldD...@ mMvVpPsS.orgwro te:
<%# ... is a databinding expression. You need to call DataBind method to
execute it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net

"NEMA" <realja...@gmai l.comwrote in message

news:11******** *************@z 24g2000prh.goog legroups.com...
Hello everyone,
i have a problem while setting the button text recently
for my case, i would like to set the text of the button on the aspx
page, i have write the code like below
<asp:button id="btn_submit " text='<%# GetText("abc.xm l","btn_text ")
%>' >
where the GetText is a function which will retrieve a string in xml
The page can run but the text cannot be display on the button. i am
sure that the function is work as i have tried it on the code-behind
like: btn_submit.text = GetText("abc.xm l","btn_text ") , it work fine
with no problem but it dont work while i try it in the aspx page.
Did anyone try it before and please give me some hints. Thanks everyone- -

- -

Aug 20 '07 #3
Perhaps you should try another approach.
For example, in your Page_Load event you could use code like this:
btn_submit.Text = GetText("abc.xm l","btn_text ")

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"NEMA" <re*******@gmai l.comwrote in message
news:11******** *************@z 24g2000prh.goog legroups.com...
Hello everyone,

i have a problem while setting the button text recently

for my case, i would like to set the text of the button on the aspx
page, i have write the code like below

<asp:button id="btn_submit " text='<%# GetText("abc.xm l","btn_text ")
%>' >

where the GetText is a function which will retrieve a string in xml
The page can run but the text cannot be display on the button. i am
sure that the function is work as i have tried it on the code-behind
like: btn_submit.text = GetText("abc.xm l","btn_text ") , it work fine
with no problem but it dont work while i try it in the aspx page.

Did anyone try it before and please give me some hints. Thanks everyone
Aug 20 '07 #4
Just call the DataBind() method for the page and <%# .. %will work

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"NEMA" <re*******@gmai l.comwrote in message
news:11******** **************@ m37g2000prh.goo glegroups.com.. .
Thanks

So how can i execute that function
i have also try <%= GetText("abc.xm l","btn_text ") %but it is not
work too

On 8 21 , 12 43 , "Eliyahu Goldin"
<REMOVEALLCAPIT ALSeEgGoldD...@ mMvVpPsS.orgwro te:
<%# ... is a databinding expression. You need to call DataBind method to
execute it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP
[ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net

"NEMA" <realja...@gmai l.comwrote in message

news:11******** *************@z 24g2000prh.goog legroups.com...
Hello everyone,
i have a problem while setting the button text recently
for my case, i would like to set the text of the button on the aspx
page, i have write the code like below
<asp:button id="btn_submit " text='<%# GetText("abc.xm l","btn_text ")
%>' >
where the GetText is a function which will retrieve a string in xml
The page can run but the text cannot be display on the button. i am
sure that the function is work as i have tried it on the code-behind
like: btn_submit.text = GetText("abc.xm l","btn_text ") , it work fine
with no problem but it dont work while i try it in the aspx page.
Did anyone try it before and please give me some hints. Thanks
everyone- -

- -


Aug 20 '07 #5

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

Similar topics

1
4329
by: Jim Quast | last post by:
I have an ASP page and a CREGReports002.vbs file coded to export data to excel. I do this by building variables in a stored procedure. The ASP page has text boxes, list boxes, and radio buttons. I also placed two buttons on the form. One submits the form to redirect to the Crystal Web Viewer (genCREGReports.ASP). The other one executes VB code in a vbs document that spawns some more code to run a stored procedure with the values from...
21
9925
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
18
18433
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on a remote update of tables and fields and can't find enough information on these things. Also, how do you index a field in code?
0
2354
by: Stuart Norris | last post by:
Dear Group, I am having a problem setting SocketOptionName.SendTimeout on a client TCPIP application using the sockets in .NET. From the on-line help it is possible to set a SocketOptionName.SendTimeout for sends on TCPIP sockets. In all the tests that I have done with both Async and Sync sends the send returns immediately with the number of bytes sent (< 100 in my messages).
1
1493
by: tshad | last post by:
I want to be able to change the color of the text of a button after it is pressed. The first part of the event is: sub submitQuestion_click(Sender as Object, e as EventArgs) trace.warn("Sender text = " & Sender.text) trace.warn("Sender color = " & Sender.ForeColor.ToString()) Sender.ForeColor = System.Drawing.Color.Red
2
3729
by: dotnetjose | last post by:
Hi Folks, My subject message pretty musch explains it. By Default the Form definition sits at the Master Page file. Is there a way I can access the setting from my Content Page that uses a Master Page? Thanks in advance.
0
1230
by: Rocky | last post by:
Dear ALL, I am facing a bit problem in DATAGRID. so may be you guys can help me out. Actually on a DataGrid I am having following controls: 1) 2 DropDown Menu 2) 1 Text Box 3) 1 ADD Button 4) 1 Remove Button So these all controls are in 1 row and looks like:
1
2908
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are further to the right of the form than the form's default width - which may take up the entire screen for some users). The form contains panels which will contain either textboxes or datagridviews. The button is located on the menustrip towards...
0
9544
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10238
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.