Finally !!!!
Need to declare function on initComplete event. And use search function.
Datatable version 1.11.
Finally !!!!
Need to declare function on initComplete event. And use search function.
Datatable version 1.11.
I want to access object attributes with child objects dynamically just by specifying the attribute in a string variable.
$book->category->name
Result : null
Solution :
Result : book category name
I've got a situation where the git client is not allowed to be installed on the production server (due to strict user policies) but I still want to use git without having to install the git client.
Finally, I found a solution using docker. (For this test I used Docker Desktop on Windows 11).
To clone a repository, just use the instructions below.
docker run -ti -v e:\repo\project1:/git alpine/git clone https://gitlab.com/test/project1.git ./
Need to map the volume (on my windows folder) to /git (in docker) and clone the repository to the current folder (./).
Then, git started cloning the repository.
To pull changes :
docker run -ti --rm -v e:\repo\project1:/git alpine/git pull
I want to use slug in ASP.NET MVC application. The URL should be something like this
Here are the steps required to do so:
1. Defined the route (startup.cs)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Slug",
"{slug}",
new { controller = "Home", action = "ScholarInfoDetails" }
);
2. Create SlugToIdAttribute.cs class
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
///
/// Summary description for SlugToIdAttribute
///
public class SlugToIdAttribute : ActionFilterAttribute
{
private ApplicationDbContext db = new ApplicationDbContext();
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var slug = filterContext.RouteData.Values["slug"] as string;
if (slug != null)
{
var model=db.Banks.Where(x => x.Code == slug).First();
if (model != null) {
filterContext.ActionParameters["id"] = model.id.ToString();
}
}
base.OnActionExecuting(filterContext);
}
}
3. Use in the controller. Add annotation [SlugToId]
[AllowAnonymous]
[SlugToId]
public ActionResult ScholarInfoDetails(String id)
{
var r = new ContentResult();
r.Content = "Hello World " + id.ToString();
return r;
}
Now the function can be access using slug. E.g http://localhost:58128/ABMB. Result will be something like this :Hello World 2