Share tech news, updates, or what's on your mind.

Sign up to Post

Just have mvc app has esign feature and hope to add two way auth meaning the signer has to enter code to continue esign.

I use jsignature and it is working fine.

If you know any sources I can read to get start. Let me know
0
Introducing Cloud Class® training courses
LVL 12
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

I have a database called cars and had fields make and model

And I also have a pdf with two fields make and model

And I want to use itextsharp to map the fields and fields value in a loop meaning that while reading table i just want to loop all of fields. Because the table has over 200 fields when we expand. I don’t want to code the field name one by one.

And the field name on database and pdf are the same

I use mvc c#
0
I use google map and marker to display many locations on the map. However, many location like apartments 1,2,3 to 20 has the same locations and it is very hard on UI experience. Do u know anyway to resolve this map?

On each marker, I also have small detail box to show details info.

I use mvc 4 with razor engine

Thanks
0
i have static class called SendGrid.SendEmail

how can I pass this class inside of SearchEvent? The .net code alerts that it does not allow static class inside of the controller. (alert: can't use like a method).
Can you help me to fix it?
controller.cs
  [HttpPost]
            public JsonResult SearchEvent(string pickupDate, string dropoffDate, string eventId)
           {
            Domain.Event e = new Domain.Event();
            List<Domain.Fleet> getEventNameFromFleetObject = EventSingleList(eventId);
            foreach(var i in getEventNameFromFleetObject)
            {
                e.name = i.eventName;
                break;
            }            
            return Json(e, JsonRequestBehavior.AllowGet);
        }


sendgrid.cs
public static class SendGrid
    {
        public static string SendEmail(string subject, string body, string fromEmail, string toEmail)
        {
            try
            {
                MailMessage MessageInfo = new MailMessage(fromEmail, toEmail, subject, body);
                MessageInfo.Body = body;
                MessageInfo.IsBodyHtml = true;

                SmtpClient EmailClient = new SmtpClient("smtp.sendgrid.net");
                System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("", "");
                //EmailClient.UseDefaultCredentials = false;
                EmailClient.Credentials = SMTPUserInfo;
                EmailClient.Send(MessageInfo);
            }
            catch 

Open in new window

0
Hi All,
Advance thanks!
Am using VS 2017 ,MVC, C#.
My view has controls and button1. When i click button1 , show word document template with respective controls values filled in appropriate location in word doc. Can you give me some idea or links to follow to achieve this task step by step so that it is easy to follow and adapt on my solution.


Kind regards,
Pooja
0
Hi Experts,
I want to make the @Html.CountryDropDownList invisible. Please help.
Thanks in advance.

<div class="spacer-15">
        <fieldset id="fieldsetShippingAddress">

            @Html.LabelForRequired(m => Model.Company, T("Organization name").Text)
            @Html.TextBoxFor(m => Model.Company)

            @Html.LabelForRequired(m => Model.Address1, T("Address line 1").Text)
            @Html.TextBoxFor(m => Model.Address1)

            @Html.LabelForRequired(m => Model.Address2, T("Address line 2").Text)
            @Html.TextBoxFor(m => Model.Address2)

            @Html.LabelForRequired(m => Model.City, T("City").Text)
            @Html.TextBoxFor(m => Model.City)

            @Html.LabelForRequired(m => Model.State, T("State/Province").Text)
            <span class="wide-select-ie">
                @*@Html.StateDropDownList("State", Model.State, T("Select one").Text)*@
                @Html.StateDropDownList("StateId", Model.Country, Model.State, T("Select one").Text)
            </span>

            @Html.LabelForRequired(m => Model.PostalCode, T("ZIP/Postal code").Text)
            @Html.TextBoxFor(m => Model.PostalCode)
           
            @Html.LabelForRequired(m => Model.Country, T("Country"))
            @Html.CountryDropDownList("Country", Model.Country, new { onchange = "resetSelect('#State');", @class = "special-dropdown", title = T("Please specify") })
           
        </fieldset>
</div>

public static MvcHtmlString 

Open in new window

0
Hi Experts.

Have tried googling "can mvc5 coexists with razor"; but didn't find anything helpful.

So, in our MVCr project we created a folder called "Pages" and added a razor3 file called "Test.cshtml".
MVC5 project with a Razor3 page The project builds and when trying to navigate to the razor page:

resource not found
any ideas?

TIA!
0
I am developing Factory Inspection Management App based on  C# /mvc  (Web) and Xamarin (Mobile ) .  

I need Form Builder.  What options are available - free / paid ?!  

Also suggest relevent resources &  ideas (flowchart, db structure) .
0
itextsharp/c#

do you know how to get text's location just like (x, y coordinate)? for example, i have pdf with 2 pages and I want to look for text called 'esign'
if the esign is found, i want to drop the image just next to esign on the right.
0
How to fetch HTML Input Id in code behind ASP.Net MVC ? Either on Controller or on Model ?

 view / .cshtml 

<button type="submit" id="previewButton" >Preview</button>

JQuery : - This will not be in use.

$("button").click(function ()
    {
        var btn = this.id;
          alert(btn);
   }

In Controller :

[HttpPost]
        public ActionResult New(MyViewModel viewModel, string clickedButton)
        {
            
            var vm = clickedButton;
            return View(vm);
        }

- MyViewModel
 public string clickedButton { get; set; }

Open in new window

0
Making Bulk Changes to Active Directory
LVL 8
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

How to handle Required field validation in Jquery for radiobuttons in asp.net mvc?

Currently, I am handling it in the Model
view \ create.cshtml page

   
<div class="col-sm-3 checkbox-inline">
                        @Html.RadioButtonFor(model => model.IsDateChanged, 1, new { @Id = "IsDateChangedYes" })
                        <label class="hthin" for="IsDateChangedYes">Yes</label>
                        @Html.RadioButtonFor(model => model.IsDateChanged, 0, new { @Id = "IsDateChangedNo" })
                        <label class="hthin" for="IsDateChangedNo">No</label>
                        <span asp-validation-for="IsDateChanged" class="text-danger"></span>
                    </div>

Open in new window



viewmodel \ mymodel.cs

 [Required(ErrorMessage = "Required")]
        [Display(Name = "1. Have there been any changes in the date?")]
        public int? HasDateChanged { get; set; }

Open in new window

0
Hi everyone,

I have to do for static areas with Resource File.

For example Its changing menu name but I wanna change url name. How can I do.

<a href="@Url.Action(@dil.Resource.Home, "Index","Home")">@dil.Resource.Home</a>

When I click english change url for example www.sitename.com/en/aboutus 

when I click turkish change url www.sitename.com/tr/hakkimizda 

Route Config

routes.MapRoute(
  name: "Contact",
  url: "{language}/contactus",
defaults: new { language = lang, controller = "Contact", action = "Contact" }); 
 
 
      routes.MapRoute(
          name: "Default",
          url: "{language}/{controller}/{action}/{id}",
          defaults: new { controller = "Home", action = "Index", language = lang, id = UrlParameter.Optional },
          namespaces: new string[] { ".Controllers" }
 
      );

Open in new window

0
The codes below is extracted from mvc/razor view. but this is more like javascript questions.
Can you take a look the codes and tell me why sometime the total value is calculated wrong in
document.getElementById("feeTotal").value?



<div class="col-md-6">
                                <table width="100%" cellpadding="3" cellspacing="3"> 
                                    <tr style="font-weight:900;">
                                        <td>Fee Description</td>
                                        <td>Unit Price</td>
                                        <td>Qty</td>
                                        <td>Total Cost</td>
                                    </tr>
                                @{
                                    //public List<Domain.FleetFee> FleetFeeList
                                    foreach (Domain.FleetFee item in mh.FleetFeeList("9", "Active"))
                                    {    
                                           <tr>                                        
                                           <td><input type="text" style="text-align:left;font-weight:900;"   readonly id="valueFeeDescription_@item.feeId" value="@item.feeDescription"   /></td>
                                           <td><input type="text" style="text-align:right;font-weight:900;"  readonly id="valueFeeCost_@item.feeId" value="@item.cost" /></td>   
                                           <td><input type="text" 

Open in new window

0
I extract the code from mvc/razor. But this is more like js question.
Just want to know why document.getElementById("feeTotal").value SOMETIME has wrong total amount.
My goal is to get the grand total amount from the fee item (I have the item cost stored in the database so I use razor to loop it back) and I allow user to add qty.


                            <div class="col-md-6">
                                <table width="100%" cellpadding="3" cellspacing="3"> 
                                    <tr style="font-weight:900;">
                                        <td>Fee Description</td>
                                        <td>Unit Price</td>
                                        <td>Qty</td>
                                        <td>Total Cost</td>
                                    </tr>
                                @{
                                    //public List<Domain.FleetFee> FleetFeeList
                                    foreach (Domain.FleetFee item in mh.FleetFeeList("9", "Active"))
                                    {    
                                           <tr>                                        
                                           <td><input type="text" style="text-align:left;font-weight:900;"   readonly id="valueFeeDescription_@item.feeId" value="@item.feeDescription"   /></td>
                                           <td><input type="text" style="text-align:right;font-weight:900;"  readonly 

Open in new window

0
I have mvc/razor, and i just need to get "1" from url. and I do not know why the codes below do not work.
http://localhost:29792/Home/Edit/1

public ActionResult Upload()
        {
string fleetID = Request.Url.Segments.Last();
Response.Write(fleetID);
}
0
i have a very simple project to show all of the rental cars in one single company location. But the issue is I want to show all of the rental cars like 50 vehicles on the map.
However, the location is the same. How can I show them on the map? If I just use same location, the car icon will basically overlap each other.
i use c#, mvc, and razor.
0
I start with the following codes with mvc/json/c#
and I just want to know how to get the following items
Or there is easier way to get everything inside of json file. that will be great.


rating
open now
weekday text
viewport
photos height
photos html_attributions


https://developers.google.com/places/web-service/search

WebClient wc = new WebClient();
string jsonStr = wc.DownloadString("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.753,-122.443&radius=10000&type=rv_park&key=AIzaSyCietasdfasdfasdfasdfxzD65Uc19X6DgrJFumdi-nCZYSHjg");
GooglePlacesResponse gpr = (GooglePlacesResponse)JsonConvert.DeserializeObject<GooglePlacesResponse>(jsonStr);
Response.Write(gpr.status + "<br><br>");

Open in new window

0
I need to sort a foreach statement in an MVC website. I've included the code below. I would like to order the results by item.InteractionDate. I believe it is sorting by the Id rather than the InteractionDate. If you need a snippet from the model, I can add that as well.

<table class="table">
        <tr>
            <th>
                Meeting Date
            </th>
            <th>
                Customer
            </th>
            <th>
                Employee
            </th>
            <th>
                Notes
            </th>
            <th>
                Update Meeting
            </th>
        </tr>

        @foreach (var item in Model.Meetings)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.InteractionDate)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Customer1.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Employee1.FullName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Notes)
                </td>
                <td>
                    @Html.ActionLink("Edit Meeting", "Edit", "Meetings", new { id = Model.Id}, null)
                </td>
            </tr>
        }
    </table>

Open in new window

0
Hi everyone,

I am going to build one cloud based application for multiple customers / businesses, based on that i have few questions.

1) what is the best practice to handle database,  
a) One db for all customers, then what about performance?
b) or is it one db for one customer?

2) let's suppose, if there is power cut (never but due to some reason) or internet down at customer site, in this case what shall be our responsibility?

Thanks
0
Get Cisco Certified in IT Security
Get Cisco Certified in IT Security

There’s a high demand for IT security experts and network administrators who can safeguard the data that individuals, corporations, and governments rely on every day. Pursue your B.S. in Network Operations and Security and gain the credentials you need for this high-growth field.

How can i easy and securely post data entered in a desktop application (developed in visual studio) to a website (also developed with MVC) for reporting to remote user.

I have developed a desktop application and i want user to periodically post data to a website where others users can see reports.

Sincerely i don't know how to go about this.

Thank you

ANTHONY
0
Is there a good way to allow a MVC app to have a limited number of concurrent logins.  I know how to limit it to one concurrent login, but is is possible to limit it to 3 for instance.
0
https://www.c-sharpcorner.com/UploadFile/abhikumarvatsa/view-without-controller-action-in-mvc/

I followed above help,, and it works to me. However, when I try to add the codes below. it is redirected to notfoundpage which mean is not working. do you know how to fix it?

@{
    ViewBag.Title = "RV Rental Blogs List";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}
0
mvc c#, I would like to allow our external users to create webpage. and they will choose anyone of the html templates.
My question is: in mvc, we have manually created controller then add view. How can I handle it in mvc app.?

Thanks
0
I have below mvc codes and it is pretty common.
My question is: Now I want to add Shared folder called Shared, cut & paste files
from //Home/RenderEventDropDown.cshtml to //Shared/RenderEventDropDown.cshtml.
And then add new controllers called Blog and add new view called Index,
And I want to work exactly same as Home/index/.

Basically, I just want to make RenderEventDropDown.cshtml as shared page so every controller can use it.
is it possible?



@{
    ViewBag.Title = "Motorhome Rental Share";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}


@{

 //Home/Index.cshtml
 Html.RenderAction("RenderEventDropDown");
}


@model List<Domain.Event>    
@for (var i = 0; i < Model.Count; i++)
{      
//Home/RenderEventDropDown.cshtml
<option value="@Html.DisplayFor(x => x[i].id)" style="min-width:600px;">@Html.DisplayFor(x => x[i].name)
    (      
     @Html.DisplayFor(x => x[i].city),
     @Html.DisplayFor(x => x[i].state)
    )
 </option>
}


//HomeController.cs
[OutputCache(Duration = 300, VaryByParam = "none")]
        public PartialViewResult RenderEventDropDown()
        {
            return PartialView(mh.EventList());
        }
0
I am working on MVC. i Select records and clicking on print it generates MS Word document . It works fine on my local machine which has MS word installed. When i moved the code to server it gives me error. I tried installing Interop and also used Office run time dlls. It is telling me to install office. How can i generate Word document WITHOUTinstalling MS office.
0

.NET MVC

193

Solutions

211

Contributors

Top Experts In
.NET MVC
<
Monthly
>