15,917,642 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
Jahangir Khan
26-Mar-14 10:18am
View
Deleted
If you check above I have shown my controller class, do you think the Value is there
Jahangir Khan
26-Mar-14 5:33am
View
Deleted
yes but every thing works, I mean what I am not getting is the input from the user, name email comments, on the site you see every thing working in harmony !
Please try this link "http://somaliskdanskforening.azurewebsites.net/kontakt" now you can go in and send comments an you get a responce that you message is sent, but the other end where I am sitting or the person who will be receveing info gets nothing.
Now I am tryig this in my controller :
private void InsertKontakt(string Navn, string Email, string Kommentar)
{
try
{
WebMail.SmtpServer = "my.smtp.server";
WebMail.Send(
"feedback[at]mycompany.domain",
Navn,
Email,
Kommentar
);
return RedirectToAction("FeedbackSent");
}
catch (Exception ex)
{
ViewData.ModelState.AddModelError("_FORM", ex.ToString());
}
return View();
}
}
Jahangir Khan
26-Mar-14 4:22am
View
this is my controller class :
public class KontaktController : Controller
{
[HttpGet]
public ActionResult KontaktForm()
{
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)
{
}
}
Jahangir Khan
26-Mar-14 3:39am
View
Deleted
@using(Html.BeginForm("http://www.mysite.com/cgi-bin/FormMail.pl", "Post")
correct ?
Jahangir Khan
26-Mar-14 3:04am
View
You are absloutely right the code is like this ! Sorry the language is Danish, but one can get an idea what is it :
@using(Html.BeginForm())
{
<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>
}
should I do this after curly
@Html.HiddenFor(m => m.Kommentar, new { Value = "SvarKontakt" })
@ BeginRouteForm(s:http://www.mysite.com/cgi-bin/FormMail.pl)
if you be so kind to advise me about the placeing of the "action" part, where I will recevie the input info from user,I will be ever so greatfull
Jahangir Khan
25-Mar-14 16:37pm
View
I am looking for solution regarding this in the normal old html form
<FORM method="post" action="http://www.mysite.com/cgi-bin/FormMail.pl">
<input type="hidden" name="recipient" value="webmaster@mysite.com">
<input type="hidden" name="subject" value="From Communication Page">
<input type="hidden" name="redirect" value="http://www.mysite.com/communication.htm">
how do I implment this in MVC
Jahangir Khan
17-Mar-14 10:33am
View
Now after building I am getting these
1. Error 2 Assembly 'System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' c:\Users\JG\Documents\Visual Studio 2013\Projects\TrailApp\packages\Microsoft.AspNet.Mvc.5.1.1\lib\net45\System.Web.Mvc.dll TrailApp
2. Warning 1 Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. TrailApp
Jahangir Khan
17-Mar-14 5:57am
View
Thank you Richard, but now I am totaly confused and baffeled, I know have t pull my self togather, but kindly assit me where should I start step by step
Jahangir Khan
13-Mar-14 10:03am
View
Deleted
Hello SL I am sorry I have tried my best but there is no result , no errors in build or any thing but nothing in dispaly of the page
Jahangir Khan
13-Mar-14 8:53am
View
Deleted
Thank you I have read and tried to impliment it, the Clander.cshtml has this code
<!DOCTYPE html>
<html>
<head>
<link href='"~/fullcalendar/fullcalendar.css' rel='stylesheet' />
<link href='"~/fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='"~/lib/jquery.min.js'></script>
<script src='"~/lib/jquery-ui.custom.min.js'></script>
<script src="~/Scripts/fullcalendar.min.js"></script>
<script>
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
events: [
{
title: 'All Day Event',
start: new Date(y, m, 1)
},
{
title: 'Long Event',
start: new Date(y, m, d - 5),
end: new Date(y, m, d - 2)
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d - 3, 16, 0),
allDay: false
},
{
id: 999,
title: 'Repeating Event',
start: new Date(y, m, d + 4, 16, 0),
allDay: false
},
{
title: 'Meeting',
start: new Date(y, m, d, 10, 30),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, d, 12, 0),
end: new Date(y, m, d, 14, 0),
allDay: false
},
{
title: 'Birthday Party',
start: new Date(y, m, d + 1, 19, 0),
end: new Date(y, m, d + 1, 22, 30),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 28),
end: new Date(y, m, 29),
url: 'http://google.com/'
}
]
});
});
</script>
<style>
body {
margin-top: 40px;
text-align: center;
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#calendar {
width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id='calendar'></div>
</body>
</html>
I have doubel checked the javascript locations and references thay are also ok I dont get anything displayed in the page, it comes up empty, plus I see a wavey blue line under head which shows a message that " Element 'head' must include element title at least 1 time(s)"
Jahangir Khan
13-Mar-14 5:43am
View
Deleted
Sir, Thank you very much for you kind attention, I have downloaded the said proudect, now there are three folders in the main "fullcalender folder" -> demos -> fullcalender ->lib ! do I simple need to copy them into my project ? if so where ? Do I need to add some code to the center claender page ? Sorry for asking so many questions, but want to understand it well
Jahangir Khan
13-Mar-14 4:49am
View
Deleted
Yes Sir just checked in the project it uses jquery !!!
Jahangir Khan
9-Mar-14 13:16pm
View
Yes Sir found it and fixed it , Thanks for assistence
Jahangir Khan
4-Mar-14 9:08am
View
Deleted
Ok Thank you ever so much , here is what I have done up til now, I have two text boxes and two buttons, with prett standard names my approch is like this :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AccessLogin
{
public partial class LogIn : Form
{
public LogIn()
{
InitializeComponent();
}
OleDbConnection connect = new OleDbConnection();
private void btnOk_Click(object sender, EventArgs e)
{
connect.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\XX\Documents\Visual Studio 2013\Projects\Access\Database.accdb;Persist Security Info=False";
string UserName = txtUserName.Text;
string PassWord = txtPassWord.Text;
connect.Open();
OleDbCommand cmd = new OleDbCommand("SELECT UserName, PassWord FROM TAdminPW WHERE");
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
So now I think I am makeing connection and I need the logic where I should see that the entered user name and pass word exists in the DB if so the I can have access to the main program.
Thanks in advance for your assistence
Jahangir Khan
1-Mar-14 16:21pm
View
Fine , I have done that, it's good my second and last question is about the update part, the code is looking like this:
private void btnUpdate_Click(object sender, EventArgs e)
{
Person oldPerson = new Person();
Person newPerson = new Person();
Person oldMobile = new Person();
Person newMobile = new Person();
Person oldEmail = new Person();
Person newEmail = new Person();
Person oldTwitter = new Person();
Person newTwitter = new Person();
Person oldAddress = new Person();
Person newAddress = new Person();
oldPerson = cmbPersons.SelectedItem as Person;
//newPerson.FirstName = txtFirstName.Text;
newPerson.FirstName = txtNewFirstName.Text;
//newPerson.LastName = txtLastName.Text;
newPerson.LastName = txtNewLastName.Text;
newPerson.Mobile1 = int.Parse(txtMobile.Text);
newPerson.Mobile1 = int.Parse (txtNewMobile.Text);
newPerson.Email1 = txtEmail.Text;
newPerson.Email1 = txtNewEmail.Text;
newPerson.Twitter1 = txtTwitter.Text;
newPerson.Twitter1 = txtNyTwit.Text;
newPerson.Address1 = txtAdr.Text;
newPerson.Address1 = txtNadr.Text;
b.Update(oldPerson, newPerson, oldMobile, newMobile, oldEmail, newEmail, oldTwitter, newTwitter, oldAddress, newAddress);
}
Mind you I still get error in the Mobil part, an exception error "Additional information: Input string was not in a correct format."
Jahangir Khan
1-Mar-14 11:50am
View
Guys Thank you I have colabarated the solutions and I do got the result I wanted BUT not data is getting recorded in Access DataBase !!!
private void btnInsert_Click(object sender, EventArgs e)
{
Person p = new Person();
int eCount = 0;
if (txtFirstName.Text != "")
p.FirstName = txtFirstName.Text;
else
errorProvider1.SetError(txtFirstName, "Please enter the FirstName");
eCount++;
if (txtLastName.Text != "")
p.LastName = txtLastName.Text;
else
errorProvider1.SetError(txtLastName, "Please enter the LastName");
eCount++;
if (txtMobile.Text != "")
p.Mobile1 = (Int32.Parse(txtMobile.Text));
else
errorProvider1.SetError(txtMobile, "Please enter the Mobile nr.");
eCount++;
if (txtEmail.Text != "")
p.Email1 = txtEmail.Text;
else
errorProvider1.SetError(txtEmail, "Please enter the Email");
eCount++;
if (txtTwitter.Text != "")
p.Twitter1 = txtTwitter.Text;
else
errorProvider1.SetError(txtTwitter, "Please enter the TwitterID");
eCount++;
if (txtAdr.Text != "")
p.Address1 = txtAdr.Text;
else
errorProvider1.SetError(txtAdr, "Please enter the Address");
eCount++;
if (eCount == 0)
b.Insert(p);
}
this is how it looks like, But its not recording any Data in the DataBase !!!
Jahangir Khan
1-Mar-14 8:05am
View
Deleted
So now my code looks like this, I have achived the validation part, in deatil : when user pushes Insert button the littel red exclaimation marks appear on the end of all the text boxes, showing that the fields should require data. This is good at leaste this is what I wanted, but when I look at the database the empty records ( the rows ) are recorded dispite of validation warning. and the mobile nummber is Now not getting recorded, there is a 0 in that row.
<pre lang="cs">private void btnInsert_Click(object sender, EventArgs e)
{
Person p = new Person();
p.FirstName = txtFirstName.Text;
if (txtFirstName.Text == "")
{
errorProvider1.SetError(txtFirstName, "Please enter the FirstName");
}
p.LastName = txtLastName.Text;
if (txtLastName.Text == "")
{
errorProvider1.SetError(txtLastName, "Please enter the LastName");
}
int Mobile1;
if (!int.TryParse(txtMobile.Text, out Mobile1))
{
errorProvider1.SetError(txtMobile, "Please enter the Mobile nr.");
}
p.Email1 = txtEmail.Text;
if (txtEmail.Text == "")
{
errorProvider1.SetError(txtEmail, "Please enter the Email");
}
p.Twitter1 = txtTwitter.Text;
if (txtTwitter.Text == "")
{
errorProvider1.SetError(txtTwitter, "Please enter the TwitterID");
}
p.Address1 = txtAdr.Text;
if (txtAdr.Text == "")
{
errorProvider1.SetError(txtAdr, "Please enter the Address");
}
b.Insert(p);
}</pre>
what shell I do in this satiuation ?
Jahangir Khan
1-Mar-14 5:23am
View
Deleted
You assumed rigth my friend ! have a look
p.Mobile1 = int.Parse(txtMobile.Text);
if (txtMobile.Text == "")
{
errorProvider1.SetError(txtFirstName, "Please enter the Mobile nr.");
}
so now what you have suggested, I did not get grasp of it could you elabarate on this issue please.
Jahangir Khan
26-Feb-14 7:40am
View
Ok I am getting red wavey lines under MessageBox, it say Message Box does not exit in the current context ? any ideas
Jahangir Khan
26-Feb-14 6:16am
View
and still I have add something in the buttoun part also ???
Jahangir Khan
21-Feb-14 6:14am
View
Thank you ever so much OG as I wrote to another I am posting the same, it's indeed very knid of you to explain that, and I will be honest I did had a slight idea about that, and of course your comment has made it a bit more clear, but I assume that you might have seen the link, as you have been so kind to use your valueable time to read my question, if you do take a look at the short video where this programmer is building this solution, I have done exect (ditto) of what he is doing, but ironic thing is that his is working and mine is not, so question was did I miss something there ?
Jahangir Khan
21-Feb-14 6:11am
View
Thank you ever so much Ziee-M it's indeed very knid of you to explain that, and I will be honest I did had a slight idea about that, and of course your comment has made it a bit more clear, but I assume that you might have seen the link, as you have been so kind to use your valueable time to read my question, if you do take a look at the short video where this programmer is building this solution, I have done exect (ditto) of what he is doing, but ironic thing is that his is working and mine is not, so question was did I miss something there ?
Show More