|
WHEN I AM GOING TO INSTALL ANY SOFTWARE THEN THIS ERROR MESSAGE GIVE:
THE SERVICE DID NOT RESPOND TO THE START OR CONTROL REQUEST IN A TIMLY FASION
|
|
|
|
|
Good day friends! Am having problem with my asp.net project. I have two buttons on the web page. One save to “Temp Files” and the other save to “UploadedImgs”. Saving to the “Temp Files” folder do not raise any exception but saving to the “UploadedImgs” folder causes an exception which says “Could not find a part of the path 'D:\ASP.Net Practical\Website\Site1\ UploadedImgs \'.” To me, the path is 100% correct. So please, does anyone has solution to this problem? Any help will be appreciated.
Below is the code am using.
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim imgext As String = Path.GetExtension(FileUpload1.PostedFile.FileName) 'get image extension
Dim Imgname As String = Path.GetFileName(FileUpload1.PostedFile.FileName) 'get image name
Dim imgpath As String = "\ASP.Net Practical\Website\Site1\ UploadedImgs \" 'get local disk folder path
FileUpload1.PostedFile.SaveAs(Server.MapPath(imgpath + Imgname + imgext))
End Sub
|
|
|
|
|
Clean the save filename first, remove or strip invalid chars, then build the path based on a virtual path, not a physical path. The path will then be converted to a physical path with the Drive letter and all.
Dim fileName as String = Clean_FileName(avatarName.ToLower() + oFileExt)
Dim path as string = Path.Combine(Server.MapPath("~/Images/avatars/customers"), fileName)
Public Shared Function Clean_FileName(ByVal strIn As String) As String
' Replace invalid characters with empty strings.
Try
Return Regex.Replace(strIn, "[^\w.@-_]", "", RegexOptions.None, TimeSpan.FromSeconds(1.5))
Catch As RegexMatchTimeoutException
Return String.Empty
End Try
End Function
|
|
|
|
|
Solved: Thanks. I found the solution after so many trials. I think I should share this so that anyone with such problem could resolve it with ease. The problems was from my webpage submitting an empty filename because of the page load event. So, the solution to this problem is ensure that the uploaded filename is intact before calling the SaveAs command.
Once again, thanks for your reply.
Cheers!
|
|
|
|
|
Well yes that's a good idea.
But the way your mapping out the path may backfire on you when you publish your web app for production use.
Uploading files of anything requires good knowledge of how it works. There about 5 ways to do it to my knowledge.
I don't use the file name of the file anymore, for now I assign my own name to the file. Later on down the road, as users keep uploading the same file with different names, you will have gigs of files sitting in the folder, and the project size will radically expand in size over the course of time. Then what? That's another topic for discussion.
|
|
|
|
|
Anybody please suggest how to set the DataTable Width in dot net.
|
|
|
|
|
What DataTable are you talking about? Have you checked the documentation for class properties?
|
|
|
|
|
DataTable does not have a width, DataTable Properties (System.Data)[^], since it does not have a UI component.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi All,
I am writing my AngularJS - js file as below and using ng-repeat as well as below, but when I add or remove item into the list angularJS is not refreshing it automatically on View, am I missing something, it is happening on IE but on Chrome its refreshing the list automatically. Am I missing something or do I need to explicitly refresh the list etc to show the most updated list on IE, I have to use only IE at my work - please any help is appreciated thank you.
Here is my View
<body><br />
<div data-ng-app="myApp" data-ng-controller="userController">
<table style="border:none 0px gray;">
<tr>
<td>
<table style="border:solid 1px gray;">
<tr>
<td style="border:solid 1px gray;">User Id</td>
<td style="border:solid 1px gray;">User Name</td><br />
</tr>
<tr data-ng-repeat="usr in users">
<td><a href="/User/UpdateUser/{{usr.UserId}}"> {{usr.UserId}} </a> </td>
<td><a href="/User/UpdateUser/{{usr.UserId}}">{{usr.UserName}}</a></td><br />
</tr>
</table>
<pre>
</td>
<td>
<a href="http://www.codeproject.com/Members/html">@Html</a>.ActionLink("Create User", "CreateUser")
</td>
</tr>
</table>
</body>
And here is my script
var myApp = angular.module('myApp', []);
myApp.controller('userController', ['$scope', '$http', function ($scope, $http) {
$scope.users = "";
$http.get("/User/GetUsers")
.success(function (result) {
$scope.users = result;
})
.error(function (result) {
console.log(result);
});
}]);
Here is my Controller Action method, when an item is added to the list, it will call the Idex method which calls this AngularJS function but some how the function is not getting called and the update on the View is not showing up, please help me.
public ActionResult CreateUser()
{<br />
return View();
}
[HttpPost]
public ActionResult CreateUser(FormCollection collection)
{
try
{
string Id = Request.Form["UserId"];
string UserName = Request.Form["UserName"];
int UserId;
var dbContext = new MVCDBContext();
User user = new User();
user.UserId = (int.TryParse(Id, out UserId) ? UserId : 0);
user.UserName = UserName;
dbContext.Users.Add(user);
dbContext.SaveChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}
Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
modified 31-Jul-16 5:00am.
|
|
|
|
|
If it's working in Chrome, but not in IE, then it's an IE compatibility issue.
Which version of IE are you using? And which version of AngularJS?
According to this document[^], v1.3+ support IE9+. They automatically run tests against IE9, IE10 and IE11, so it should work in those versions, with a few caveats which are listed in that document.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Its IE 11 I think it should work without issues.
And my AngularJS version is: AngularJS v1.5.5
Is it a problem?
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
According to the Angular site, that should be fine.
Can you reproduce the problem in a simple JSFiddle[^]?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sorry the problem is its not one form and the problem not happening when I call first time, it happens when I insert into Database by using "Create Form" and redirect to the List page using "Action method", whatever is inserted in to Database using Action method should reflect in the List page when its loaded.
First time yes AngularJS is bringing all data I think maybe second time IE is just getting values from Cache rather than calling the method to get values from database.
Is there anyway to escape from this behavior of IE.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Yes, caching sounds like the culprit.
There are various options to disable caching. You can either change the server code to override the caching headers; or configure the caching headers in IIS; or change the Angular configuration[^] to prevent it from caching responses to AJAX requests.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Use ng-href instead.
<td><a ng-href="/User/UpdateUser/{{usr.UserId}}"> {{usr.UserId}} </a> </td>
<td><a ng-href="/User/UpdateUser/{{usr.UserId}}">{{usr.UserName}}</a></td>
See: https://docs.angularjs.org/api/ng/directive/ngHref[^]
Also:
<a href="http://www.codeproject.com/Members/html">@Html</a>.ActionLink("Create User", "CreateUser")
Not sure if this happened when you pasted it in, but that's pretty broken.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Yes
"@Html.ActionLink("Create User", "CreateUser")"
This happened why I posted.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
How can I print from web application in asp.net mvc ? Please check "PrintFromWebApplication" document. pdf PrintFromWebApplication [PDF/274KB] http://download.brother.com/pub/com/dev/pdf/bpac_webapplication_eng.pdf
|
|
|
|
|
No. What exactly is your question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
i want build print in client ...using asp.net mvc .thanks
|
|
|
|
|
mvc runs on the server, you can't create client software with it. You need to focus on a technology that will deliver what you want.
|
|
|
|
|
How to create CRUD operation using WebService and call it in mvc4
pls reffer the related tutorials and your valuable guidance..
|
|
|
|
|
sunil3 wrote: pls reffer the related tutorials You can try Web Development[^] or a general search through Google.
|
|
|
|
|
I have 1 image as background and other as main image, now i need to do drag main image and drop on background image and save combined image using mvc.net 5.0
|
|
|
|
|
Better start writing some code then, you're going to need a lot of it 
|
|
|
|
|
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
at System.Collections.Generic.Dictionary`2.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains(TKey item)
at DotNetAgent.Trackers.ComponentCountInfo.RecordExternalComponent(String componentName)
at DotNetAgent.Trackers.DefaultTracker.Finish()
at DotNetAgent.Trackers.db.DbCommandTracker.Finish()
at DotNetAgent.Trackers.DefaultTracker.Exit()
at DotNetAgent.Sequences.Sequence.FinishTracker(ITracker tracker, IAgent agent)
at DotNetAgent.Instrumenter.Factories.Web.CallHandlerExecutionStepTrackerFactory.FinishTracker(Object dummy)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously
|
|
|
|