473,785 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.te xt).

I can use the following statement to display the title.

<title>

<% = txtAcountNo.val ue %>

</title>

But the problem is if the user changes the txtAccountNo.te xt 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.te xt.

This approach may be not a good one.

Any other approach?

Thanks,

Bilal
Nov 18 '05 #1
2 1810
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.EventArg s) Handles MyBase.Load
txtAcountNo.Att ributes.Add("on blur", _
"document.title =this.value;")
End Sub

<HTML>
<HEAD>
<title>

<% = txtAcountNo.tex t %>

</title>
<meta name="GENERATOR " content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.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********@hot mail.com> wrote in message
news:OI******** ******@tk2msftn gp13.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.te xt).

I can use the following statement to display the title.

<title>

<% = txtAcountNo.val ue %>

</title>

But the problem is if the user changes the txtAccountNo.te xt 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.te xt.

This approach may be not a good one.

Any other approach?

Thanks,

Bilal


Nov 18 '05 #2
"Bilal Dhavan" <Bi********@hot mail.com> wrote in message news:<OI******* *******@tk2msft ngp13.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.te xt).

I can use the following statement to display the title.

<title>

<% = txtAcountNo.val ue %>

</title>

But the problem is if the user changes the txtAccountNo.te xt 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.te xt.

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("t xtAccountNo").v alue
- Add a server-side event, ServerChange, for txtAccountNo then add
this snippet:

Response.write( "<script>docume nt.title=docume nt.all("txtAcco untNo").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
4604
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 reading all of the reference document. With this is mind, I need a way to display text in a title attribute, dynamically. I don't like the idea of going through 100+ pages and making the changes every time a load new images. Is it possible to...
1
1581
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 a b c T2 d e f
8
3970
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
1592
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
3618
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 using syntax like: <TITLE id="objTitle" runat="server" /> However, this works for a while, but VS.NET always eventually removes the runat attribute, and my code bombs. One reason might be that it isn't included in the <form> tag?? Can the...
14
3487
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>..... I want to completely seperate the code from presentation. I would like to do the same thing for a value of a hidden form field but
2
1173
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 = myArrayList.ToString(); However, after compiling the page few times runat="server" disappears and my page doesn't compile. When this happens this is what code
6
1878
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 defined in our content and an emty one defined by the page directive. Can anyone help??
6
2290
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 doing below, and it works fine. For some reason it's not pulling in the fields. Any ideas? Here's the link to the actual page I'm working on. http://www.roomfulexpress.com/newsite/php/familyprofile.php?FAMILY_CD=558167959 Please see below...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.