473,399 Members | 4,192 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,399 software developers and data experts.

Title Bar.. Dynamic Data

I am using ASP.Net with .Net Framework 1.1.

I want to display account number in the windows title bar. The data that I
am going to display will be from server side control (txtAcountNo.text).

I can use the following statement to display the title.

<title>

<% = txtAcountNo.value %>

</title>

But the problem is if the user changes the txtAccountNo.text value while
working with the program it is not getting reflected in the title bar.
Programming point, I am resubmitting the page to change txtAccountNo.text.

This approach may be not a good one.

Any other approach?

Thanks,

Bilal
Nov 18 '05 #1
2 1796
Hi Bilal,

How about using some JavaScript to change the title dynamically?

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
txtAcountNo.Attributes.Add("onblur", _
"document.title=this.value;")
End Sub

<HTML>
<HEAD>
<title>

<% = txtAcountNo.text %>

</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<P>
<asp:TextBox id="txtAcountNo" runat="server"></asp:TextBox></P>
<P>
<asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
</form>
</body>
</HTML>

"Bilal Dhavan" <Bi********@hotmail.com> wrote in message
news:OI**************@tk2msftngp13.phx.gbl...
I am using ASP.Net with .Net Framework 1.1.

I want to display account number in the windows title bar. The data that I
am going to display will be from server side control (txtAcountNo.text).

I can use the following statement to display the title.

<title>

<% = txtAcountNo.value %>

</title>

But the problem is if the user changes the txtAccountNo.text value while
working with the program it is not getting reflected in the title bar.
Programming point, I am resubmitting the page to change txtAccountNo.text.

This approach may be not a good one.

Any other approach?

Thanks,

Bilal


Nov 18 '05 #2
"Bilal Dhavan" <Bi********@hotmail.com> wrote in message news:<OI**************@tk2msftngp13.phx.gbl>...
I am using ASP.Net with .Net Framework 1.1.

I want to display account number in the windows title bar. The data that I
am going to display will be from server side control (txtAcountNo.text).

I can use the following statement to display the title.

<title>

<% = txtAcountNo.value %>

</title>

But the problem is if the user changes the txtAccountNo.text value while
working with the program it is not getting reflected in the title bar.
Programming point, I am resubmitting the page to change txtAccountNo.text.

This approach may be not a good one.

Any other approach?

Thanks,

Bilal


Greeting Billal,

This is what it should happen since you are not adding any handler
when user changes value in textbox.

Two solutions:

-Add a javascript handler. Choose an event for txtAccountNo from the
event menu , one could be onblur, then add this snippet code:

document.title=document.all("txtAccountNo").value
- Add a server-side event, ServerChange, for txtAccountNo then add
this snippet:

Response.write("<script>document.title=document.al l("txtAccountNo").value
</script>")

Then place html control to enable a server trip so the code above can
be executed.

TTH,
Adel A. Al-saleh
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Del Ferguson | last post by:
Group, New to this list. I just found out that FireFox does not display the img alt attribute the same way IE does. I use both browsers to verify that my pages are readable. Dumb me for not...
1
by: zlf | last post by:
Hi all, I need to show a matrix in DataGrid. So both column title and row title need to be set. I wonder how to set row title in DataGrid? Thanks zlf E.G: Task/Product P1 P2 P3 T1 ...
8
by: DC | last post by:
In HTML page, I put: <html> <head> <title>Article: <asp:Label ID="lblHTMLTitle"></asp:Label> </title> .... In the code behind: ....
5
by: Carlo Marchesoni | last post by:
Is it possible to change the document's title property from code behind (c#) ? I need to build a dynamic title at runtime.
5
by: Mark | last post by:
I'm interested in displaying a dynamic page title, rather than the static html <title>My Page</title>. In a previous posting, I had seen a suggestion of making the title into a server control...
14
by: Paul | last post by:
I want to set the page title and/or a form hidden field programatically through ASP.Net. I do not want to use something like... <% sTitle ="My Title" %> <html><title><%=sTitle%></title>..... ...
2
by: niju | last post by:
Hi there, I am dynamically populating title for my web page. Here is the code <title id="titleLabel" runat="server"></title> Code behind ----------- titleLabel.InnerText = ...
6
by: Rippo | last post by:
Is it possible to turn off the title tag in the page directive when using master pages? We have got meta data and title defined in a content control and are ending up with 2 title tags, one...
6
by: RoomfulExpress | last post by:
Here's the problem that I'm having- I'm trying to pull in 2 fields from my database and place them in the title of the HTML. I'm connecting to the db and selecting everything exactly the same as I am...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.