I have a PDF file on my FTP Server. I want to display the PDF file using ASP.Net.
I used google viewer in an iframe control:
<iframe src="http://docs.google.com/gview?url=ftp://samplepdf.com/sample.pdf" style="width:718px; height:700px;" frameborder="0"></iframe>
It worked perfectly while viewing pdfs from public servers. The problem is that I need to give ftp username and password for the pdf to be displayed on my asp.net page.
Any thoughts?
Thanks in advance
Edit:
I can use
url=ftp://username:pass#ftp.samplesite.com/...
but I dont want the username and password to be attached to the url.
I also tried this code:
<div><object data="ftp://username:pass#ftp.website.com/website.com/wwwroot/folderpath/test.pdf" type="application/pdf" width="800" height="1000"> alt : test.pdf </object> </div>
and it works well. Tho the ftp username and password are still shown in the page source. Any ideas? Thanks
es simplemente poner un: id="NombreCampo" y asignar igualmente un: runat="server" desde el código en el archivo .aspx, quedaría así:
< iframe id="NombreCampo" runat="server" width="400" height="500" style="border: none;">
eso sería lo visible al usuario en el código de la página.
desde el codigo de lado del servidor poner la cadena con el FTP:
NombreCampo.Src = "https://docs.google.com/viewer?url=ftp://nombreUsuario:pass#ftp.samplesite.com/" + NombreArchivo + " & embedded=true";
¡listo
Related
I have a problem : on my website http://comportementaliste-du-chat.fr/, I want to create CTA's in my posts with Gutenberg. I found a great plugin to do that, but the thing is the design is good in the back office, but in the front office the default CSS overrides (the "!important" breaks my block in gutenberg so I can't use it) the gutenberg style. See example here https://comportementaliste-du-chat.fr/blog/15-plantes-toxiques-pour-votre-chat-avec-photos/
If someone could help me, it would be great :) thanks a lot !!
Front office result //
Back office result
<div class="wp-block-media-text__content">
<h2 class="has-text-color" id="et-si-on-prenait-un-moment-pour-discuter-de-ce-qui-vous-tracasse" style="color:#ffffff">Et si on prenait un moment pour discuter de ce qui vous tracasse ?</h2>
<p class="has-text-color" style="color:#d7d7d7">Si vous êtes en train de lire cet article, c'est que <strong>quelque chose vous chiffonne, ou vous intrigue</strong>. Savez-vous que les consultations sont là pour <strong>résoudre un problème, mais aussi le prévenir</strong> ? Je peux vous aider à anticiper un événement ou à <strong>solutionner un comportement indésirable</strong>. Alors n'hésitez-pas, <strong>venez m'en parler !</strong></p>
<div class="wp-container-1 wp-block-buttons">
<div class="wp-block-button"><a class="wp-block-button__link has-white-color has-text-color has-background" style="background-color:#54bcfb">Discutons ensemble !</a></div>
</div>
I'm writting a blog post in RStudio using Rmarkdown. The document will be rendered to HTML at the end.
But when rendering I'm not getting enough space between p tag and img tag.
I know I can insert a break line using 2 spaces, it works when separating text. But it is not working for me when trying to set a break of text from an image.
Rmarkdown in RStudio:
Sin embargo, para lograr esto vas a tener que
personalizar algunos registros de tu DNS en el Panel de Control de tu proveedor de hosting:
Generates this HTML (Notice the br tag):
<p>Sin embargo, para lograr esto vas a tener que<br />
personalizar algunos registros de tu DNS en el Panel de Control de tu proveedor de hosting:</p>
But: Inserting spacing between text and image does not generate a br tag.
Sin embargo, para lograr esto vas a tener que
personalizar algunos registros de tu DNS en el Panel de Control de tu proveedor de hosting:
```{r, echo=FALSE, fig.cap="", out.width = '100%', fig.align='center'}
knitr::include_graphics("D:/omargonzalesdiaz/static/img/posts/sumo/custom_email_address.jpg")
```
Generates: No break line between text and image.
<p>Sin embargo, para lograr esto vas a tener que<br />
personalizar algunos registros de tu DNS en el Panel de Control de tu proveedor de hosting:</p>
<p><img src="data:image/jpeg;base64,/9j/4QwCRXhpZgAATU0Af//AkAtEbdSD+ft/kN97lEZ7DP6N5ABJgqd/0ElMi7K0HoMM8+/wD9RIlZfJ3sDB22mZ8Z9rVVGZbu1cIIloivXndDvtH" width="100%" style="display: block; margin: auto;" /></p>
One option is to add html breaks to your script directly:
Sin embargo, para lograr esto vas a tener que
personalizar algunos registros de tu DNS en el Panel de Control de tu proveedor de hosting:
<br/><br/>
```{r, echo=FALSE, fig.cap="", out.width = '100%', fig.align='center'}
knitr::include_graphics("D:/omargonzalesdiaz/static/img/posts/sumo/custom_email_address.jpg")
```
I want to add a button to my login control but it won't let me. I guess the build in login class works in a different way.
<asp:login
ID="seamenLogin" runat="server"
TitleText="<strong>Inloggning till sjöläkarwebben. Läkarintyg enligt Manilakonventionen</strong>"
InstructionText="<br/>Förutsättningar för att använda systemet, ansökan om lösenord<br/>och mer information bl.a.
om Manila finns på sidan<br/><a href='http:'>http:</a><br/><br/>
Inloggning med <a class='linkbutton' href='https:/' (BankID, Mobil BankID, ...)</a><br/><br/><br/>
Inloggning med användarnamn och lösenord kan fortfarande användas men vi<br/>rekommenderar att du övergår till inloggning med e-legitimation redan nu.<br/><br/>"
UserNameLabelText="Användarnamn:"
PasswordRecoveryText="Har du glömt ditt lösenord?<br/>Här kan du beställa nytt. Det sänds i rekommenderat brev till din folkbokföringsadress."
HelpPageUrl="http://www.transportstyrelsen.se/sv/Om-webbplatsen/Inloggning-till-vara-fordonstjanster/E-legitimation/Problem-med-din-e-legitimation/"
<TitleTextStyle CssClass="heading1" HorizontalAlign="Left"/>
<LabelStyle CssClass="textboxnamn" HorizontalAlign="Left" Width="100px"/>
<InstructionTextStyle HorizontalAlign="Left" />
<LoginButtonStyle CssClass="loginbutton"/>
</asp:login>
How do I add a simple button to this code?
Try converting the legacy Login control to a Template instead.
There should be a small triangle in the right corner which you could click and it should say/go to "Convert to Template".
Then you are free to do whatever changed you want to the template. But remember to be careful not to remove or alter the controls which are already in the table too much from initial state.
Example.
I want to create an excel sheet from click of button.
These excel sheet will contain report which is generated on classic asp page. When user clicks on button then an excel sheet should be created which will have the same report as page have
This header works fine:
<%
Response.AddHeader "Content-Disposition", "attachment;filename=NOMBRE_ARCHIVO.xls"
Response.ContentType = "application/vnd.ms-excel"
%>
For small tables, try this example in html/javascript:
<html>
<body>
<table id="tabla" border="1">
<tr><th>Uno</th><td>1</td></tr>
<tr><th>Dos</th><td>2</td></tr>
</table>
<p>
<input type="button" onclick="javascript:exportarExcel('tabla');" value="Vamos al excel!">
</p>
</body>
<script type="text/javascript">
function exportarExcel(tabla){
var t = document.getElementById(tabla);
t.border = 1;
var html = t.outerHTML;
html = encodeURIComponent(html);
// problemas con el encoding!
// se puede usar base64_encode() en lugar de encodeURIComponent(html))
// ojo con encodeURIComponet() que está deprecada. lo mejor sería usar base64
window.open('data:application/vnd.ms-excel,' + html);
}
</script>
</html>
I have a Imagebutton.
<asp:ImageButton
OnClientClick="alert('Du hast nun das Jetzt-Spielen-Feature aktiviert. \r\nEs zeigt anderen Nutzern von RPone in der Online-Liste hinter deinem Namen an, dass du jetzt gerne ein neues RPG beginnen würdest.\n\rDies hält 30 Minuten und deaktiviert sich automatisch, wenn du es nicht vorher deaktivierst.')"
OnClick="linkBtnNowPlay_Click" ID="imgButtonNewPlay" ImageUrl="~/Images/star1.gif" runat="server" />
works like charm but
<asp:ImageButton OnClick="linkBtnNowPlay_Click" ID="imgButtonNewPlay" ImageUrl="~/Images/star1.gif" runat="server" />
and
imgButtonNewPlay.OnClientClick = "alert('test')";
on Serverside does not, why?
I must have it on server side because I must include an if statement before
Add a semi-colon after alert();
ASPX Engine adds the call to __doPostBack() after your client code, without semi-colon; they are not separated well.
You cannot call a javascript function directly like that from server side, you can add the following into your linkBtnNowPlay_Click method in code behind,
protected void linkBtnNowPlay_Click(object sender, EventArgs e){
Response.Write("<script>alert('test');</script>"); }