C# Target=“_blank” in a LinkButton

前端 未结 8 1358
无人及你
无人及你 2020-12-06 00:58

is it possible to have a target=\"_blank\" in LinkButton...mine doesnt seem to be working



        
8条回答
  •  再見小時候
    2020-12-06 01:51

    After looking at these answers and none was exactly what I wanted (do this with a button look), I ended up using a hyperlink control, but used the same css style as my regular buttons:

    .button {
    
        background-color:#011745;
        color:white;
        padding:7px 12px 7px 12px;
        margin:3px;
        border-style:none;
        font-size:12px;
    
    }
    
    .button:hover {
    
        background-color:#336699;
        color:white;
        padding:7px 12px 7px 12px;
        margin:3px;
        border-style:none;
        font-size:12px;
    
    }
    

    It looked just like them! If you are going for a button that opens a link in a new window, which I was, it was almost perfect. In a set of table cells, it displayed just a touch lower than the regular buttons, so I styled it like this: "position:relative; top:-2px;" and that did the trick. I also had to force the forecolor white:

    
    

提交回复
热议问题