Url.Action("Details", "Product", new { id = p.ProductID}, Request.Url.Scheme)
If without id, simply use null in the parameter.
Url.Action("Details", "Product", null, Request.Url.Scheme)
Dim shell, minutes, minuteCount
minutes = 300
Set shell = CreateObject("WScript.Shell")
minuteCount = 0
For minuteCount = 0 To minutes
shell.SendKeys "{ESC}"
minuteCount = minuteCount + 1
WScript.Sleep(60000)
Next
<system.web>
<customErrors mode="On" redirectMode="ResponseRedirect" >
<error statusCode="400" redirect="~/CustomError/BadRequest"/>
<error statusCode="401" redirect="~/CustomError/Unauthorized" />
<error statusCode="404" redirect="~/CustomError/NotFound" />
<error statusCode="403" redirect="~/CustomError/Forbidden"/>
<error statusCode="500" redirect="~/CustomError/InternalServerError"/>
</customErrors>
</system.web>
However, the above may not allow our custom error pages to handle certain cases.<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="400" />
<remove statusCode="401" />
<remove statusCode="403" />
<remove statusCode="404" />
<remove statusCode="500" />
<error statusCode="400" path="/MyApp/CustomError/BadRequest" responseMode="ExecuteURL"/>
<error statusCode="401" path="/MyApp/CustomError/Unauthorized" responseMode="ExecuteURL"/>
<error statusCode="403" path="/MyApp/CustomError/Forbidden" responseMode="ExecuteURL"/>
<error statusCode="404" path="/MyApp/CustomError/NotFound" responseMode="ExecuteURL"/>
<error statusCode="500" path="/MyApp/CustomError/InternalServerError" responseMode="ExecuteURL"/>
</httpErrors>
</system.webServer>
public class CustomErrorController : Controller
{
public ActionResult BadRequest()
{
Response.StatusCode = 400;
ViewBag.ErrorCode = "400";
ViewBag.ErrorTitle = "400 Error - Bad Request";
ViewBag.ErrorMessage =
"The resource you tried to access appears to be incomplete.\n" +
"Please check your URL and try again.";
return View("Error");
}
public ActionResult Unauthorized()
{
Response.StatusCode = 401;
ViewBag.ErrorCode = "401";
ViewBag.ErrorTitle = "401 Error - Unauthorized";
ViewBag.ErrorMessage =
"The resource you tried to access appears to require a user permission.\n" +
"Please re-launch the browser and try again.";
return View("Error");
}
public ActionResult Forbidden()
{
Response.StatusCode = 403;
ViewBag.ErrorCode = "403";
ViewBag.ErrorTitle = "403 Error - Forbidden: Access is denied";
ViewBag.ErrorMessage =
"The resource you tried to access is not allowed. \n" +
"Please check your URL and try again.";
return View("Error");
}
public ActionResult NotFound()
{
Response.StatusCode = 404;
ViewBag.ErrorCode = "404";
ViewBag.ErrorTitle = "404 Error - Resource Not Found";
ViewBag.ErrorMessage =
"The resource you tried to access was not found.\n" +
"Please check your URL and try again.";
return View("Error");
}
public ActionResult InternalServerError()
{
Response.StatusCode = 500;
ViewBag.ErrorCode = "500";
ViewBag.ErrorTitle = "500 Error - Internal Server Error";
ViewBag.ErrorMessage =
"An error occurred while system tried to process your request.\n" +
"Try again, and if problem persists contact system administrator.";
return View("Error");
}
}
@{
ViewBag.Title = ViewBag.Title;
}
<div style="text-align: center;">
<div style="font-size: 10em; color:#ccc; font-weight: bold; ">
@ViewBag.ErrorCode
</div>
<h2>
@ViewBag.ErrorTitle
</h2>
<h3 style="white-space: pre-wrap; word-wrap: break-word;">@ViewBag.ErrorMessage</h3>
<h4>
<a href="javascript:void(0);" onclick="javascript: history.go(-1);">Back</a>
</h4>
</div>
<table style="table-layout: fixed">
<tbody>
<tr>
<td>Some Links</td>
<td style="white-space: pre-wrap; word-wrap: break-word">
...
</td>
</tr>
</tbody>
</table>
<table style="width: 400px; border: 1px solid white; color: white">
<tbody>
<tr>
<td style="width: 100px; border: 1px solid white; vertical-align: top; ">Some Links</td>
<td style="border: 1px solid white;" >Link Example:
https://www.google.com/maps/@33.7338729,-117.8530829,3a,75y,304h,90t/data=!3m7!1e1!3m5!1suAg9o6LKzX3</td">
</tr>
</tbody>
</table>
| Some Links | Link Example: https://www.google.com/maps/@33.7338729,-117.8530829,3a,75y,304h,90t/data=!3m7!1e1!3m5!1suAg9o6LKzX3 |
<table style="width: 400px; border: 1px solid white; color: white; table-layout: fixed;">
<tbody>
<tr>
<td style="width: 100px; border: 1px solid white; vertical-align: top; ">Some Links</td>
<td style="border: 1px solid white;
white-space: pre-wrap; word-wrap: break-word;" >Link Example:
https://www.google.com/maps/@33.7338729,-117.8530829,3a,75y,304h,90t/data=!3m7!1e1!3m5!1suAg9o6LKzX3</td>
</tr>
</tbody>
</table>
| Some Links | Link Example: https://www.google.com/maps/@33.7338729,-117.8530829,3a,75y,304h,90t/data=!3m7!1e1!3m5!1suAg9o6LKzX3 |
$path = "C:\pre" Start-Process "E:\PrerequisiteInstaller.exe" –ArgumentList "/SQLNCli:$Path\sqlncli.msi /IDFX:$Path\Windows6.1-KB974405-x64.msu /IDFX11:$Path\MicrosoftIdentityExtensions-64.msi /Sync:$Path\Synchronization.msi /AppFabric:$Path\ WindowsServerAppFabricSetup_x64.exe /KB2671763:$Path\AppFabric1.1-RTM-KB2671763-x64-ENU.exe /MSIPCClient:$Path\setup_msipc_x64.msi /WCFDataServices:$Path\WcfDataServices.exe /WCFDataServices56:$Path\WcfDataServices56.exe"
C:\Pre\WindowsServerAppFabricSetup_x64.exe /i CacheClient,CachingService,CacheAdmin /gac