Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all 3938 articles
Browse latest View live

Web API integration into MVC

$
0
0
Hi,

I am part of a MVC Web application that contains a Web API. Unfortunately, as I am new to MVC, could the experts out there help me how to integrate the WebAPI into my MVC please?

Thanks

Re-Developing asp.net webform to MVC

$
0
0
Hi Professionals,

We have a complex application developed in asp.net web forms and ajax. the Application is very heavy and contains many complex functions. Lengthy (Header/details) forms, Complicated Gridviews and all supported with ajax controls.

the application has been enhanced for the last 10 years to keep it with the latest tehnology and trends.

we are planning to do major enhancement to the application - converting it to HTML5 and jquery/bootstrap

the developers advising to re-develop the application in MVC because it is fully support jquery/callback and bootstrap

I am not sure if we can go to in this direction or not. the current application is event based. most of the events are handled in the server side. for example we have a form with many sections being displayed or hidden based on a selection from multiple dropdowns. for that we are using asp.net panel with visible property.

and we have other screens with gridviews loading huge data (more than 50,0000 rows) and we used the gridview built-in paging and sorting. beside we also have nested grids (Expand/Collapse) for each row of the parent grid


I am not sure if all of these functionalities can be achieved by MVC/Bootstrap.

could you please, advise.
Hussain Mohammed Saleh Attiya
ISP Technical Manager
Atyaf Telcom - Bahrain

Error when generating SSRS report: The execution failed for the shared data set 'ReadableFilter'. (rsDataSetExecutionError) Query execution failed for dataset 'DataSet1'. (rsErrorExecutingCommand)

$
0
0
Hi All,

I am calling an SSRS report, that report is calling a stored procedure, the stored procedure takes the date range values, I have modified the stored procedure to take multiple date ranges as string paramter, and store procedure works when I pass string of multiple date ranges as parameter. But when I try to pass those same parameters as string to the SSRS report parameter, it doesn't work and gives me the following error.
The execution failed for the shared data set'ReadableFilter'. (rsDataSetExecutionError) Query execution failed for dataset 'DataSet1'. (rsErrorExecutingCommand)
But I am not finding the rsDataSetExecutionError dataset, and another hint is when I try to run this on my local machine report project, it gives me little different error message that
Execution failed for the shared Data set readable filter, Query execution failed for DataSet1. Invalid length parameter passed to LEFT or SUBSTRING function.

One more thing is when I pass single date range it works, the single date range may be like this: (11/01/2016,11/30/2016 or even 11/01/2016,11/30/2016;)
The multiple Date range looks like this: (11/01/2016,11/30/2016;10/01/2016,12/31/2016;) for above the single Date range for both values Stored Proc and Report both work
But for the multiple date ranges on Stored Proc works but not the Report and gives me the above errors what I mentioned.

I am trying to find where this LEFT or Substring function is used by opening the rdl file, I couldn't find it, and I am trying if ReadableFilter is using any restrictions, it is not showing anything in the Filter Section, I tried by checking the datatype and function of the Parameter to see if it has any restrictions for length, no I couldn't see any much difference but the Parameter datatype is defined as Text. Not finding any reason or where to look.

Any help would be much helpful, thanks in advance my friends.
 
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."

blocking malicious bots (but not SEs) with web.config

$
0
0
Hello, our company website is getting hit hard from malicious bots. I wish to propose a solution which involves changes to our web.config file. The trick is that I wish for the general search engine traffic to continue; I'm just interested in preventing the malicious bots.

This is an example of what I'm seeing online:
http://blog.arvixe.com/how-to-block-malicious-bots-and-spiders-in-web-config

The author seems to be restricting all search engines. Is this correct? If so, does anyone have an alternative that will allow for general search engine traffic to visit but restrict specific malicious bots? (I'd prefer to edit the web.config, since I don't believe that malicious bots care about the robots.txt file.)

Thanks!

Help please how to run dlls or activex controls on the intranet zone without pop-us without changing IE's intranet zone settings?

$
0
0
Good day

We have the requirement to invoke a Microsoft Outlook Meeting request from an Intranet web page without having the following (well known) message:

An ActiveX control on this page might be unsafe to interact with other parts of this page. Do you want to allow this interaction?

We want to use the standard installed (client side) Microsoft outlook libraries for that.

We do not want to relax the Local intranet Zone in IE by means of the standard resolution method of enabling the “Initialize and script ActiveX controls not marked as safe for scripting” Setting.

This is a simplified version of the code, the message is invoked by the highlighted portion<body><formid="frmScheduleAMeeting"runat="server"><div><inputid="btnScheduleTheMeeting"type="button"value="Schedule the meeting"onclick="ScheduleTheMeeting()"style="width: 200px"/></div></form> <scripttype="text/javascript">function ScheduleTheMeeting() {//Reference to Outlook.Applicationvar theApp;//Outlook.mailItemvar theMeeting;var theApp = new ActiveXObject("Outlook.Application");    //  -- this is where we get the errorvar objNS = theApp.GetNameSpace('MAPI');var theMeeting = theApp.CreateItem(1); // value 0 = MailItem, 1 = meeting
            theMeeting.Subject = "Will this time suit you?";
            theMeeting.Location = "Your Office";
            theMeeting.Recipients.Add("someone@microsoft.com");
            theMeeting.Start = "01/01/2017 10:00:00"
            theMeeting.End = "01/01/2017 11:00:00" 
            theMeeting.ReminderMinutesBeforeStart = 15;   // Number of minutes before the event for the reminder            theMeeting.BusyStatus = 1;                    // Makes it appear bold in the calendar
            theMeeting.AllDayEvent = false;
            theMeeting.BusyStatus = 1; 
            theMeeting.Save();
            theMeeting.Display();
            theMeeting.Recipients.ResolveAll();
            theMeeting.Save();
        }</script></body>


We have tried to mark it safe in the registry as safe for scripting (7DD95801-9882-11CF-9FA9-00AA006C42C4) and safe for initializing from persistent data (7DD95802-9882-11CF-9FA9-00AA006C42C4).
https://msdn.microsoft.com/en-us/library/aa751977(v=VS.85).aspx

This is the registry setting we used (the one is the standard GUID for outlook, the other is the GUIDwe get when we add a reference to mso.dll in a VS.net windows form Application

[HKEY_CLASSES_ROOT\CLSID\{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}]
[HKEY_CLASSES_ROOT\CLSID\{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}\Implemented Categories]
[HKEY_CLASSES_ROOT\CLSID\{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]
[HKEY_CLASSES_ROOT\CLSID\{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}] 
[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}]
[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\Implemented Categories]
[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]
[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]

Any ideas on what else to try?

Different behavior firefox, chrome, safari

$
0
0
I wrote an application in asp net (3.5).
From an .aspx page should be interfaced a script in asp.
I meant that the aspx page after viewing waits X seconds and then using HTTPRequest and POST call the asp page.
In the aspx page I inserted a timer that delays the execution of the asp page X seconds.
When I use firefox working properly, while chrome is in the loop, that is the status bar see that continually draws the current page without stopping, ending only when I close the course page.
Searching the net I saw that chrome and safari have some incompatibility.

Where did I go wrong ?

What can be done to solve this problem, taking into account that I can not replace the ASP page with an .aspx, because it uses COM objects that do not know the features?

Someone enlighten me !!!

How HMAC authentication works for web api

$
0
0
just was reading a article on web API with HMAC authentication from this url http://www.piotrwalat.net/hmac-authentication-in-asp-net-web-api/

if possible some one briefly discuss what is HMAC authentication and How this type of authentication works for web api ?

what i understood from their article that client will have a secret key and when client will request web api service then they will send hash of secret key along with request and web service will compare the hash and if match then it allow to call action ?

if i understood correctly then i have some question. suppose if am sending hash of a secret key to web api then how web api know what key client have ? because if web api has to generate hash of secret key what client used for comparing at service end then web api has to know which client is sending data.

there is change of Replay attack for HMAC authentication for web api

the article raise some points which is not clear to me to prevent the chance of Replay attack for HMAC authentication for web api.

the points are

Imagine a malicious third party intercepts a valid (properly authenticated) HTTP request coming from a legitimate client
(eg. using a sniffer). Such a message can be stored and resent to our server at any time enabling attacker to repeat operations
performed previously by authenticated users. Please note that new messages still cannot be created as the attacker does not
know the secret nor has a way of retrieving it from intercepted data.

1) requests with different Date header values will have different signatures, thus attacker will not be able to modify the timestamp

we will generate hash based on secret key then how date comes to scene ? this points is not clear to me.

2) we introduce a requirement that no http request can be older than X (eg. 5) minutes - if for any reason the message is

delayed for more than that it will have to be resent with a refreshed timestamp.

point two is not clear. what this area try to mean delayed for more than that it will have to be resent with a refreshed timestamp.
tbhattacharjee

How OAuth is used to secure web api

$
0
0
normally these days many web site provide OAuth to login to their web api but how we can use the same oauth for web api ?

client will send user id and pwd in plain text to web api and web api will send those client credentials to oauth site ?

if user credentials found right then OAuth will send token to web api and web api will send token to client and from the next subsequent call web api will use the same token for each request...........am i right ?

if my thinking is wrong then just briefly tell me how oauth is used with web api and how client send their credentials and how get token etc. thanks
tbhattacharjee

Error Bind is not declared

$
0
0
Hy all,
i have:

<asp:ButtonID="ButtonCheckIN"runat="server"Text="Edit"CommandArgument='<%# GetBLText(Bind("BL_MODULE").AsEnumerable(), "UN_ML_ID")%>' CommandName="CheckIn" />


When I run it, it throws error saying "'Bind' is not declared. It may be inaccessible due to its protection level". Can you help me?

Need help creating a signature form

$
0
0
Does anyone know how to create a signature form in asp.net where a person signs in a blank space and then saves the signature and then it sends an email to another person to approve.

Trouble accessing simpe WCF web service deployed to local IIS

$
0
0
The web service is deployed to IIS (it runs fine when I test which runs a temp iisexpress hosted session via debug menu) and then I try to access the URL for the service and get the following error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Info:
Moduele IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070021
Coding error This configuration file section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config file \\?\C:\inetpub\wwwroot\WCFService1\web.config
Requested URL http://localhost:80/WCFService1/
Physical Path C:\inetpub\wwwroot\WCFService1\
Logon Method Not yet determined
Logon User Not yet determined



The web.config file is:


<configuration>
<system.web>
<compilation targetframework="4.0">

<system.servicemodel>
<behaviors>
<servicebehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<servicemetadata httpgetenabled="true">
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<servicedebug includeexceptiondetailinfaults="false">



<servicehostingenvironment multiplesitebindingsenabled="true">

<system.webserver>
<modules runallmanagedmodulesforallrequests="true">
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directorybrowse enabled="true">



I went according to the “publish” wizard from the “build” menu. And I created the profile for deployment and the deployment said success. So I am not sure what I need to do additionally or correct. I also am concerned I do not see any endpoints listed in the web.config file. I plead ignorance since this is WCF and I am not sure what happens behind the scenes.

Thanks in advance,
-Scott Kay
"Matthews... we're getting another one of those strange 'aw blah ess spa nol' sounds from dolphin number three?"

How to protect my web api against reply attack

$
0
0
i read few articles like how to secure web api. they are saying client and server will share some secret key . client will create a has value of secret key and send it to web api always when calling web api action. web api action will create a hash value of secret key and compare that value against client sent has value. if match then client will allow to call web api action.

suppose a attacker can capture the client request and send the same hash data to web api then how could we protect this ?

from some where i found this below trick to protect it. they said

1) requests with different Date header values will have different signatures, thus attacker will not be able to modify the timestamp

we will generate hash based on secret key then how date comes to scene ? this points is not clear to me.

2) we introduce a requirement that no http request can be older than X [eg. 5] minutes - if for any reason the message is delayed for more than that it will have to be resent with a refreshed timestamp.

point two is not clear. what this area try to mean delayed for more than that it will have to be resent with a refreshed timestamp. when client will send first request and then client may send second request after 10/15 minute later.

please help me to understand how to protect web api when using HMAC hasing against Replay attack. anyone can explain it nice like how to protect web api with HMAC hashing thanks
tbhattacharjee

Regarding MVC 6 and asp.net core

$
0
0
i have few basic questions on mvc6.

1) i do not know anything about mvc6. so tell me mvc6 means asp.net core ?

2) can we start working with MVC 6 with VS2013 ? if possible then tell me how to start mvc6 project with VS2013 ?

3) if MVC6 does not mean asp.net core then what is the difference between mvc 6 and asp.net core ?

thanks
tbhattacharjee

Paypal notification method

$
0
0
What is the method of IPN method for Paypal GET? or POST?

How to get an answer to your question

$
0
0
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.

  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.

  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"

  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.

  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.

  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.

  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.

  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.

  9. Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.

  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.

  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.

  12. No advertising or soliciting.

  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder

The Code Project Co-founder
Microsoft C++ MVP

HOW TO ANSWER A QUESTION

$
0
0
Apologies for the shouting but this is important.

When answering a question please:
  1. Read the question carefully
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
  3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
  4. If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.

cheers,
Chris Maunder

The Code Project Co-founder
Microsoft C++ MVP

ASP.Net Printing

$
0
0
Hello,

I develop a web application and I want to print an invoice from this application from button called "Print".
My Question is: How to print the invoice on the local device printer (On client side) and without show the print dialog (Print directly to default printer on the Client device).

Thanks All

Single Sign On with ASP.Net Identity

$
0
0
We have existing two MVC applications and an Angular JS application with individual user accounts using Forms authentication. I have been asked to implement a single sign on mechanism using ASP.Net Identity. I'm very much new these concepts. Kindly help me with this implementation. Thanks in advance.

Thoughts about creating some sort of hash for a duplicate online order

$
0
0
In my old programs, I had a problem with duplicate orders, in which customers forgot that they placed an order and do it twice. With MVC, it looks like an order can be placed twice if you hit the back button.

So I was thinking of implementing like a hash code or something, in which I can use data from the cart, and the shoppers identity to create a code that can be recreated and checked against.

I was looking for ideas on this, or feedback thoughts and what I should use to generate the code.

I copy the cart contents to a order table, but decided to leave the cart items until the order is fulfilled or canceled on the back end this time.
 
Globalism is Socialism on a planetary scale.

Quick and Dirty Web Forms

$
0
0
I need a quick and dirty way to capture information that a person would normally have to type or write into a word document. My challenge is that the person inputting the data needs to be able to key the information online, save the information, print to a pdf/word doc and change the information later.
Is there a quick way to do this? I initially thought using FDF (the old pdf form filler), but i have a few concerns. Any other insights would be greatly appreciated. Thanks.
DrMaltz
"The Code King"
Viewing all 3938 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>