Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus bios bsod crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop mac malware memory monitor motherboard network operating system printer problem ram registry router security slow software sound svchost.exe trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Enquiry Form ASP.NET 3.5 C#

Reply  
Thread Tools
marques_uk's Avatar
Member with 77 posts.
 
Join Date: Jun 2009
Experience: Intermediate
13-Nov-2009, 10:18 AM #1
Solved: Enquiry Form ASP.NET 3.5 C#
Hello everyone,

I've put together an enquiry form in ASP.NET 3.5 in C#, and it works perfectly fine. I now want to provide the users with feedback saying that their message has been sent and also provide the details they have just entered. Such as Name, Email and Message

At the moment I have simply got 'Message Sent' as feedback. This is done by putting the following code in the codebehind page.

protected void btnSend_Click(object sender, EventArgs e)
{
lblMessage.Visible = true;
}

and this in the main aspx page

<asp:Label ID="lblMessage" runat="server" Text="Message Sent" Visible="false"></asp:Label>

I want to do something similar for the other fields:-
Name = the filed name is txtName
Email = the field name is txtEmail
Message = the field name is txtMessage

This is how I want it to look on the page after the user has submitted their form.

Message sent on '13/11/09 14:10'

Name: Joe Bloggs
Email: joe@bloggs.com
Message: I would like to do this.

Can this be done using the variables? I'm fairly new to ASP.NET so still learning. If anyone who is more advanced could help that would be brilliant.

Thanks in advance
Mark
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,637 posts.
 
Join Date: Oct 2006
13-Nov-2009, 05:33 PM #2
Not sure if I follow, you mean something like:

Response.Write("Text:" + txtName.Text);
marques_uk's Avatar
Member with 77 posts.
 
Join Date: Jun 2009
Experience: Intermediate
15-Nov-2009, 02:36 PM #3
Hi MMJ, thanks for your help, yeah its something like that but I need to put that in my label some how, so when my enquiry is sent it gives the user the feedback.

I just tried this, but no luck

<asp:Label ID="lblName" runat="server" Text="Name" + Response.Write(txtName.Text) Visible="false"></asp:Label>

Thanks once again
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,637 posts.
 
Join Date: Oct 2006
15-Nov-2009, 11:09 PM #4
protected void btnSend_Click(object sender, EventArgs e)
{
lblName.Text= "Name:" + txtName.Text;
}

I'm not sure exactly how you want it but that should help.
marques_uk's Avatar
Member with 77 posts.
 
Join Date: Jun 2009
Experience: Intermediate
16-Nov-2009, 07:24 AM #5
Thats exactly what I wanted. I thought it was something like that but just couldn't get it right.

Thanks for your help MMJ.
Reply

Tags
asp.net, c #, enquiry, feedback, form

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:13 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.