|
|
hi
please give me a code i want to prevent my website from csrf by using csrf-token, i want not to show page url or generate a random code in my url that expires every new time that we click on the link how can i do it?
|
|
|
|
|
There are great number of examples available in Google for CSRF-token.Language obviously you can only know whether you are using java or C#.Net or whatever.Please be specific while you are discussing on some topics.
|
|
|
|
|
We know when a user request a website first time then a session cookie dropped in user pc. If browser cookie is disabled then how session cookie is dropped at client side?
if browser cookie is disabled then session cookie is append at the end of url as query string?
please tell me what happen for session cookie when browser cookie is disabled in asp.net MVC.
|
|
|
|
|
If cookies are refused then the user gets a new session with each request, the site doesn't know it is a returning user. You can configure cookieless sessions in the config which will add a tracking ID to the url instead but this is generally a bad thing.
|
|
|
|
|
sorry not clear. you said - If cookies are refused then the user gets a new session with each request
if browser cookie is disabled then session id will be append with url like cookie less session ?
if we configure cookie less session then session id is added with url. so if browser cookie is disabled then session id will be added with url?
thanks
|
|
|
|
|
If you want cookieless sessions you need to enable them in the configuration and everyone uses them, even people who accept cookies. Generally I'd stick with cookies being required for sessions, if the user doesn't want to accept cookies then they have to put up with the consequences of that.
|
|
|
|
|
just tell me if browser cookie is disabled then session id will be passing to client?
|
|
|
|
|
Yes it will but it will just be thrown away by the browser.
|
|
|
|
|
you said -- Yes it will but it will just be thrown away by the browser.
when session id will be thrown away by the browser then error screen will be displayed?
|
|
|
|
|
No, the browser just ignores the cookies.
|
|
|
|
|
Hello, I would like to see the page in my gridview but I am not working what I am seeing on the internet, should I use a data source?
here I leave my code
<%@ Page Title="Inventario de Aplicaciones" Language="vb" MasterPageFile="~/CHJ_InventarioAplicaciones.Master"
AutoEventWireup="false" CodeBehind="Principal.aspx.vb" Inherits="CHJ.InventarioAplicaciones.Web.Principal" %>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="Main" ViewStateMode="Inherit">
<%----%>
<div id="divTituloPagina" class="divTituloPagina">
<span class="texto_tituloPagina">
<asp:Label runat="server" CssClass="texto_tituloPagina" Text="Inventario de Aplicaciones" ID="lblTitulo"></asp:Label>
</span>
</div>
<%----%>
<div style="margin-left: 10px; margin-bottom: 5px; margin-top: 5px; text-align:left;" >
<asp:Button ID="BtnNuevaAplicacion" OnClick="BtnNuevaAplicacion_Click" runat="server" Text="Nueva Aplicación" Font-Bold="True" CssClass="titulo_commando" Font-Italic="false" />
</div>
<%----%>
<div id = "divBackground" style="position: fixed; z-index: 999; height: 100%; width: 100%; top: 0; left:0; background-color: grey; filter: alpha(opacity=60); opacity: 0.6; display:none">
</div>
<div id="divContenidoPagina" class="divContenidoPagina" >
<asp:GridView ID="grdAplicaciones" runat="server" Width="100%" Height="80%" AutoGenerateColumns="False"
BackColor="White" EnableTheming="False" Font-Size="13px"
ViewStateMode="Enabled" ValidateRequestMode="Enabled" Font-Names="Arial" RowStyle-Width="100%" AllowCustomPaging="True" AllowPaging="True"
SortedAscendingCellStyle-VerticalAlign="NotSet" DataKeyNames="IdAplicacion" PageSize="18" AllowSorting="True"
EnableSortingAndPagingCallbacks="True" >
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-Width="300px" >
<ItemStyle Width="300px"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="Tipo" DataField="TipoAplicacionTexto" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
<ItemStyle Width="150px"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="Estado" DataField="EstadoTexto" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Middle">
<ItemStyle Width="150px"></ItemStyle>
</asp:BoundField>
<asp:ButtonField ButtonType="Image" CommandName="INCIDENCIAS" ImageUrl="~/Images/incidencias.png" Text="Botón3" HeaderStyle-Width="25px" FooterStyle-VerticalAlign="Middle" FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" >
<FooterStyle HorizontalAlign="Center" VerticalAlign="Middle"></FooterStyle>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="25px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
</asp:ButtonField>
<asp:ButtonField ButtonType="Image" CommandName="APP" ImageUrl="~/Images/view_16x16.gif" Text="Botón4" HeaderStyle-Width="25px" FooterStyle-VerticalAlign="Middle" FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" >
<FooterStyle HorizontalAlign="Center" VerticalAlign="Middle"></FooterStyle>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="25px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
</asp:ButtonField>
<asp:ButtonField ButtonType="Image" CommandName="EDITAR" ImageUrl="~/Images/file_edit_16x16.gif" Text="Botón1" HeaderStyle-Width="25px" FooterStyle-VerticalAlign="Middle" FooterStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" >
<FooterStyle HorizontalAlign="Center" VerticalAlign="Middle"></FooterStyle>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="25px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
</asp:ButtonField>
<asp:ButtonField ButtonType="Image" CommandName="BORRAR" ImageUrl="~/Images/trash_16x16.gif" Text="Botón2" HeaderStyle-Width="25px" FooterStyle-VerticalAlign="Middle" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" >
<FooterStyle HorizontalAlign="Center" VerticalAlign="Middle"></FooterStyle>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="25px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
</asp:ButtonField>
<asp:ButtonField ButtonType="Image" CommandName="GruposSEG" ImageUrl="~/Images/2608_GoldLock_16x16.png" Text="Botón5" HeaderStyle-Width="25px" FooterStyle-VerticalAlign="Middle" FooterStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle" >
<FooterStyle HorizontalAlign="Center" VerticalAlign="Middle"></FooterStyle>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="25px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
</asp:ButtonField>
</Columns>
<HeaderStyle BackColor="Gray" Font-Bold="True" ForeColor="White" />
<%----%>
<FooterStyle ForeColor="#8C4510" BackColor="#F7DFB5" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" Width="100%" />
<%----%>
<pagersettings mode="NextPreviousFirstLast" firstpagetext="|Pri|" lastpagetext="|Últ|" nextpagetext="|Sig|" previouspagetext="|Ant|" position="Bottom" />
<RowStyle Width="100%"></RowStyle>
</asp:GridView>
</div>
<%----%>
</asp:Content>
modified 2-Jan-18 10:30am.
|
|
|
|
|
solution AllowCustomPaging="True" for AllowCustomPaging="False"
|
|
|
|
|
Hi, can any one suggest and nuget package for converting PDF to Image in asp.net core 2.0.
|
|
|
|
|
Chances are you won't find any good and free library that can do this. Most libraries are either paid solutions or incomplete indie projects. Your luck is, that you want to do this with .NET Core 2.0, which can accept any .NET framework targeting library, thus any NuGet library will work just fine. iTextSharp can be looked at, but I am unsure.
Anyways, you can look for any useful library here, pdf to image .net - Google Search
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
You could use Ghostscript[^], which is available under the AGPL license as well as a commercial license.
There are a couple of NuGet packages - for example, Ghostscript.NET[^] - but it's not clear whether they support ASP.NET Core. It might be easier to shell out to the Ghostscript command-line tool[^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Would you please let me know how to code Remotedeskop system in Asp.net using C#
|
|
|
|
|
Hire someone. If you don't even have a starting point that level of detail and commitment required is likely beyond you.
Also there's a good open source solution, though not .NET based:
Apache Guacamole™
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
i try some types but not working,And how to solve this issue
|
|
|
|
|
Member 12780697 wrote: i try some types but not working What types? Do you mean types of a frameworks? Crystal Report is one of the most widely used framework.
Lastly, date to date is just a filter. Every reporting software/library provides options that can be configured to select a range of date values to get the report for. Which library are you using?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
please tell me all steps in details to implement https for mvc site
[RequireHttps]
public ActionResult Login(string redirectUrl) {…}
do i need to use [RequireHttps] ?
do i need to change any property of project?
do i need to bind certificate in IIS level to test it?
how to test https in my local pc?
please guide me with step-by-steps details.
|
|
|
|
|
It doesn't matter what kind of site you're running - MVC or Winforms - https is https and is a server (IIS) configuration issue - though you may need to ensure that any references to http in your CSS or JavaScript code are redirected accordingly - eg @imports in CSS or, for example, if you use a JavaScript library with an external source you may need to update the reference (or your users will see an "insecure content" warning in their browsers.)
You may also need to update callback references in, for example, Paypal if you use their Instant Payment Notifications, and in Google Analytics.
Otherwise you can enforce https within web.config - but you may want to ensure everything is working first. You can obtain free SSL certificates from Lets Encrypt[^] - if you're on a Windows server, I quite like the Certify[^] manager for getting and installing them.
There no real need to test it locally - as I say, you can test it on https while leaving plain http in place, until you're happy it's all working, and then enforce https (See below). If you really want to, you can though - but exactly how depends on your local setup. You'll need to open your router, and point a domain to your machine and bind that in ISS... etc etc.
Here is what I put in web.config to enforce https:
<system.webServer>
<rewrite>
<rules>
<rule name="httpsredirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
|
|
|
|
|
This, but I would add that server configuration is not a developer's job; that's the responsibility of the System Admins. Let them handle SSL configuration, and write your application in a way that will allow them to do that.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
True - but some of us poor sods have to be responsible for both...
|
|
|
|
|
Same boat, but they are definitely separate roles and I hold out hope that some day...
Regardless, it's a practices issue in my book. I like the [RequireHttps] in theory, but I don't like setting the standard that server configuration should be in the hands of the dev. More to the point, using that construct leaves it up to the dev which information should be protected and which is freely available, and that's very bad practice. What if you forget to tag a controller or method with [RequireHttps], when in reality the server admin should really be setting a redirect? I don't intend to be liable for those decisions, that's why management makes the big bucks.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|