|
|
 This is the Index view:
@model application.Models.NewFolder1.StudentsCodes
@{
ViewBag.Title = "Development";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<link href="∼/Content/bootstrap.css" rel="stylesheet" />
<link href="∼/Content/bootstrap-theme.css" rel="stylesheet" />
<script type="text/javascript" src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script type="text/javascript" src="~/Scripts/jquery-3.1.1.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
</head>
<body>
<div class="navbar navbar-inverse " style="left:0; width:300px;bottom:3px; position:fixed; top:50px; color:#4e4a4a; font:bold;">
<ul class="nav nav-pills nav-stacked">
<li>
@Model.Student.UserName
<ul>
<li>
CompilerProject
<ul>
@{
var m = Directory.GetDirectories(Server.MapPath("~/Content/" + Model.Student.UserName + "/CompilerProject"));
foreach (var subdir in m)
{
var name = Path.GetFileName(subdir);
<li>
@name
<ul id="tree">
@foreach (var file in Directory.GetFiles(Server.MapPath("~/Content/" + Model.Student.UserName + "/CompilerProject/" + name)))
{
var filename = Path.GetFileName(file);
<li class="filelist" value="@("~/Content/" + Model.Student.UserName + "/CompilerProject/src/" + filename)">
@filename
</li>
}
</ul>
</li>
}
}
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div id="partial">
@{
Html.RenderAction("DevelopmentPartial", new { path1 = Model.path});
}
</div>
<script>
$(document).ready(function () {
$('.filelist').on('click', function (e) {
alert('Im clicked on filePath = ' + $(this).attr('value'));
var filePath = $(this).attr('value');
$('#partial').load('DevelopmentPartial', { path1: filePath });
});
});
</script>
</body>
</html>
|
|
|
|
|
Are you sure this is a partial view ? It looks like you have a full html there
|
|
|
|
|
I need to refresh this part only of the page when the user clicks on a list element, so I used partial view.
This is my first website, I'm not sure if I'm doing things right.
|
|
|
|
|
This is the part I need to refresh:
Capture.JPG - Google Drive[^]
It's an online IDE, I want the user to be able to display the contents of a file once he clicks on its name.
|
|
|
|
|
well, I don't know what happened now! The error is gone but still, if I access the "Index" directly all it's functionalities work, if I redirect from another action method, nothing works!
|
|
|
|
|
I solved it by reordering the scripts in the header of the main view
<meta name="viewport" content="width=device-width" />
<link href="∼/Content/bootstrap.css" rel="stylesheet" />
<link href="∼/Content/bootstrap-theme.css" rel="stylesheet" />
<script type="text/javascript" src="~/Scripts/jquery-3.1.1.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
:
Then I updated the script that loads the partial view:
<pre> <script type="text/javascript">
$(document).ready(function () {
$('.filelist').on('click', function (e) {
e.preventDefault();
alert('Im clicked on filePath = ' + $(this).attr('value'));
var filePath = $(this).attr('value');
$('#partial').load('@Url.Action("DevelopmentPartial", "Development")', { path1: filePath });
});
});
</script>
|
|
|
|
|
Are you saying that it is all working fine?
|
|
|
|
|
I still have a small problem with the drop-down menu doesn't show its list always, but I don't think it's relevant. So, yes I think it's all working fine.
|
|
|
|
|
|
Hello all
i am using telerik control in my ASP.NET MVC project, in the image control in the radEditor i cannot upload more than 4M image, so how i can upload image size more than 4M?
Please help
Thank you
|
|
|
|
|
|
All I am trying to open a new Angular 2.0 Project, I don't why did they make it so complex.
I selected File menu -> new Project -> C# -> then Asp.Net Core Angular 2 Starter Application (.Net Core), then I am getting the following error
The imported project C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props was not found. Confirm that the path in the <import> declaration is correct, and that the file exists on disk. C:\Users\aaleem01\Desktop\Angular2Apps\MyAngular2App\MyAngular2App\MyAngular2App.xproj
Can anybody please help me in fixing this issue, it is not even opening the solution saying error in creating the project. Any help is going to be very helpful.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
|
I downloaded it and restarted VS and restarted machine as well, but errors are persistent.
I am getting this following error:
Build:No inputs were found in config file 'C:/Users/aaleem01/Desktop/Angular2Apps/BSCSecurityAddressBookWeb/BSCSecurityAddressBookWeb/node_modules/angular2/es6/dev/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["node_modules","bower_components","jspm_packages","../../dist/js/cjs"]'. BSCSecurityAddressBookWeb C:\Users\aaleem01\Desktop\Angular2Apps\BSCSecurityAddressBookWeb\BSCSecurityAddressBookWeb\tsc
Generic type 'Promise<t, r="">' requires 2 type argument(s)
I just don't what are those errors what's the reason for their occurrence, I would love to correct if I know why do they come.
Specially this error: Generic type 'Promise<t, r="">' requires 2 type argument(s) is appearing 675 times.
Getting tired, if my environment is not properly set Angular 2.0 team should give us strict dos and don'ts to avoid problems.
Any help would be very helpful. First of all there are so many things to download along with Angular 2.0 which leading to version mismatch easily, if they can give us all their related softwares along with their downloads would help or at least if they can give us strict notes what to have or what not to, it would be great helpful.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Hi,
End point (HttpPost) calls a different web request by URL from the call.
It uses HttpWebRequest.GetRequestStream(...). Sometimes URL of HttpWebRequest is not available and it terminates by HttpWebRequest time out (100 sec by default) and HTTP queue can be filled up.
How can I fix it?
|
|
|
|
|
Assuming you're using a relatively recent version of WebAPI, make the handler async and use the HttpClient class[^] instead of HttpWebRequest .
By using async and await , you won't be blocking the request thread waiting for a response from the remote server. It will be free to return to the pool and service more requests.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for your answer.
I tried to use PostAsJsonAsync of httpClient. The same story. On localhost: ASP:NET-Request Current=3, CurrentQueueSize=4 (MAX = 10). I don't know how can I handle a bad URL ...
And ... PostAsJsonAsync doesn't exit at all.
|
|
|
|
|
To get the PostAsJsonAsync method, you'll need to add a reference to the System.Net.Http.Formatting NuGet package[^].
And if you haven't got the method, I don't see how you could have tested it yet.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I can call the method ( response = await httpClient.PostAsJsonAsync(ud.Url, byteData) ) but it doesn't return any data, just hangs.
I'm using my API like a proxy.
modified 22-Mar-17 11:54am.
|
|
|
|
|
Well, if the URL isn't valid, it's still going to take just as long to time out.
The difference is, you're not blocking a thread from the request queue while you're waiting. Using an async endpoint, you should be able to keep serving other requests without the queue filling up.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
You are right. But I can see that I can't call more than 10 requests (for limited queue = 10). I don't know why but IIS can start just 3 requests at one time (with the func). (Please note that URL is not valid. I don't know how I can handle it)
Additional info: Overall Elapsed: 0:01:24.132
modified 22-Mar-17 12:19pm.
|
|
|
|
|
Are you running this on your local workstation?
If I recall correctly, IIS Express and the full IIS version that ships with "client" versions of Windows are deliberately limited to a maximum of 10 concurrent requests. When you deploy to a proper server version of Windows, that limit should go away.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
I have a webgrid that I need to export the data to excel, that part I done in code:
@{
Layout = null;
Response.AddHeader("Content-disposition", "attachment; filename=report.xls");
Response.ContentType = "application/octet-stream";
}
Question is how do I format the columns so that:
1. I click on a row and only that row is exported to an ms excel spreadsheet,
2. The first four columns are read-only, next three is where user input data,
3. And the gridline are displayed.
How do I do or is there website example or tutorial?
|
|
|
|