Solved

MVC4  if statemtnt to dialog box

Posted on 2014-01-30
2
305 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
Comment Utility
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
Comment Utility
nicely done
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now