新行javascript或asp.net

时间:2016-09-07 13:22:14

标签: javascript asp.net

我想在我的代码中添加一个新行,以便我的文件可以在彼此之下。我将使用链接按钮从Js和asp.net发布代码。

$(qFiles).each(function (i)
                    {
                        var a = document.createElement('a');
                        var isSharePoint = this.isSharePoint;
                        var img =document.createElement('img') ;
                        if (isSharePoint) {
                            a.target = "_blank";
                            a.href = this.FilePath;
                            img.src = appPath + '/Images/pagelink_16x16.png';
                        }

                        else {
                            var filePath = this.FilePath;
                            var fileName = this.FileName;
                            a.onclick = function() {
                                downloadFile(filePath + "\\" + fileName);
                            };
                            img.src = appPath + '/Images/download_16x16.png';
                        }
                        qDiv.appendChild(img);
                        a.innerHTML += this.FileName;
                        a.className = "linkSurrogate singleLine";
                        qDiv.appendChild(a);
                    });

                    qDiv = $(config.jQuerySelectors.quoteFiles);
                    var dialog = qDiv.dialog({
                        autoOpen: true,
                        height: config.dialog.height,
                        width: config.dialog.width,
                        closeOnEscape: true,
                        resizable: false,
                        title:"Quote "+ quoteNo +" Files",
                        modal: true,
                        buttons: {
                            "Close": function () {
                                qDiv.dialog('close');
                            }
                        }
                    }); 

正如您在此处看到的那样,验证是否为SharePoint。还有两个文件出现的对话框。 这是带有链接按钮的代码:

<div id="quoteFiles" style="display: none">
            <asp:LinkButton CssClass="linkButton" ID="downloadFile" ClientIDMode="Static" runat="server" OnClick="downloadFile_Click"></asp:LinkButton>
            <asp:LinkButton CssClass="linkButton" ID="sharePoint" ClientIDMode="Static" runat="server" OnClick="downloadFile_Click"></asp:LinkButton>
            <asp:Label runat="server" ID="quoteFiles" ClientIDMode="Static" Text="There are no files attached."></asp:Label>
        </div>

我已经尝试使用document.write \n<br />并且没有效果。我也尝试在asp页面中添加一个新行,但没有什么可以工作的。

1 个答案:

答案 0 :(得分:1)

在你的代码行之后:

2016-08-01,144598.0

把它放在它之后:

int    anAmountOfBytesRECVd   = 0;          // how many bytes Quandl sent 
string headers_FromHttpSERVER;              // stores as a string
char   anAnswerFromHttpSERVER[];            // stores as a byte-array ( char[] )
double y_value = NULL;

anAmountOfBytesRECVd = WebRequest( "GET",   // MUST use HTTP GET <- Quandl tested
                                    ...
                                    anAnswerFromHttpSERVER,
                                    headers_FromHttpSERVER
                                    );

y_value = StrToDouble( CharArrayToString( anAnserFromHttpSERVER, // [2|0|1|6|-|0|8|-|0|1|,|1|4|4|5|98|.|0]
                                          11,                    //-----------------------^_______________( -1 == TILL EndOfSTRING )
                                          -1
                                          )
                       );

然后在链接(文件 - &gt; link - &gt;换行符)之后写入。它将创建一个空的p标签。你也可以添加一个br标签,但有时这不会显示,然后你需要2个br在一些浏览器上显示为2个换行符,在其他浏览器上显示1个换行符,所以空p标签是什么你想要的原因是所有浏览器都能正确呈现它。