1. The tab sequence in a asp form is not working properly. The page is
a login form and tabindex is set to 0 for username, 1 for passwd and 2
for the submit button but after tabbing from username, the focus jumps
back to the url address bar.
Can you post your code so we can try it? Your tabindices look right and ought
to work.
2. I'm trying to format strings displayed through response.write, e.g.
how to make the string bold or centered in page, or make the color
green etc. As a workaround I'm using label controls.
A quick solution is the following
use response.write("<b>" & "text" & "</b>") for bold
use response.write("<center>" & "text" & "</center>") to center
use response.write("<font color=green>" & "text" & "</font>") to make the
color green
But these are not the best ways to do this. If you got some more time dig
into a technique called CSS = Cascading Style Sheets.
3. May be this is related to the above question. I'm writing the
contents of an array into a multiline textbox, row by row, and
depending on a condition, I want to highlight that row, e.g. if name =
"Michael", highlight, else just write it in the textbox. how to
highlight?
You need a listbox for that, not a textbox. Below is some code that will
give you an idea how to proceed. The code was made with asp.net v2 so maybe
you have to make some changes.
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub ListBox1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
Dim thing As ListItem
For Each thing In ListBox1.Items
If thing.Value.Contains("a") Then
thing.Selected = True
End If
Next
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource1"
DataTextField="CategoryName"
DataValueField="CategoryName" OnDataBound="ListBox1_DataBound"
SelectionMode="Multiple">
</asp:ListBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:NorthwindConnectionString1 %>"
SelectCommand="SELECT [CategoryName] FROM [Alphabetical list
of products]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
Let me know if you have any more questions..
Cheers,
Tom Pester