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
Redefining Cyber Security w/ AI & Machine Learning
LVL 1
Redefining Cyber Security w/ AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Join our webinar on Sept. 21st to learn more about leveraging AI and machine learning to protect your business.

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.

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
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 Ultimate Tool Kit for Technolgy Solution Provi
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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 mvc app with one index.cshtml and one layout.cshtml.

On index.cshtml I have for loop to call the model and get information like address and etc. It works fine.
However, I want to get information like address and etc. into javascript on layout cshtml., and I don know what to do.
Basically, the end goal is to add fleet icons on the google map.

on the javascript codes, you just have to focus on this below:
    [locationData('listings-single-page.html', 'http://localhost:29792/images/listing-item-01.jpg', 'Tom Restaurant', '964 School Street, New York', '3.5', '12'), '40.94401669296697', '-74.16938781738281', '1', '<i class="im im-icon-Chef-Hat"></i>'],

I try to drop the list of fleet information into javascript.

and I do not know how to do that.

Thanks



@model List<Domain.Fleet>     
@Html.AntiForgeryToken()
@for (var i = 0; i < Model.Count; i++)
{
 @Html.DisplayFor(x => x[i].data) //try to drop the data from addresss to long/latitude to javascript like below
        
[locationData('listings-single-page.html', 'http://localhost:29792/images/listing-item-01.jpg', 'Tom Restaurant', '964 School Street, New York', '3.5', '12'), '40.94401669296697', '-74.16938781738281', '1', '<i class="im im-icon-Chef-Hat"></i>'],
           

<div id="map" data-map-zoom="9" data-map-scroll="true">
<!-- map goes here -->
</div>
}

Open in new window


_layoutpage.cshtml
<script type="text/javascript">
        // Default infoBox Rating Type
        var 

Open in new window

0
I have mvc project with one layout cshtml with some js codes. My goal is to take the parameter (viewbag) value to js file on layout.cshtml.
I try the codes below and "test" does not shown any value when I open the browser >> view source

Do you know how to fix it?

Thanks,


layout.cshtml
<script>

  var test = @ViewBag.showMe
  var locations =
                    [
                 test
                     [locationData('listings-single-page.html', 'http://localhost:29792/images/listing-item-01.jpg', "Tom's Restaurant", '964 School Street, New York', '3.5', '12'), 40.94401669296697, -74.16938781738281, 1, '<i class="im im-icon-Chef-Hat"></i>'],
                     [locationData('listings-single-page.html', 'http://localhost:29792/images/listing-item-02.jpg', 'Sticky Band', 'Bishop Avenue, New York', '5.0', '23'), 40.77055783505125, -74.26002502441406, 2, '<i class="im im-icon-Electric-Guitar"></i>'],
                     [locationData('listings-single-page.html', 'http://localhost:29792/images/listing-item-03.jpg', 'Hotel Govendor', '778 Country Street, New York', '2.0', '17'), 40.7427837, -73.11445617675781, 3, '<i class="im im-icon-Home-2"></i>'],
                     ];  
</script>


Home
Controller:
  public ActionResult Index()
        {
             ViewBag.showMe = " [locationData('listings-single-page.html', 'http://localhost:29792/images/listing-item-01.jpg', "Tom's Restaurant", '964 School Street, New York', '3.5', '12'), 40.94401669296697, …
0
We have an MVC app with a significant amount of javascript code.  We have found a number of our users' browsers are not refreshing Javascript files when they change and are updated on our IIS server.  We have needed to CTRL+R to force a refresh on these browsers.  

How can we address this?
0
In one of the module of our project there are multiple related objects. Here are few of them and the relationships
  • Project
  • Discussions (Related to project. A project must have at least one discussion, 1-M relation)
  • Surveys (Each discussion can have multiple Surveys. Surveys can be added later on, 0-M relation)
  • Questions (Surveys can have questions One survey must have at least one question, 1-M relation)
  • Expected Attendees (A project can have expected attendees, 0-M relation)
There are some other objects as well related to this scenario which I did not included here. In the time of creating a new project entire data needs to be saved in one go. Later on user may add other elements (discussion, surveys etc.) in an existing record.

In Data layer and business layer I created classes for each and every objects (Project, Discussion, Surveys, Question and Attendee). Since in the time of creating a new project few of actions (Survay save, Expected Attendee save etc.) are optional so we are thinking of Decorator pattern to save a project.

Now I have two questions

Should we implement decorator pattern? Or is there any other pattern which address this situation better?
We have to implement the patter in business logic layer. In that case how can I implement transaction? This is a key problem when we are trying to implement any design pattern.
0
I have mvc app that using bundle to generate CDN. Everything in localhost / development environment is working fine.
But when I publish to azure environment and debug using firewall. it alerts all CDN is missing.

Can you tech me what I need to do to avoid this issue occurred...?

Thanks

public class BundleConfig
    {
        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));

            //bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
            //            "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                      "~/Scripts/bootstrap.js",
                      "~/Scripts/respond.js"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                      //"~/Content/bootstrap.css",
                      "~/Content/site.css"));
        }
    }

Open in new window

0
Below codes working but for some reasons it supposes to return 6 records from the ms sql database.but it ends up return 1 record only.
Can you help me to fix it?

Thanks
public ActionResult Index()
        {
return View(EventFleetList());
}
public List<Domain.Fleet> EventFleetList()
        {
            Domain.Fleet f = new Domain.Fleet();
            List<Domain.Fleet> fleetList = null;
            using (SqlConnection connection = new SqlConnection(connectionString))
            using (SqlCommand command = new SqlCommand("",connection))
            {
                connection.Open();
                command.CommandText = "SELECT * FROM Fleet";
                SqlDataReader reader = command.ExecuteReader();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        string id= reader["FleetID"].ToString();
                        fleetList = new List<Domain.Fleet>()
                        {
                                new Domain.Fleet
                                {
                                    id =1,
                                    make = id + " Make",
                                    model = id + " Model"
                                },                                
                        };
                    }
                }
             }
            return fleetList;
        }             



//mvc razor
@model List<Domain.Fleet>  

Open in new window

0
Creating Active Directory Users from a Text File
LVL 8
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

We have a cloud web application developed in .net MVC c#.now I'm starting​ integrate with sage 50 desktop application. Sage 50 provide an SDK for integration. We have to pass data like create invoice,from my web application. So how to do this process? Which is the best solution? Which technology we use here? Web service and things are recommend from sage support team.but how to use this?

Please advise for this,access desktop application from web.
0
I am developing a C# .net MVC page to allow users to make some selection, query data and display the data with paging function.
I use a partial view for the data display but fail to maintain the main view and the data after click on different page.

Please advise me, have attached the code as below (Index.cshtml, SearchController.cs, WebGrids.cshtml)

Index.cshtml
______________

@model DLTWeb.Models.SearchModel

@{
    ViewBag.Title = "Index";    
}

<header>
    <script src="~/Scripts/jquery-3.0.0.js"></script>
    <script src="~/Scripts/jquery-3.0.0.min.js"></script>
    <script src="~/Scripts/jquery-ui-1.8.24.min.js"></script>  
    <script src="~/Scripts/gridmvc.min.js"> </script>
    <link href="@Url.Content("~/Content/style.css")" rel="stylesheet" type="text/css" />  
    <link href="@Url.Content("~/Content/PagedList.css")" rel="stylesheet" type="text/css" />
</header>

<h2><font color="blue">@Html.Label("lblReport", "DLT Web Report")</font></h2>

<br />

<table>
    <tr>
        <td>Report Name</td>
        <td>@Html.DropDownListFor(m => m.ReportName, (IEnumerable<SelectListItem>)ViewBag.ListReport, "---------------Select Report----------------", new { @id = "ddlReport", @onchange = "javascript:GetFields(this.value);" })</td>        
    </tr>
    <tr>
        <td>Fields Name</td>
        <td>
            <select id="ddlFields" name="ddlFields">
                <option>---Select Fields---</option>
            </select>
        …
0
I have new using mvc, and I have the following sql statement that will loop for 40 records.
how to make the codes reflect on razor?

    public ActionResult Index()
        {
            Domain.Fleet f= new Domain.Fleet
            {
                //SELECT COUNT(FleetInEvent.FleetID)AS totalCountFleet, WebsiteSetting.EventName FROM FleetInEvent INNER JOIN
                //WebsiteSetting ON FleetInEvent.Domain = WebsiteSetting.Domain GROUP BY WebsiteSetting.EventName ORDER BY WebsiteSetting.EventName
                id = 1,
                totalFleetCount = 200
            };
            return View(f);
        }
0
I have been developing with ASP.NET web forms for years and had decided to learn MVC and Entity Framework model as I am becoming irrelevant in skill set. But in discussions with some of my peers they indicated I should start with ASP.NET Core Razor environment. Since I have had limited exposure to both, I need suggestions on where to get started, kind of like a step one learn this, step two learn that. I am kind of at a loss of where to begin as it all looks so foreign to what I am used to.
0
I have the codes below
1. RetrieveData is working fine., but now I want to assign class library value in a loop.
Basically, I have wcf call to get the list of name which is exactly same as class library property name - see newretrievedata
Is it possible to do that?

On another side of class library in c#, i already have all of the property/object in class library.


     
  public JsonResult RetrieveData(string ID)
        {
            Domain.Lead l = new Domain.Lead();
            l.firstname = "John";
            l.lastname = "Smith";
            return Json(l, JsonRequestBehavior.AllowGet);
        }

 
        public JsonResult newRetrieveData(string ID)
        {
            Domain.Lead l = new Domain.Lead();


            foreach (KeyValuePair<string, string> i in Helper.DynamicsCRM.GetAllLeadInfoByMetaData3("a51ec467-7255-e811-81153863bb3c4538"))
            {               
                //Response.Write(i.Key + " >> " + i.Value + "<br>"); Key has firstname, and lastname, etc.
            	l.i.Key = i.Value;
            }
            return Json(l, JsonRequestBehavior.AllowGet);
        }

Open in new window

0
I am currently experiencing something strange with one of my routes' responses and haven't been able to find any information elsewhere.

So, let's say I make a call to a route in my controller with JQuery, like this. It's a POST action and I expect JSON data.

// Send the data
            $.ajax({
                type: "POST",
                enctype: 'multipart/form-data', //'application/json',  
                url: "/Claims/Application/SaveCurrentFormData",
                data: data,
                dataType: 'json', // we're expecting back a json
                processData: false,
                contentType: 'application/json',
                cache: false,
                timeout: 600000,
                success: function (result) {                      
                    for (var formCode in result.forms) {
                        var selector = "[data-formcode='" + formCode + "']";
                        $(selector + " [name='TicketDocumentId']").val(result.forms[formCode]);
                    }

                    for (var documentName in result.documents) {
                        var selector = "input[name='" + documentName + "']";
                        $(selector).data("ticketdocumentid", result.documents[documentName]);
                    }

                    resolve(true);
                },
                error: function (e) {
                    // Debug
                    console.log("Error saving form data: ", e.message, e);

        

Open in new window

0

.NET MVC

191

Solutions

209

Contributors

Top Experts In
.NET MVC
<
Monthly
>