473,946 Members | 9,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still confused...usin g an HTML Control to modify an HTML tag's value

I've asked this a few times and gotten answers, but I'm still missing a
piece of the puzzle.

Here's what I have:

- page.aspx
- title tag
- usercontrol.asp x
- usercontrol.asp x.vb

I'd like to change the value of the title tag from the usercontrol.asp x.vb
codebehind.

Some suggestions were to add a runat="server" as such:

<title id="pageTitle" runat="server"> my text</title>

And then declare it in the codebehind. That's where I'm stuck. What do I
declare this as?

It was also suggested that I use a title HTML Control. However, I can't seem
to find any reference to Title HTML controls specifically...

-Darrel
Nov 18 '05 #1
6 1216
Haven't tried this, but the user control's "parent" control is the page that
you wish to modify the title of. The title is a property of the page
itself, so if you can find a way to reference the page, you should be able
to just adjust the .title property.
"darrel" <no*****@hotmai l.com> wrote in message
news:ub******** ******@TK2MSFTN GP14.phx.gbl...
I've asked this a few times and gotten answers, but I'm still missing a
piece of the puzzle.

Here's what I have:

- page.aspx
- title tag
- usercontrol.asp x
- usercontrol.asp x.vb

I'd like to change the value of the title tag from the usercontrol.asp x.vb
codebehind.

Some suggestions were to add a runat="server" as such:

<title id="pageTitle" runat="server"> my text</title>

And then declare it in the codebehind. That's where I'm stuck. What do I
declare this as?

It was also suggested that I use a title HTML Control. However, I can't
seem
to find any reference to Title HTML controls specifically...

-Darrel

Nov 18 '05 #2
In the design view of the aspx page, add a "Label" control to the page. Name
it "TitleLabel " or something. Save the page. The code-behind for the page
there is a declaration , probably in the "Web Form Designer Generated Code"
section, for the label control. Move it out of the "Web Form Designer
Generated Code" section to somewhere else near the top of the class code.
Change the declaration to be similar to the following.
Public Shared WithEvents TitleLabel As System.Web.UI.W ebControls.Labe l

You should now be able to reference it by name and change the text.

I do something similar in a user-control that I use to house a
page-banner-section in which I customize the label for each page at runtime.
Nov 18 '05 #3
> In the design view of the aspx page, add a "Label" control to the page.

Ah! Duh. OK, so I'm actually going to write out the HTML via the label.
Seems obvious now. ;o)

Second question...if I do this, can I declare this label in the usercontrol
codebehind? In otherwords, the control is part of the parent page, and I
want to manipulate it via a separate userControl on this page.

-Darrel
Nov 18 '05 #4
> Haven't tried this, but the user control's "parent" control is the page
that
you wish to modify the title of. The title is a property of the page
itself, so if you can find a way to reference the page, you should be able
to just adjust the .title property.


Right...that's my question. ;o)

I was hoping I could do something like page.parent.tit le.text = "whatever"

-Darrel
Nov 18 '05 #5
You can put it in the user control if you want. If you want you can
manipulate the content of the label fromn the parent page.

"darrel" wrote:
In the design view of the aspx page, add a "Label" control to the page.


Ah! Duh. OK, so I'm actually going to write out the HTML via the label.
Seems obvious now. ;o)

Second question...if I do this, can I declare this label in the usercontrol
codebehind? In otherwords, the control is part of the parent page, and I
want to manipulate it via a separate userControl on this page.

-Darrel

Nov 18 '05 #6
> You can put it in the user control if you want. If you want you can
manipulate the content of the label fromn the parent page.


I may not have asked the question very clearly.

Can I have the Label exist on the parent.aspx page and manipulate it via the
usercontrol.asp x.vb page?

-Darrel
Nov 18 '05 #7

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

Similar topics

22
2926
by: Long | last post by:
Problem: to insert the content of a file in an HTML document at a specific location. One possible way is to add a WebCharm tag like this: <%@charm:text 20 0 my_include_file.txt %> When the HTML template is processed by a WebCharm-aware web server, the content of my_include_file.txt is inserted at the tag location. This work very much like the SSI #include tag. However, you have more control
3
2071
by: Mike Kamermans | last post by:
How do I find out from which tag I called a javascript function at runtime? I have a stack of nested custom tags, in the following structure: <tag_1 value="someval"> <tag_2>content</tag_2> <tag_3>content, javascript link to function modify()</tag_3> </tag_1> Someone suggested I use "this" as a function parameter to modify(), but
1
2281
by: Suhail A, Salman | last post by:
Dear All, I placed a HtmlSelect control on a web page and set it to "Run at Server", the objective of this HtmlSelect control is that the client adds all his accounts to a text box, and because this is a client side operation(no server intervention is required), I wrote the JavaScript below to add account number entered in a text box to the list control, this works fine, the client can
2
2075
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP (non-.Net) if I wanted to fill a list it may look something like this: -------START CODE <%
4
2816
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than one runat=server form on a asp.net page. However, I still want developers to be able to use asp.net controls to create some apps that are created on the page. So I need multiple forms on a asp.net page(doesn't everyone). I purchased the...
6
2416
by: Shashi | last post by:
I have developed ASP.Net application using .Net 1.1 Framework. When the user clicks image file through Java script I am using my search window as below. QueryString = "frmMySearchWebForm.aspx?DOBDate=" + txtDOBDt popUp =window.open(QueryString,null, "height=50,width=80,status=no,left =0,top =0,toolbar=no,menubar=no,location=no,scrollbars =yes"); When the user picks a certain customer in the frmMySearchWebForm I am
0
3733
by: Chris Fink | last post by:
My goal is to have an ASP.NET checkbox server tag with it's autopostback set to true, that when clicked will run the checkbox's CheckedChanged event. However, I would like to try to add a javascript confirm popup to this checkbox server control to prevent this event from firing if the cancel button is checked in the js confirm window. In the example below, I am able to accomplish this using the input type=checkbox but without the...
14
5818
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the SQL DATABASE, probably by the click of a button. Is this possible? & what is the BEST APPROACH for doing this? & also if any links are there do tell those to me too coz I have no idea how to go about doing it.
3
8738
by: Paul | last post by:
Hello All, I am working through the SAMS "ASP.NET 2.0 - Unleased" book to teach myself ASP.NET. It is a great book, but Chapter 21 "Using ASP.NET Membership" is causing me problems - or maybe I am just missing something. It is telling me that in order to modify user password requirements I need to add the following to the web.config file.
0
10162
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
9981
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
11566
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...
0
11153
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11338
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
10688
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7426
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.