Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,689 members, 7,837,536 topics. Date: Thursday, 23 May 2024 at 06:45 AM

How Do I Implement A Contact Page In ASP.NET/C#? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How Do I Implement A Contact Page In ASP.NET/C#? (862 Views)

.net C# Software Developer (junior And Experienced Level) / Any Asp.net C# Programmer Here? / Learn Vb.net, C# And Python Programming, Website ,web Development And Networking (2) (3) (4)

(1) (Reply) (Go Down)

How Do I Implement A Contact Page In ASP.NET/C#? by Simpath(m): 2:09pm On Apr 10, 2019
Hello Programmers,

I have problem that seems like easy.

I want to implement a contact us page in ASP.NET, whereby when a user visits the page and fills the form, the details provided will be used to send email to me on info@mydomain.com.

I have ransacked the whole of Google, hoping this is easily solved, but to no avail. What I seem to be getting is when I want to send email to others.

If you have ever achieved this on your contact page, kindly share your code (ASP.NET & C#), let me see how it works.

Thanks.

- Simpa
Re: How Do I Implement A Contact Page In ASP.NET/C#? by talk2hb1(m): 3:02pm On Apr 10, 2019
If you are following the mvc way just create a Controller that caters for static pages like the About, Contact, and the About pages.
Else use Page Razor.
Re: How Do I Implement A Contact Page In ASP.NET/C#? by kudaisi(m): 3:32pm On Apr 10, 2019
If this is for MVC core, simply create a model, say for example

public class ContactViewModel
{
[Reguired]
public string Name { get; set; }
[Required]
public string Email { get; set; }
public string Phone { get; set; }
[Required]
public string Message { get; set; }
}


Then simply create migrations/scaffolding from this to create the database, controller and view without having to writing additional code
Re: How Do I Implement A Contact Page In ASP.NET/C#? by Simpath(m): 11:32am On Apr 11, 2019
Thanks all for the replies. I'm neither using MVC nor core. Am using the normal ASP.NET form/webpage.

(1) (Reply)

Code Week Ibadan 2019 / Programming Languages To Learn In 2019 And Hack As A Pro / I Need School Management Script (TSS V7. 1)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.