| |

VerySource

 Forgot password?
 Register
Search
View: 1151|Reply: 11

CSS name, is it a variable? Urgent!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-31 13:20:01
| Show all posts |Read mode
such as:
<asp: Button ID = "btnSearch" runat = "server" CssClass = (Can this be a variable?) />
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-9 23:30:01
| Show all posts
Never tried before
Should not be
response.write <asp: Button ID = "btnSearch" runat = "server" CssClass = (Can this be a variable?) />

The output must be OK
Reply

Use magic Report

0

Threads

21

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 United States

Post time: 2020-3-10 20:30:02
| Show all posts
Doesn't seem to work.
However, you can do btnsearch.cssclass = ""
Reply

Use magic Report

0

Threads

32

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-3-10 21:30:02
| Show all posts
Yes, as long as the client is generating the value of a variable
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-3-11 08:30:01
| Show all posts
<asp: Button ID = "btnSearch" runat = "server" CssClass = '<% = variable%>' />
Or background btnSearch.CssClass = variable
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-11 19:00:01
| Show all posts
Ok is ok thank you everyone!
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-19 13:30:02
| Show all posts
<asp: Button ID = "btnSearch" runat = "server" CssClass = '<% = aaa%>' />

  public string aaa;

protected override void OnPreInit (EventArgs e)
{
        base.OnPreInit (e);
        aaa = "redButtonCss";
}
Can not do it.
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-19 19:30:02
| Show all posts
CssClass is a property, you can assign the class name of the style class to this property in the background
Reply

Use magic Report

0

Threads

32

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-4-11 11:45:02
| Show all posts
Button1.CssClass = varName;
Reply

Use magic Report

0

Threads

32

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-4-11 12:30:02
| Show all posts
or:
Button1.Attributes.Add ("class", varName);
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list