The quick start guides you through the steps of adding a simple popover (Popup with owner element) control to your application. Such popup control is similar to a rich tooltip which will show or hide as per the actions specified by ShowTrigger and HideTrigger. For information on how to add ASP.NET MVC Edition controls, see Adding Controls.
Follow the given steps to get started:
Create a new MVC application using the ComponentOne or VisualStudio templates. For more information about creating an MVC application, see Configuring your MVC Application topic.
Add a new Controller:
Default1Controller
).Add a View for the controller:
DefaultController
) to open it.Index()
.Index.cshtml
to open it.Index.cshtml
file with the code given below to initialize a Popup control.
Razor |
Copy Code
|
---|---|
@using C1.Web.Mvc @Styles.Render("~/Content/css/bootstrap/css/bootstrap.css") <style> .btn { height: auto; } .popover { display: block; } .tab-content > .tab-pane { display: block; } </style> <!-- The contents of popup controls. --> <div class="popover" id="popup"> <h3 class="popover-title"> Title </h3> <div class="popover-content "> <form name="popoverForm"> <p>Hello Popup<br>This is a multiline message!</p> <pre>2 + 3 = <span class="">5</span></pre> <div class="form-group"> <div class="input-group"> <div class="input-group-addon">@@</div> <input class="form-control" type="email" placeholder="Enter email"> </div> </div> <div class="form-actions"> <button type="button" class="btn btn-danger wj-hide">Close</button> <button type="button" class="btn btn-primary wj-hide">Save changes</button> </div> </form> </div> </div> <br /> <!-- The popup owners. --> <button id="btn" type="button" class="btn btn-default"> Click to show Popup form <br> <small>(ShowTrigger=Click, HideTrigger=None)</small> </button> @* Create popup controls with HtmlHelper *@ @(Html.C1().Popup("#popup").Owner("#btn").ShowTrigger(PopupTrigger.Click).HideTrigger(PopupTrigger.None)) |