Solved

MVC4  if statemtnt to dialog box

Posted on 2014-01-30
2
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

630 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