473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

SMTP form errors

Hello

I am getting 2 red underlines in this portion of code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim robots As String

robots = Request.Form("robots")

If robots <> "" Then

Response.Write("No spambots here!")
Else
'Process the form...
End If

LblDate.Text = ReturnDate()

user_name.Focus()

Dim robots As String

I have a label called

Expand|Select|Wrap|Line Numbers
  1.  <asp:Label ID = "LblDate" runat="server" CssClass="dateStyle" Text="Label"></asp:Label>
in my aspx page.

user_name (the name of my TextBox) is not declared. What would I declare user_name as, please, because Focus() is not a member of String?

Thank you
Dec 5 '17 #1
2 1681
Frinavale
9,735 Expert Mod 8TB
Consider using a redirect for your first condition.

Response.Write will insert the text you have into some point in the HTML which typically generates invalid HTML.

For example, it could (and likely would) insert your message into the HTML above the opening <html> tag for your page.

As for the Focus problem: please remember that VB.NET code is executed on the server and "focusing" on a field is something that needs to be done by the web browser after the HTML for the element is rendered in the web browser.

You will likely need to implement some JavaScript to focus on the input element (the text box) that you want to focus on.
Dec 5 '17 #2
Thank you for your attentive replies.

I will go through what you have said and post back soon.
Dec 5 '17 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Brad Esclavon | last post by:
I have a page that people (without technical knowledge) can upload and change news web links (via the php script) dynamically. It has worked fine on our other server, but this week we changed...
2
by: PinkBishop | last post by:
Hello All, Hope you can help. Below is the code I use to send data from form to database. Problem is if an apostrophe is entered in cQuestion field or any field for that matter the form...
0
by: Rob R. Ainscough | last post by:
Does ANYONE have a clue on how to setup .NET 2.0 EMail capabilities. I got it working locally (dev environment) using authentication, but as soon as I deploy my web app, I start getting SMTP relay...
4
ak1dnar
by: ak1dnar | last post by:
Hi, I have created a PHP page that write down form data to mySQL table. Before i submit data I want to check the Input field, whether it has filled up or Not. the form should validate from the PHP...
32
by: Don Lancaster | last post by:
In an existing, tested and working program, I have a form entry that simplifies to... <INPUT name ="fp1s" type="text" value=0.000 size=12 > and a button of... <input type="button" value="...
0
by: shurlandmoore | last post by:
I recently used HttpContext.RewritePath in my global.asx page in asp.net 4.0. The url rewrite worked fine but the was a caveat, when i try to submit the form i got error 404. I realized that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.