Click here to Skip to main content
15,917,642 members

Comments by Jahangir Khan (Top 27 by date)

Jahangir Khan 7-Apr-14 2:52am View    
Hello Raul, This is one of the other technical mystery’s, give me a bad headache, I do have IIS installed and working on my local machine, the folder with all the files exist on my desktop and the same is uploaded to an ftp server. Now call it dumb, but I don’t see or understand how on earth this app will work on in real life. Mind you I have an account on azure website and there things are so simple, from visual studio you make a profile and haaps bob's your uncle , in a minute your app is uploaded to the azure website and running, now when this comes down to putting it for the org i established, and using there ftp server when I upload, it also uploads, but hell I can’t make it run or work.. can you please explain instead of giving me external links. I have been looking up Google for many day and it just increases my frustration.
Jahangir Khan 6-Apr-14 4:32am View    
then what happens ??? I have tried I go to my we browser, an I still cant figur out what to look for can you elaborate please ?
What shell I look for Globel aspx or where is the excuteable file which should show my website
Jahangir Khan 28-Mar-14 13:24pm View    
Yes but I am not happy because its not working exectly as I want, I can see the subjectI mean the body, but I can not see that its comeing from a user, who has put in his email, I can see the display mail which should be users, an it says To and thats also mine, so you get my point
Jahangir Khan 27-Mar-14 5:48am View    
Deleted
While my code for HTTPPost is like this:

[HttpPost]
public ActionResult KontaktForm(KontaktModel model)
{
if (ModelState.IsValid)
{
WebMail.SmtpServer = "smtp.one.com";
WebMail.Send(
"feedback[at]mycompany.domain",
model.Navn,
model.Email,
model.Kommentar
);
InsertKontakt(model.Navn, model.Email, model.Kommentar);
TempData["notice"] = "Tak for din henvendelse, din besked er blevet modtaget.";
return RedirectToAction("SvarKontakt", "Home");
}
return View();
}

I am getting an Exception this time when trying to run it :
An exception of type 'System.FormatException' occurred in System.dll but was not handled in user code

Additional information: The specified string is not in the form required for an e-mail address.
By stepping in I get this :
An exception of type 'System.ArgumentException' occurred in System.dll but was not handled in user code

Additional information: The parameter 'addresses' cannot be an empty string.
while the webmail.send rows are populated from the input, there is nothing empty ??? strange
Jahangir Khan 26-Mar-14 16:53pm View    
Deleted
OK, now the final satuiation is this I have tried every thing as shown above code snippets, nothing works !!!
The satuiation is that my Controller looks like this :
{
public class KontaktController : Controller
{
[HttpGet]
public ActionResult KontaktForm(string Navn, string Email, string Kommentar)
{
return View();
}

[HttpPost]
public ActionResult KontaktForm(KontaktModel model)
{
if (ModelState.IsValid)
{
InsertKontakt(model.Navn, model.Email, model.Kommentar);
TempData["notice"] = "Tak for din henvendelse, din besked er blevet modtaget.";
return RedirectToAction("SvarKontakt", "Home");
}
return View();
}

private void InsertKontakt(string p1,string p2,string p3)
{

}

}
}
and my view is like this !!!
@using(Html.BeginForm(FormMethod.Post))
{
<div> @Html.LabelFor(Model => Model.Navn)</div>
<div> @Html.TextBoxFor(Model => Model.Navn)</div>
<div> @Html.ValidationMessageFor(Model => Model.Navn)</div>

<div> @Html.LabelFor(Model => Model.Email)</div>
<div> @Html.TextBoxFor(Model => Model.Email)</div>
<div> @Html.ValidationMessageFor(Model => Model.Email)</div>

<div> @Html.LabelFor(Model => Model.Kommentar)</div>
<div> @Html.TextAreaFor(Model => Model.Kommentar) </div>
<div> @Html.ValidationMessageFor(Model => Model.Kommentar)</div>

<button type="submit">Send</button>

}

Result is when I input name, email and comments and push send I get the result page thanks your message is recived. on the face of it every this is the way it shuld be , but where did the data with comments name and email of the user go, that I dont know and to get that sorted I probably need a method or a pram or something so I get this data from the form either by e-mail or in a database ect.