Solved

MVC4  if statemtnt to dialog box

Posted on 2014-01-30
2
309 Views
Last Modified: 2014-07-30
Please help
  I have an "Else" Statement in C# that I want to add a link that " when clicked" calls  my dialog box.  I tried looking online for help but could not find any. I am sure it is easy but I cant find the answer.
  I have attached my code  and would appreciate any help I can get.
                  Please Help
30Jan14.txt
0
Comment
Question by:vcurtis
2 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 39824484
Seems like something like the following should do it.

@if (Model.MeasureVersionDate != DateTime.MinValue)
{
    @Model.MeasureVersionDate.ToShortDateString();
}
else
{
    <a href="#" id="selectDate" name="selectDate">Click here to select a date</a>
} 

$(function() {
    $('#selectDate').click(function(){   
        $( "#timeret" ).dialog({
            height: 140,
            modal: true
        });
    });
});

Open in new window

0
 

Author Comment

by:vcurtis
ID: 40230203
nicely done
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question