9 Replies - 496 Views - Last Post: 17 April 2018 - 08:59 AM

#1 SteveHi   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 07-June 15

Personalising thank you

Posted 16 April 2018 - 09:41 PM

Hello

My Web page here My link generates a thank you message to the user when the form fields have been completed and the Send button pressed:

<asp:Panel ID="pnlThankYouMessage" runat="server" CssClass="panel" Visible="False">

Thank you. Your message has been sent.

</asp:Panel>


Since the user has to type in his name in the form's name field, how can I personalise that message, please - without redirecting the user to another Web page - so that the message reads 'Thank you + name +. Your message has been sent'

Regards

Is This A Good Question/Topic? 0
  • +

Replies To: Personalising thank you

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14929
  • View blog
  • Posts: 59,613
  • Joined: 12-June 08

Re: Personalising thank you

Posted 17 April 2018 - 06:45 AM

From the event code you should be able to call the control's id ".show" or ".visible".
Was This Post Helpful? 0
  • +
  • -

#3 SteveHi   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 07-June 15

Re: Personalising thank you

Posted 17 April 2018 - 07:11 AM

Thanks, Modi123_1

Yes, in my code, I have this:

  pnlFormFields.Visible = False
        pnlThankYouMessage.Visible = True

    End Sub


but all that does is show me this:

Posted Image

It does not personalise it.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14929
  • View blog
  • Posts: 59,613
  • Joined: 12-June 08

Re: Personalising thank you

Posted 17 April 2018 - 07:12 AM

Ah.. ok.. well I would put the text in a label and then you can access the label's ".text" property to edit/augment as needed.. Say adding in a specific name.
Was This Post Helpful? 0
  • +
  • -

#5 SteveHi   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 07-June 15

Re: Personalising thank you

Posted 17 April 2018 - 07:21 AM

Quote

Say adding in a specific name


That would have to be a variable since I cannot know the name of the online user.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14929
  • View blog
  • Posts: 59,613
  • Joined: 12-June 08

Re: Personalising thank you

Posted 17 April 2018 - 07:53 AM

... but you said they were entering it, right? Into a textbox. Makes sense when they click 'save' (or what ever) you would have that information to append to the label control.
Was This Post Helpful? 0
  • +
  • -

#7 SteveHi   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 07-June 15

Re: Personalising thank you

Posted 17 April 2018 - 08:46 AM

My SMTP code at the top looks like this:

 Dim myMessage As New MailMessage
        Dim Smtpserver As New SmtpClient

        Dim user_name As String = Request.Form("user_name")
        Dim user_email As String = Request.Form("user_email")
        Dim user_subject As String = Request.Form("user_subject")
        Dim user_message As String = Request.Form("user_message")


so I would need to be able to use the variable "user_name" which has the following form field:

   <asp:TextBox ID="user_name" runat="server" CssClass="textbox" Placeholder="Name" required="required"></asp:TextBox>


in the 'thank you message' I think QueryString may be required, but I am unsure how to code it.

Thanks again.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14929
  • View blog
  • Posts: 59,613
  • Joined: 12-June 08

Re: Personalising thank you

Posted 17 April 2018 - 08:47 AM

I don't understand where that fits in what you were explaining.
Was This Post Helpful? 0
  • +
  • -

#9 SteveHi   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 07-June 15

Re: Personalising thank you

Posted 17 April 2018 - 08:50 AM

As I understand it, the code needs to extract the name from the user - the name typed in the form field by the user - and then display that same name on-screen as in 'Thank you, Paul'.
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14929
  • View blog
  • Posts: 59,613
  • Joined: 12-June 08

Re: Personalising thank you

Posted 17 April 2018 - 08:59 AM

Yes.. I get what your first post is about, but I don't get that random snippet of code in post #7.

You have your .NET webform, right? It has textboxes, and an 'enter' button.
User fills in info.
User clicks 'submit'.

In that submit event you should have access to textbox id, label ids, etc. You should be able to append one to the other. Heck you should be able to save the textbox value to a session value and then append it to the label again on postback if you want.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1