且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在使用scriptlet标签的aspx上编写if单选按钮选中属性

更新时间:2023-02-25 08:03:15

嗨Jagadeesh,>


首先请告诉您,您无法在任何控件的标签中添加此类条件。

您可以在这做的就是你可以根据满足条件生成控件,如下例所示: -



Ex: -



Hi Jagadeesh,

First of all let you know that you can not add this kind of conditions within a tag of any control.
What you can do here is you can generate controls as per the satisfaction of the condition as mentioned in below example :-

Ex :-

<% if (!IsToView)
           { %>
            <asp:RadioButton  ID="RadioButton1" runat="server" GroupName="Options" Text='test' />
        <% } %>
        <% else { %>
            <asp:RadioButton  ID="RadioButton2" runat="server" GroupName="Options" Text='test' Checked="true" />
        <% } %>





这只是一个帮助你的例子。

希望这对你肯定有帮助。



This just an example to help you out.
Hope this will be surely helpful to you .