小编Vik*_* S.的帖子

媒体打印特定div的css

我使用@media print打印html页面.

@media 在简单的html页面打印工作正常.

但是当我调用javascript时,@mediacss无法处理文档.

我的javascript代码是

<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js" > </script>
<script type="text/javascript">

    function PrintElem(elem)
    {
        Popup($(elem).html());
    }

    function Popup(data) 
    {
        var mywindow = window.open('', 'mydiv', 'height=400,width=600');
        mywindow.document.write(data);
        mywindow.print();
        mywindow.close();

        return true;
    }

</script>
Run Code Online (Sandbox Code Playgroud)

如何编写媒体打印css用于特定div的工作.

javascript css printing jquery

1
推荐指数
1
解决办法
748
查看次数

使用按钮在aspx.cs上调用JavaScript函数(在aspx中)

我有这个aspx:

 <body>
    <div>
    <script type="text/javascript">
        function NewPage() {
            document.location.href = "http://www.nextservice.pt/"
        }
        </script>
         <form id="form1" runat="server">
 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

                    <asp:Button ID="Btn2" runat="server" Text="OK" onclick="Button2_Click" />

            CODE1: <asp:Label ID="Label1" runat="server" Text="Label" ForeColor="#CC0000" />
        </form>
        </div>
</body>
Run Code Online (Sandbox Code Playgroud)

我正在使用Web表单,我不会在aspx.cs上调用此按钮

   public partial class SITE_TESTER : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button2_Click (object sender, EventArgs e)
    {
        string code = TextBox1.Text.ToString();

        if (!verifyCode(code))  // comparing users from table 
        {
            Label1.Text = "Not Exists";  //for invalid code
        }
        else …
Run Code Online (Sandbox Code Playgroud)

.net javascript asp.net webforms

0
推荐指数
1
解决办法
4万
查看次数

如何从发件人onclick事件中获取价值

这个我的客户端我投入了价值Eval("UserId")并试图在服务器上获取它

  <input type="button" id="Promouter" runat="server"  
        value='<%# Eval("UserId") %>' 
        onserverclick="Promoter_Onclick"> <%# Eval("FirstName") %> </input>
Run Code Online (Sandbox Code Playgroud)

这个服务器

protected void Promoter_Onclick(object sender, EventArgs e)
{
    InfinityNightDataContext data = new InfinityNightDataContext();
    lvInvaited.DataSource = data.PartyPpls.Where(dbPartyPpls => dbPartyPpls.PartyId == 1 && dbPartyPpls.PromoterId == sender.value);
    lvInvaited.DataBind();
    lvInvaited.Visible = true;

}
Run Code Online (Sandbox Code Playgroud)

我可以看到我需要的发件人的价值,但我从发件人那里得到它我知道sender.value dosn"t work如何从发件人那里得到这个值

asp.net

0
推荐指数
1
解决办法
379
查看次数

我的代码没有处理动作方法

此代码用于前端和csv文件中的显示报告也会使此代码正常运行,并且此代码在同一页面上重定向document.frmmonthly.action ="test2.php"; 但是第二个代码没有正常工作,代码没有重定向到其他页面是什么原因或我的代码中的问题是什么...... document.frmmonthly.action ="csv.php";

动作方法不适用于csv.php .....我的代码不工作PLZ帮我...

<head> 
    <script language="text/javascript">
        function OnSubmitForm(value) {    
           if(value == 'Generate')  {
              document.frmmonthly.action ="test2.php";
           } else if(value == 'Download') {
              document.frmmonthly.action ="csv.php";
           }

           return true;
       }    
    </script>
    </head>
    <form method="POST" onSubmit="return OnSubmitForm();">
         </tr>
        <tr>
            <td><input type="submit" name="submit" 
                               onSubmit="OnSubmitForm(this.value)" 
                               value="Generate"></tr>
        <tr>
            <td><input type="submit" name="submit1" 
                               onSubmit="OnSubmitForm(this.value)" 
                               value="Download" action="csv.php">
        </tr>       
    </form>
Run Code Online (Sandbox Code Playgroud)

javascript php

0
推荐指数
1
解决办法
104
查看次数

标签 统计

javascript ×3

asp.net ×2

.net ×1

css ×1

jquery ×1

php ×1

printing ×1

webforms ×1