?
Solved

TextBox rendered as <h1> tag

Posted on 2011-03-23
8
Medium Priority
?
570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Assisted Solution

by:jkofte
jkofte earned 1332 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 1332 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 668 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

752 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