【質問】ASP.NETスレ ..
[2ch|▼Menu]
690:nobodyさん
09/07/27 20:19:11
>>686
UserControl、ReadOnlyプロパティから考えるにサーバコントロールじゃないの?
そもそもClientでValidationを行うのが間違いだし
超簡単にやるなら、こんなでいいんじゃない。

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
public partial class WebUserControl : System.Web.UI.UserControl
{
 public bool ReadOnly
 {
  get { return this.Label1.Visible; }
  set
  {
   this.Label1.Visible = value;
   this.TextBox1.Visible = !value;
  }
 }
 public string Text
 {
  get { return this.Label1.Text; }
  set
  {
   this.Label1.Text = value;
   this.TextBox1.Text = value;
  }
 }
}


次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4155日前に更新/262 KB
担当:undef