由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - How to uncheck radiobutton?
相关主题
请教detailsview和radiobutton的问题。(Asp.net C#)WPF的datatemplate/binding真好用
ASP.NET和J2EE哪个更成熟?今天被一个同事给雷到了
请教VC++.net前景网页制作的最高境界
Anyone started programming WPF?about windows 8
silverlight请教这样的小系统怎么做
是不是最近dotnet不济了再问大家,关于.net
silverlight现在如何了?想换工作了。。。唉
How do you like ASP.NET MVC?有大侠牛人能推荐一下吗?
相关话题的讨论汇总
话题: uncheck话题: checked话题: radio话题: code
进入DotNet版参与讨论
1 (共1页)
c**t
发帖数: 2744
1
I'm using System.Windows.Forms.WebBrowser in one WPF project. I'm able to
check all radio buttons with the following code:
foreach(HtmlElment e in wb.Document.GetElementsByTagName("input"))
{
if( e.GetAttribute("type").Equals("radio"))
{
e.SetAttribute("checked", "true");
}
}
but the code e.SetAttribute("checked", "false") does NOT work. How to toggle
the radiobutton in Code behind?
My current work around is to execScript( myCustomJS ), and uncheck radio
buttons via javascrip
c**t
发帖数: 2744
2
found solution:
if( e.OuterHtml.Contains("CHECKED"))
e.OuterHtml = e.OuterHtml.Replace("CHECKED", "");
which will uncheck the radio button

toggle

【在 c**t 的大作中提到】
: I'm using System.Windows.Forms.WebBrowser in one WPF project. I'm able to
: check all radio buttons with the following code:
: foreach(HtmlElment e in wb.Document.GetElementsByTagName("input"))
: {
: if( e.GetAttribute("type").Equals("radio"))
: {
: e.SetAttribute("checked", "true");
: }
: }
: but the code e.SetAttribute("checked", "false") does NOT work. How to toggle

k*****G
发帖数: 697
3
nice!
M******k
发帖数: 27573
4
same thing goes for html checkbox too.

【在 c**t 的大作中提到】
: found solution:
: if( e.OuterHtml.Contains("CHECKED"))
: e.OuterHtml = e.OuterHtml.Replace("CHECKED", "");
: which will uncheck the radio button
:
: toggle

1 (共1页)
进入DotNet版参与讨论
相关主题
有大侠牛人能推荐一下吗?silverlight
几个C# Developer的工作岗位是不是最近dotnet不济了
求建议:用什么软件开发好?silverlight现在如何了?
这样的情况怎么加工资 (转载)How do you like ASP.NET MVC?
请教detailsview和radiobutton的问题。(Asp.net C#)WPF的datatemplate/binding真好用
ASP.NET和J2EE哪个更成熟?今天被一个同事给雷到了
请教VC++.net前景网页制作的最高境界
Anyone started programming WPF?about windows 8
相关话题的讨论汇总
话题: uncheck话题: checked话题: radio话题: code