Asp.net input type =“text” vs asp:textbox
up vote
0
down vote
favorite
I'm new Asp.Net.I have input type="text" also I have css class for input[type="text"]. So I have an asp:textbox. How can I write css class for my asp:textbox which is a different css class then the one for input?
My asp:textbox takes properties from
.login-box input[type=text], input[type=password]
<div class="login-box" style="padding:70px 30px">
<img src="Imageshuman.png" class="man"/>
<h1>Login Here</h1>
<p>Username</p>
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
<a href="#">Forgot Password</a>
</div>
My style.css below:
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.text-hide {
height:40px;
border-color:Transparent;
background-color:Transparent;
color:Red;
}
.login-box input[type=text], input[type=password] {
height: 40px;
border: 0;
border-bottom: 1px solid #fff;
background-color: transparent;
color: #fff;
font-size: 16px;
outline: none;
}
asp.net webforms
add a comment |
up vote
0
down vote
favorite
I'm new Asp.Net.I have input type="text" also I have css class for input[type="text"]. So I have an asp:textbox. How can I write css class for my asp:textbox which is a different css class then the one for input?
My asp:textbox takes properties from
.login-box input[type=text], input[type=password]
<div class="login-box" style="padding:70px 30px">
<img src="Imageshuman.png" class="man"/>
<h1>Login Here</h1>
<p>Username</p>
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
<a href="#">Forgot Password</a>
</div>
My style.css below:
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.text-hide {
height:40px;
border-color:Transparent;
background-color:Transparent;
color:Red;
}
.login-box input[type=text], input[type=password] {
height: 40px;
border: 0;
border-bottom: 1px solid #fff;
background-color: transparent;
color: #fff;
font-size: 16px;
outline: none;
}
asp.net webforms
Please help me..
– fico
Nov 22 at 14:01
start by placing your .aspx page here. Also have you tried anything yourself to solve the issue
– JustLearning
Nov 22 at 14:02
2
add CssClass="class1 class2 classX" this is the way you can add multiple classes to asp.net webform elements.
– SehaxX
Nov 22 at 14:16
The term "css class" is usually used for the name that is specified in the "class" attribute on the element.input[type=text]
is a selector, probably before a block of declarations in a .css file (or style element) ref. What exactly do you mean?
– Hans Kesting
Nov 22 at 14:31
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm new Asp.Net.I have input type="text" also I have css class for input[type="text"]. So I have an asp:textbox. How can I write css class for my asp:textbox which is a different css class then the one for input?
My asp:textbox takes properties from
.login-box input[type=text], input[type=password]
<div class="login-box" style="padding:70px 30px">
<img src="Imageshuman.png" class="man"/>
<h1>Login Here</h1>
<p>Username</p>
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
<a href="#">Forgot Password</a>
</div>
My style.css below:
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.text-hide {
height:40px;
border-color:Transparent;
background-color:Transparent;
color:Red;
}
.login-box input[type=text], input[type=password] {
height: 40px;
border: 0;
border-bottom: 1px solid #fff;
background-color: transparent;
color: #fff;
font-size: 16px;
outline: none;
}
asp.net webforms
I'm new Asp.Net.I have input type="text" also I have css class for input[type="text"]. So I have an asp:textbox. How can I write css class for my asp:textbox which is a different css class then the one for input?
My asp:textbox takes properties from
.login-box input[type=text], input[type=password]
<div class="login-box" style="padding:70px 30px">
<img src="Imageshuman.png" class="man"/>
<h1>Login Here</h1>
<p>Username</p>
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
<a href="#">Forgot Password</a>
</div>
My style.css below:
.login-box input {
width: 100%;
margin-bottom: 20px;
}
.text-hide {
height:40px;
border-color:Transparent;
background-color:Transparent;
color:Red;
}
.login-box input[type=text], input[type=password] {
height: 40px;
border: 0;
border-bottom: 1px solid #fff;
background-color: transparent;
color: #fff;
font-size: 16px;
outline: none;
}
asp.net webforms
asp.net webforms
edited Nov 23 at 8:46
asked Nov 22 at 13:58
fico
14
14
Please help me..
– fico
Nov 22 at 14:01
start by placing your .aspx page here. Also have you tried anything yourself to solve the issue
– JustLearning
Nov 22 at 14:02
2
add CssClass="class1 class2 classX" this is the way you can add multiple classes to asp.net webform elements.
– SehaxX
Nov 22 at 14:16
The term "css class" is usually used for the name that is specified in the "class" attribute on the element.input[type=text]
is a selector, probably before a block of declarations in a .css file (or style element) ref. What exactly do you mean?
– Hans Kesting
Nov 22 at 14:31
add a comment |
Please help me..
– fico
Nov 22 at 14:01
start by placing your .aspx page here. Also have you tried anything yourself to solve the issue
– JustLearning
Nov 22 at 14:02
2
add CssClass="class1 class2 classX" this is the way you can add multiple classes to asp.net webform elements.
– SehaxX
Nov 22 at 14:16
The term "css class" is usually used for the name that is specified in the "class" attribute on the element.input[type=text]
is a selector, probably before a block of declarations in a .css file (or style element) ref. What exactly do you mean?
– Hans Kesting
Nov 22 at 14:31
Please help me..
– fico
Nov 22 at 14:01
Please help me..
– fico
Nov 22 at 14:01
start by placing your .aspx page here. Also have you tried anything yourself to solve the issue
– JustLearning
Nov 22 at 14:02
start by placing your .aspx page here. Also have you tried anything yourself to solve the issue
– JustLearning
Nov 22 at 14:02
2
2
add CssClass="class1 class2 classX" this is the way you can add multiple classes to asp.net webform elements.
– SehaxX
Nov 22 at 14:16
add CssClass="class1 class2 classX" this is the way you can add multiple classes to asp.net webform elements.
– SehaxX
Nov 22 at 14:16
The term "css class" is usually used for the name that is specified in the "class" attribute on the element.
input[type=text]
is a selector, probably before a block of declarations in a .css file (or style element) ref. What exactly do you mean?– Hans Kesting
Nov 22 at 14:31
The term "css class" is usually used for the name that is specified in the "class" attribute on the element.
input[type=text]
is a selector, probably before a block of declarations in a .css file (or style element) ref. What exactly do you mean?– Hans Kesting
Nov 22 at 14:31
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
Use CssClass property. Like so:
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">
This will turn into :
<input type="text" class="text-hide">
on the page
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
|
show 3 more comments
up vote
1
down vote
You want to use a label, literal or panel all can be used with asp: prefix to show some message in ASP.Net Web Form.
You don't add messages in input fields like in your example
<asp:Label ID="txtError" CssClass="text-hide" runat="server" Text="Incorrect username or password!"></asp:Label>
After this you can reference this class in your CSS like this:
.text-hide {
}
add a comment |
up vote
0
down vote
Username
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" class="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
3
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Use CssClass property. Like so:
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">
This will turn into :
<input type="text" class="text-hide">
on the page
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
|
show 3 more comments
up vote
1
down vote
Use CssClass property. Like so:
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">
This will turn into :
<input type="text" class="text-hide">
on the page
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
|
show 3 more comments
up vote
1
down vote
up vote
1
down vote
Use CssClass property. Like so:
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">
This will turn into :
<input type="text" class="text-hide">
on the page
Use CssClass property. Like so:
<asp:TextBox ID="txtError" CssClass="text-hide" runat="server">
This will turn into :
<input type="text" class="text-hide">
on the page
answered Nov 22 at 14:16
adinas
2,10732531
2,10732531
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
|
show 3 more comments
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
adinas , What does CssClass="text-hide" in your code?
– fico
Nov 22 at 14:18
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
When using a webforms server control and you want to give it a CSS class you use "CssClass". In this case we are telling the tag to use the CSS class "text-hide"
– adinas
Nov 22 at 14:19
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
I wrote class for textbox but it takes properties from in class of input type=text
– fico
Nov 22 at 14:22
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
So overwrite them. in the class "text-hide"
– adinas
Nov 22 at 14:23
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
for example if you have input[type="text"]{color:red} and in .text-hide{color:blue} then the blue will override the red
– adinas
Nov 22 at 14:24
|
show 3 more comments
up vote
1
down vote
You want to use a label, literal or panel all can be used with asp: prefix to show some message in ASP.Net Web Form.
You don't add messages in input fields like in your example
<asp:Label ID="txtError" CssClass="text-hide" runat="server" Text="Incorrect username or password!"></asp:Label>
After this you can reference this class in your CSS like this:
.text-hide {
}
add a comment |
up vote
1
down vote
You want to use a label, literal or panel all can be used with asp: prefix to show some message in ASP.Net Web Form.
You don't add messages in input fields like in your example
<asp:Label ID="txtError" CssClass="text-hide" runat="server" Text="Incorrect username or password!"></asp:Label>
After this you can reference this class in your CSS like this:
.text-hide {
}
add a comment |
up vote
1
down vote
up vote
1
down vote
You want to use a label, literal or panel all can be used with asp: prefix to show some message in ASP.Net Web Form.
You don't add messages in input fields like in your example
<asp:Label ID="txtError" CssClass="text-hide" runat="server" Text="Incorrect username or password!"></asp:Label>
After this you can reference this class in your CSS like this:
.text-hide {
}
You want to use a label, literal or panel all can be used with asp: prefix to show some message in ASP.Net Web Form.
You don't add messages in input fields like in your example
<asp:Label ID="txtError" CssClass="text-hide" runat="server" Text="Incorrect username or password!"></asp:Label>
After this you can reference this class in your CSS like this:
.text-hide {
}
edited Nov 22 at 15:19
Hinek
6,599114370
6,599114370
answered Nov 22 at 14:23
SehaxX
5601516
5601516
add a comment |
add a comment |
up vote
0
down vote
Username
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" class="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
3
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
add a comment |
up vote
0
down vote
Username
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" class="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
3
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
add a comment |
up vote
0
down vote
up vote
0
down vote
Username
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" class="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
Username
<input id="username" type="text" name="username" placeholder="Enter Username" runat="server"/>
<p>Password</p>
<input type="password" name="password" placeholder="Enter Password"/>
<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click"/>
<asp:TextBox ID="txtError" class="text-hide" runat="server">Incorrect username or password!</asp:TextBox>
answered Nov 22 at 14:05
fico
14
14
3
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
add a comment |
3
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
3
3
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
please edit your question end add this, not as an answer.
– SehaxX
Nov 22 at 14:13
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - From Review
– Bidou
Nov 22 at 14:45
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432596%2fasp-net-input-type-text-vs-asptextbox%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please help me..
– fico
Nov 22 at 14:01
start by placing your .aspx page here. Also have you tried anything yourself to solve the issue
– JustLearning
Nov 22 at 14:02
2
add CssClass="class1 class2 classX" this is the way you can add multiple classes to asp.net webform elements.
– SehaxX
Nov 22 at 14:16
The term "css class" is usually used for the name that is specified in the "class" attribute on the element.
input[type=text]
is a selector, probably before a block of declarations in a .css file (or style element) ref. What exactly do you mean?– Hans Kesting
Nov 22 at 14:31