|
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
|
|
|
|
|
A_Griffin wrote: MVC or Winforms
Should that perhaps be "MVC or Webforms"?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
WinWebForms? 
|
|
|
|
|
i have a ASP.Net MVC project where i can integrate elmah but the problem is my project solution has many projects like asp.net mvc, BAL, DAL. if i integrate elmah in asp.net mvc project then i will not be able to log error by elmah from DAL or BAL. i want to log error from any project and for that i need to implement elmah in separate project.
i read two write up but still could not figure out the way to achieve my goal. those urls are
https://dzone.com/articles/writing-custom-error-loggers-for-elmah
https://www.codeproject.com/Articles/566705/Making-elmah-axd-a-log-viewer-for-multiple-applica
i am following first article link. they said we need to install elmah core library which i did and also i create a class file
ElmahLog : Elmah.ErrorLog extending Elmah.ErrorLog and override few elmah functions.
now do not understand what to write inside those function.
here is the code
public class ElmahLog : Elmah.ErrorLog
{
public override string Log(Error error)
{
throw new System.NotImplementedException();
}
public override ErrorLogEntry GetError(string id)
{
throw new System.NotImplementedException();
}
public override int GetErrors(int pageIndex, int pageSize, IList errorEntryList)
{
throw new System.NotImplementedException();
}
}
so please tell me how to log error from the above function into sql server db. also tell me how to incorporate elmah.axd log viewer in asp.net mvc project to view all error which logged from my UI,DAL and BAL.
please tell me what config entries i need to add in mvc project and separate project where i add elmah core.
please guide me if anyone did it before.
|
|
|
|
|
This isn't the answer, but I would imagine that you make the Elmah project the first project in the dependency list in solution explorer.
Then add that project as a dependency (reference) in your DAL project. DAL would reference the Elmah project.
Then start stacking projects on top of the DAL project, since all projects will require the DAL.
Now set your build order for Elmah first, Dal 2nd, and then the rest of your projects.
I have a large MVC project that I stacked in the same manner, and I have the MVC controller separated from the main MVC project.
So My project build order is:
DAL with Automatic Migration and Database Seeding.
Entities - Shared EF Database Calls
Common stuff
Services - like Card Processing and Ship Rates
Controllers
MVC Project
If it ain't broke don't fix it
|
|
|
|
|
Is there any resolution for this error: System.IndexOutOfRangeException: RetryAttempts
for this syntax? I am getting this error when I input the right username and password. Why is "retryattempts" giving me an error? Please help!
int retryattempts = Convert.ToInt32(dr["retryattempts"]);
|
|
|
|
|
Not seeing the whole piece of code ... it looks like you are try to reference a column called, "reryattempts", maybe from a datarow and that column does not exist.
Try something like dr.items.count to see how many columns are present.
|
|
|
|
|
Thanks for your response! Here is the entire code.
using (SqlConnection con = new SqlConnection(CS))
{
SqlCommand cmd = new SqlCommand("sp_AuthenticateUser", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter paramUsername = new SqlParameter("@Username", username);
SqlParameter paramPassword = new SqlParameter("@Password", password);
cmd.Parameters.Add(paramUsername);
cmd.Parameters.Add(paramPassword);
con.Open();
// int ReturnCode = Convert.ToInt32(cmd.ExecuteScalar());
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
int RetryAttempts = Convert.ToInt32(rdr["RetryAttempts"]);
if (Convert.ToBoolean(rdr["AccountLocked"]))
{
lblMessage.Text = "Account is locked. Please contact your Web Administrator!";
}
else if (RetryAttempts > 0)
{
int AttemptsLeft = (4 - RetryAttempts); // allow 4 attempts
lblMessage.Visible = true;
lblMessage.Text = "Invalid username and/or password. " +
AttemptsLeft.ToString() + " attempt(s) left";
}
else if (Convert.ToBoolean(rdr["Authenticated"]))
{
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, chk_Remember.Checked);
Response.Redirect("../index.aspx");
}
}
}
|
|
|
|
|
|
If you're getting an IndexOutOfRangeException on the line int RetryAttempts = Convert.ToInt32(rdr["RetryAttempts"]); , that means your query is not returning a column called "RetryAttempts".
You'll need to examine your stored procedure to see what columns it's actually returning, and either fix the column name in your code, or fix the column name in your stored procedure.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for telling me to check my stored procedure. I discovered there is a typo in my stored procedure. I had it as "RetyAttempts".
Million Thanks! Merry Christmas!!
|
|
|
|
|
Lay_Kay wrote: System.IndexOutOfRangeException: RetryAttempts The message is telling you that the value in RetryAttempts (which is a different variable than retryattempts ) does not contain a valid index for the list or array that it references. We need to see the code where the error occurs.
|
|
|
|