Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Setting Text of a button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NEMA - 20 Aug 2007 17:28 GMT
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.xml","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.xml","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
Eliyahu Goldin - 20 Aug 2007 17:43 GMT
<%# ... is a databinding expression. You need to call DataBind method to
execute it.

Signature

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

> Hello everyone,
>
[quoted text clipped - 13 lines]
>
> Did anyone try it before and please give me some hints. Thanks everyone
NEMA - 20 Aug 2007 18:26 GMT
Thanks

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

On 8 21 ,   12 43 , "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.org> wrote:
> <%# ... is a databinding expression. You need to call DataBind method to
> execute it.
[quoted text clipped - 23 lines]
>
> -         -
Eliyahu Goldin - 20 Aug 2007 19:07 GMT
Just call the DataBind() method for the page and <%# .. %> will work

Signature

Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin

> Thanks
>
[quoted text clipped - 31 lines]
> >
> > -         -
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 20 Aug 2007 18:44 GMT
Perhaps you should try another approach.
For example, in your Page_Load event you could use code like this:
btn_submit.Text = GetText("abc.xml","btn_text")

Signature

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

> Hello everyone,
>
[quoted text clipped - 13 lines]
>
> Did anyone try it before and please give me some hints. Thanks everyone

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.