1

10月12日まで非表示にしてから10月13日から表示する必要があるdivがあります。サイトはC#.NETで構築されているため、HTMLページのコードビハインドにifステートメントを追加できます。これが可能かどうか、またはjQueryソリューション(私は何も知りません)が必要かどうかはわかりません。どんな助けでもいただければ幸いです。

HTMLのコードは次のとおりです。

<p style="bold">SHOW THROUGH 10/12!!!<p>
<p>Every day from now until Metastatic Breast Cancer Awareness Day (Oct. 13), a new video will be featured. Please check-in every day to hear a new story and come back on Oct. 13 to see the new, complete video wall.</p>

<div id="mbcRadioList">
    <p style="bold">BUILD BUT HIDE UNTIL 10/13!!!<p>
    <p><strong>Want to learn more?</strong> Select a video topic to better understand the varied experiences of people living with MBC and their family and friends.</p>
    <div class="checkBoxesColumn">
        <label><input name="videoWallRadio" type="radio" id="" value="" />View All</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" checked />My MBC Journey</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Challenges</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Positive Outlooks &amp; Advice</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Giving Thanks</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Family / Friend Perspective</label>
    </div>
</div>

<div id="mbcRadioList">これを行う方法がある場合は、コードビハインドで制御するためのハンドルを取得するために、リストの周りに追加しました。jQueryソリューションであれば削除できます。

前もって感謝します!

4

1 に答える 1

3

他の人が提案したように行います:

1)divをに設定しますrunat="server"

2)divをに設定しますvisible="false"

3)で、コードビハインドに、日付をチェックしてから次のように変更するステートメントを追加Page_Loadします。ifvisibletrue

aspxマークアップ:

<div id="mbcRadioList" runat="server" visible="false">
    <p style="bold">BUILD BUT HIDE UNTIL 10/13!!!<p>
    <p><strong>Want to learn more?</strong> Select a video topic to better understand the varied experiences of people living with MBC and their family and friends.</p>
    <div class="checkBoxesColumn">
        <label><input name="videoWallRadio" type="radio" id="" value="" />View All</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" checked />My MBC Journey</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Challenges</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Positive Outlooks &amp; Advice</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Giving Thanks</label>
        <label><input name="videoWallRadio" type="radio" id="" value="" />Family / Friend Perspective</label>
    </div>
</div>

コードビハインド:

protected void Page_Load(object sender, EventArgs e)
    {
        // ..... your other code

                    if(DateTime.Now >= new DateTime(2012, 10, 13) ){
                          mbcRadioList.Visible = true;
                    }
    }

他の人が提案しているように、必要に応じて、タイムゾーンを考慮に入れるようにしてください。

于 2012-09-17T16:14:52.120 に答える