Subscribe: Web Forms
http://forums.asp.net/rss.aspx?ForumID=18
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
add  data  dropdown  field  list  login  net  new  providers  runat server  server  service  system web  system  user  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Web Forms

All Forums



All Forums



Last Build Date: Fri, 21 Jul 2017 18:12:02 -0700

 



Global.asax and Application_start don't seem to be firing and executing code

2017-07-21T18:33:36.523-07:00

It doesn't seem to be working on IIS Express or local IIS. If it was firing, then I wouldn't have the Unity issue of the object not there when trying to do Dependency Injection for an object in the IoC, due to code execution for Unity not being executed by Application_Start().




How to judge who is operating

2017-07-20T06:05:29.247-07:00

I have a doubt, I developed a web site. When users log in site and do some operations such as buying, selecting  or editing.

I need to fetch user name or password from cookie and then let them do above operations. so whether has any other ways that the site know who is operating.

such as A log in my site. and A need to edit his information, so I need to get users's unique key such as phone number to let him to operate. and if this people need to query some information about himself, whether has any other ways  do this.

such as I post this issue, then I re-edit my question, whether this site need to get my unique id and my thread unique id?

and this site display my all threads and how it implement, may be they implement as the following:

select * from thread(table) where useraccount= myaccount and password=mypassword?

how they to get myaccount and mypassword, cookie? or others?




Cryptographic Error when publishing same app to a new webapp in Azure

2017-07-20T18:35:09.233-07:00

When I publish the same app to multiple nodes in Azure and use traffic manager to route the requests evenly, I get the following error in ApplicationInsights and I'm unable to determine the cause:

Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)","outerId":"11388138","message":"The key {XXXXXXXXXXXXXX} was not found in the key ring.","type":"System.Security.Cryptography.CryptographicException","id":"9351281"}]

We have never seen this error before adding the new node.

Your assistance is appreciated.




AspNet Core ServicePointManager.ServerCertificateValidationCallback

2017-07-22T00:17:52.78-07:00

Hello Guys, 

I'm trying using ServicePointManager.ServerCertificateValidationCallback at NET CORE for call webservice in soap to bypass invalid certificated.

How can I do it?

I'll try this but haven't work.

EWSV0005_SeguradoInterfaceClient client = new EWSV0005_SeguradoInterfaceClient(result, new EndpointAddress(adddress));
client.ClientCredentials.UserName.UserName = "usr_soa_ns";
client.ClientCredentials.UserName.Password = "155465";
client.ClientCredentials.ServiceCertificate.SslCertificateAuthentication =
new X509ServiceCertificateAuthentication()
{
CertificateValidationMode = X509CertificateValidationMode.None,
RevocationMode = X509RevocationMode.NoCheck

};

Anyony can I help me?

Thanks




ajax call to an asp page loses parameters

2017-07-18T16:05:55.227-07:00

From an asp page called Search.asp an Ajax call is triggered with a URL parameter specified in the Data attribute, data: { 'ChkBoxYears': '2001,2012' } but no values are found in the called program Request("ChkBoxYears")

Can anyone shed any light on this behavior?




Pass c# array to javascript array in razor file ...

2017-07-21T17:24:34.29-07:00

Hi everyone, I need someone to explain me how to pass the strings of an array, obtained in server-side c #, in a javascript array of strings inside a razor file. I am developing in ASP.NET core MVC. I'm crazy, it looks like a simple thing, following what I've tried to do:

@{

 string[] fieldsList = ViewData["FieldsList"] as string[];

@}


Paolo




Get Id of Current User

2017-07-21T18:56:07.76-07:00

Hi Devs, 

I´m trying to get the Current User Id so I can make a search in my Users object to find witch user is logged in. I try the following code:

public async Task login(Login login)
        {
            if (ModelState.IsValid)
            {

                var resultadoLogin = await login_Manager.PasswordSignInAsync(login.Username, login.Password, login.LembrarUsuario, false);
                if (resultadoLogin.Succeeded)
                {
                    var current_User= user_Manager.GetUserAsync(HttpContext.User);
                    string current_User_Id = "" + current_User.Id;

                    User user= _context.Users.FirstOrDefault(x => x.Id == current_User_Id );

                    return View("~/Areas/Module/Views/Home/Index.cshtml");
                }
                else
                {
                    ViewBag.login_Error= "Incorrect username or password";
                    return View("~/Areas/Module/Views/Users/Login.cshtml", login);
                }

            }
            return View("~/Areas/Module/Views/Users/Login.cshtml", login);
        }

I noticed that the value of currer_User_Id is always changing when I run the application and the user variable is always returning null because the id doesn´t match.

Best Regards




How to customize a report that exclude a certain value from a field?

2017-07-21T20:44:16.94-07:00

Sorry, I'm new to Crystal Reporting....

I'm pulling a report that provides me employee names but I don't want to include any employee name containing the first value of the name starting with G. How can I customize the report that exclude that certain value from populating in the field?

Sorry I might have the wrong terminology please correct me if i'm wrong.

Thanks

version: Crystal Report Version 2013




How to generate a pdf from a List<> and export it to excel

2017-07-21T18:31:06.007-07:00

Hello,

On my mvc application I want to implement a report button that would generate and display a pdf with data on it. The data is stored in a List<> which contains multiple columns, but I only want to display certain column on the report such as (subscriber id, payment date, amount, first and last name), then I would like to display the total of the amount at the bottom (which is not in the list).

I also would like to only display the report in a popup modal (if possible) and not automatically save or create the file to the user's local machine but give them option to either print it or export it to either pdf or excel.

I'm not really sure how to start on this, I've been looking into some tools like iTextSharp, but I couldn't find a good example or documentation the could help me accomplish what I'm trying to do.

NOTE: I'm not using entity framework on my application.




Clickable img in webgrid column only first row works

2017-07-21T19:24:57.687-07:00

Hello, I have a webgrid that display an img if data exist. The img is clickable and when clicked it triggers an ajax call. My question is how come it only works on the first row and on the other rows it doesn't even trigger the ajax call var gridColumns = new List();     gridColumns.Add(PaymentGrid.Column(columnName: "WavFile", header: " ", format:@        @if (item.WavFile != null && item.WavFile != "")        { (image)  }        else        { @Html.Raw("(image) ") })); This is my ajax call: I know the data exist on each clickable button because I have the wave file directory displaying on hover. I'm not sure why it only works on the first row. Thank you [...]



Help with adding codes to service contract and controller

2017-07-21T20:21:47.457-07:00

I have the following codes and would like to add it to my service contract interface and
add data value via controller. Can I put this code into the service contract interface and from the controller pass the record to the service contract interface.

Please share your expertise on this issue. Notice it has the viewmodel please be detailed with answers.

List dataVM = new List( );

var dataRecord = (from x in conn.datatable
Order (fieldID)
Select new TableNameViewModel
{

Field1 = dataRecord.Field1,
Field2 = dataRecord.Field2,
Field3 = dataRecord.Field3,

});

dataVM.AddRange( dataRecord );



Membership provider issue after deployment

2012-10-07T14:03:08.577-07:00

Hi'

Just deployed my mvc app to a server, I have 4 services running on the server with a Connection to the DB - works fine. when I try to login ( using the Membership.ValidateUser I always get false, same goes for trying to register a user ( Does not work). In the DB I have ApplicationName ="/". My relevant configs are:




type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LargainDb"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
applicationName="/" />





type="System.Web.Profile.SqlProfileProvider"
connectionStringName="LargainDb"
applicationName="/" />





applicationName="/"
name="AspNetSqlRoleProvider"
type="System.Web.Security.SqlRoleProvider" />
name="AspNetWindowsTokenRoleProvider"
type="System.Web.Security.WindowsTokenRoleProvider" />

I tried practically everything, nothing works, Can anyone help? Im desprerate. 




SQL Select from textbox and dropdown

2017-07-21T19:44:00.14-07:00

Hi guys I have the following situation: I have a form with two textboxes and two dropdownlist. The textboxes are start date and the other end date. The dropdowns are list of clients and the other list of employees. What I need is to click the button it searches the database for the date results between TbxStartDate and TbxEndDate of the CbxClient client registered by the CbxEmployee employee. For this I did the following: '---------------------- Advanced search ----------------------------- Sub AdvancedSearch() Con = New OleDbConnection(StrCon) Cmd = New OleDbCommand("SELECT * FROM TabServices WHERE (TabServices.ServiceDate>=#" + TbxStartDate.Value + "# And TabServices.ServiceDate<=#" + TbxEndDate.Value + "#) AND ClientCod=" + CbxClient.SelectedValue() + " AND EmployeeCod=" + CbxEmployee.SelectedValue(), Con) Con.Open() Dtr = Cmd.ExecuteReader(CommandBehavior.CloseConnection) RptServices.DataSource = Dtr RptServices.DataBind() Con.Close() End Sub '---------------------- Bind Dropdowns ----------------------------- Sub BindClients() Con = New OleDbConnection(StrCon) Cmd = New OleDbCommand("SELECT * FROM TabClients WHERE ClientActive = True ORDER BY ClientName ASC", Con) Con.Open() Dtr = Cmd.ExecuteReader(CommandBehavior.CloseConnection) CbxClient.DataSource = Dtr CbxClient.DataTextField = "ClientName" CbxClient.DataValueField = "ClientCod" CbxClient.DataBind() CbxClient.Items.Insert(0, "Select client...") Con.Close() End Sub Sub BindEmployees() Con = New OleDbConnection(StrCon) Cmd = New OleDbCommand("SELECT * FROM TabEmployees ORDER BY EmployeeName ASC", Con) Con.Open() Dtr = Cmd.ExecuteReader(CommandBehavior.CloseConnection) CbxEmployee.DataSource = Dtr CbxEmployee.DataTextField = "EmployeeName " CbxEmployee.DataValueField = "EmployeeCod" CbxEmployee.DataBind() CbxEmployee.Items.Insert(0, "Select employee...") Con.Close() End Sub
Data  
Cliente
Estafeta
<%# DataBinder.Eval(Container.DataItem, "ServiceCod") %> | &l[...]



ASP.Net Web Site Administration Tool Issue

2012-09-27T14:43:12.613-07:00

Greetings all. I hope I am posting this issue to the correct forum.  I had a tough time determining where it belonged, but this seemed reasonable. I am absolutely stuck with a strange issue concerning the ASP.Net Web Site Administration Tool.  First let me detail the provider installation. I created a provider data store via aspnet_regsql.  I then editted web.config for my test web application to reference that database. Next, under IIS, I have created a web application for the tool (.Net 4.0 version) so that I can access via a URL: http://localhost/webadmin/default.aspx?applicationPhysicalPath=C:\Inetpub\wwwroot\Test&applicationUrl=/Test When I browse to the URL, the admistration tool does indeed load.  I can then navigate to all tabs EXCEPT the Security tab.  When I click on that tab, I am meet with an error: There is a problem with your selected data store...  Value cannot be null.  Parameter name: Path If I go to the Provider tab, I can sucessfully test the membership and role providers.  If I run my test application, I can sucessfully register a new user and see that user in the data store.  It just baffles me that I cannot open the Security tab to assign roles.  The really weird thing is that I can configure/run this app on my dev laptop (Windows 7, SQL Server 2008), and the Security tab is not an issue.  But on the web server... Here are a few details about server.  The server is running Windows Server 2003 Enterprise.  ASP.NET version 4.0.30319.0 is installed.  The database server is SQL Server 2005. The provider related sections of the web.config are as follows:               The event log entry for the issue is as follows: Event Type: Error Event Source: ASP.NET 4.0.30319.0 Event Category: None Event ID: 1325 Date: &nbs[...]



Help with updating a record using controller and service.contracrs

2017-07-21T19:58:34.837-07:00

Please help with me updating a record by passing data directly to the service contract interface.

Current code in controller
Using ( DatabaseConn _dbase = new DatabaseConn())
{
DatabaseTableName _update = DatabaseConn.TableName.Find(recordId);

_dbase.field1 = model.field1;
_dbase.fiels2 = model.field2;
_dbase.field3 = model.field3;
_dbase.........;
DatabaseConn.SaveChanges( );

}

I would like to add the above code to a service.contract where My controller passes a row of data to be
updated it the service contract which is a interface class. I will need the steps for the service interface and controller.

Thanks much




Which one to choose Web Service / WCF / WebAPI

2017-07-10T16:58:19.557-07:00

Hi All,

Am working on a web application(normal Asp.net and SQL server) where each user action need to be captured. Like search, edit , delete, login and logout. To reduce the load on the current DB and application, am planning to write down a separate web service/WCF/WebAPI which will take all necessary parameters and writes into separate DB table to log all these data.

Can any one suggest which one is best approach or design architecture?




Construct a Tree Node with dapper

2017-07-19T17:45:33.9-07:00

HI 

Can any one help me how to create a Tree structure using dapper in asp.net webforms.




If Not IsPostBack with query string

2017-07-21T17:45:57.117-07:00

Ispostback is still confused me.

For example, I use query string to pass values from A.aspx to B.aspx like below code.

In B.aspx page load event, do I need add code "If Not IsPostBack Then...End If" ?

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then
Dim sCAMPUS As String = Request.QueryString("OrderName")
Dim sDATE1 As String = Request.QueryString("OrderDate")

End If

End Sub




Menu Color

2017-07-20T10:40:23.863-07:00

Hello Im using this code