Solved

MVC4  if statemtnt to dialog box

Posted on 2014-01-30
2
311 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

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 …
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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