I need to push something into my ASP.NET web form page from a Silverlight control.
I set the ID of my text box and, as is it’s want, ASP.NET “helpfully” adds on the ctl…blah_blah stuff. Can I assume this will always be the same gumpf it puts on the beginning of my id?
Kindness,
Dan
EDIT: Thanks for the responses guys.
Using the HtmlPage.Document from my Silverlight control, I used Doug’s solution as such …
var spec = HtmlPage
.Document
.GetElementsByTagName("input")
.FirstOrDefault(so => ((HtmlElement)so).CssClass == "spec");
No, it could easily change if you ever add another control in front of it, or nest it in another control. Additionally, the id is different depending on the browser. In some browsers
.NETsplits with_other browsers use$. I haven’t worked with Silverlight, but can you find an element with a certain class? You could apply a class name to your element and ASP.NET won’t edit it at all.