Solved

TextBox rendered as <h1> tag

Posted on 2011-03-23
8
562 Views
Last Modified: 2012-05-11
How can I make a textbox to be rendered in the html file as <h1> tag?

I have this detailsview template and I have tried to put the textbox inside the <h1> tag, but in the html file the <h1> tag is not included...

<EditItemTemplate>
            <h1>
                 <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Car_Category") %>'></asp:TextBox>
             </h1>
           </EditItemTemplate>

Open in new window

0
Comment
Question by:evo_x
  • 3
  • 3
  • 2
8 Comments
 
LVL 5

Expert Comment

by:karthitron
ID: 35204561
Textbox style will not get updated by placing it between the <h1> tag. <h1> tag will update the style of the innerText and not innerHTML. So, placing a textbox inside a <h1> will not work.

So, write a StyleSheet class (resembling h1 tag style properties) and set the class to this textbox. So, your textbox text will look like <h1> tag style. Let me know, you want different.
0
 
LVL 9

Expert Comment

by:jkofte
ID: 35204726
Give your textbox a CssClass property.
Then in that class define the css properties for your textbox for it to look like h1 tag.
<asp:TextBox ID="TextBox1" runat="server" CssClass="Class1" Text='<%# Bind("Car_Category") %>'></asp:TextBox>
in your style tag
.Class1
{
font-size:18px;
font-weight:bold;
}
0
 
LVL 2

Author Comment

by:evo_x
ID: 35206452
I don't want just look like a h1 tag, but I want to be rendered in the html file to <h1>mytextbox text</h1>
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 9

Assisted Solution

by:jkofte
jkofte earned 333 total points
ID: 35206948
unfortunately it is not possible using a textbox.

you can use a literal instead.

Literal1.Text = "<h1>" + "MyText" + "</h1>"

Open in new window

0
 
LVL 9

Accepted Solution

by:
jkofte earned 333 total points
ID: 35206968
I mean textbox will always be rendered as HTML input tag in client side.  So, it is not possible to remove the input tags.
0
 
LVL 2

Author Comment

by:evo_x
ID: 35208762
Then is this possible with the label control?
0
 
LVL 5

Assisted Solution

by:karthitron
karthitron earned 167 total points
ID: 35208868
Yes it is possible with label control. <h1> will reflect with Label or Literal or DIV tag or SPAN tag.
0
 
LVL 2

Author Comment

by:evo_x
ID: 35209675
ok, thanks !
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question