Skip to main content
Home Forums Silverlight Programming Programming with .NET - General HtmlElement Question:
3 replies. Latest Post by Sopheap Ly on January 24, 2008.
(0)
TehShlock
Member
74 points
34 Posts
01-23-2008 11:36 PM |
Hey Guys,
I've only just started using Silverlight, and I have a quick question. On my .xaml page I have a simple login routine written w/ silverlight. Now my 2 HTML elements are input boxes, UID & PID (Username, Password) and I have 2 buttons, a Submit (which works fine) and a Reset (which dosen't work at all.) Now here's my question: I'm want my ResetMethod to clear the contents of the UID & PID input fields. I've tried using .Remove : UID.GetAttribute("value").RemovePID.GetAttribute("value").Remove(1,30); My issue is, I don't know the correct syntax for Remove, and I tried my best and failed, so I'm asking for some help with my code. Thanks in advance to anyone that can help me out. I'm positive someone out there has done this before or at least knows how.
I've only just started using Silverlight, and I have a quick question. On my .xaml page I have a simple login routine written w/ silverlight. Now my 2 HTML elements are input boxes, UID & PID (Username, Password) and I have 2 buttons, a Submit (which works fine) and a Reset (which dosen't work at all.) Now here's my question:
I'm want my ResetMethod to clear the contents of the UID & PID input fields. I've tried using .Remove : UID.GetAttribute("value").RemovePID.GetAttribute("value").Remove(1,30); My issue is, I don't know the correct syntax for Remove, and I tried my best and failed, so I'm asking for some help with my code.
I'm want my ResetMethod to clear the contents of the UID & PID input fields. I've tried using .Remove :
UID.GetAttribute("value").RemovePID.GetAttribute("value").Remove(1,30);
My issue is, I don't know the correct syntax for Remove, and I tried my best and failed, so I'm asking for some help with my code.
Thanks in advance to anyone that can help me out. I'm positive someone out there has done this before or at least knows how.
Sopheap Ly
Participant
902 points
205 Posts
01-24-2008 12:17 AM |
Try this:
UID.SetAttribute("value", String.Empty)
PID.SetAttribute("value", String.Empty)
The GetAttribute() didn't work because it returns a String which is passed by value. The Remove() is a member of String, so it only modifies the string. I suggest you look up "pass by reference" and "pass by value".
If this answers your question, please click "Mark as Answer"
01-24-2008 12:21 AM |
Thanks, that did work. I wasn't even thinking about the GetAttribute tag, I was focusing on what to do with the value that was being returned. *_*
01-24-2008 7:02 AM |
You're welcome, mate.