简体   繁体   中英

Evaluate a string in wp7/wp8

I am currently doing my first application in the wp8 sdk and have come across a problem. What I want to do is when the user clicks a hyperlink button, it evaluates a bound textbox (author) and send it as a search string to google.

" http://www.google.com/search?q= "

Now I tried using the Eval method that is available in asp.net; but it did not work. I have also tried to find alternatives for it, but not much luck there either.

So my question is. Is there any way to send a search string to google, evaluating a string?

Just to mention, all of this is in windows phone 8 sdk. And is within a datatemplate.

Thanks

Setting the NavigateUri and Target on the HyperlinkButton should navigate to the web site. To construct the NavigateUri to include user input you can add an extra string property alongside your already bound Author property (wherever that lives) and just expose the root " http://www.google.com/search?q= " + Author . Once you have that bound to NavigateUri (and getting property change notifications along with Author ) the button should launch with the user entered text included.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM