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

Regarding paypal web service integration in any asp.net web application

$
0
0
now we have cart and when user click on check out button then we have a code which run and redirect user to paypal web site and from there user purchase.

now i like to show how we pass user selected product data and user details to paypal web site.
here is the sample code
NameValueCollection data = new NameValueCollection();
data.Add("cmd", "_cart");
data.Add("business", "test@gmail.com");
data.Add("invoice", 1);

data.Add("item_name_1", "Audi part1");
data.Add("amount_1" , 200);

data.Add("item_name_1", "BMW part1");
data.Add("amount_1" , 300);

data.Add("item_name_2", "carriage");
data.Add("amount_2" , 500);

data.Add("item_name_2" , "insurance");
data.Add("amount_100" , 100);

data.Add("item_name_2", "VAT Amount");
data.Add("amount_2" , 100);

data.Add("country", "GB");
data.Add("currency_code", "GBP");
data.Add("cn", "How did you hear about us?");
data.Add("upload", "1");
data.Add("address_override", "1");

data.Add("first_name", "customer first name");
data.Add("last_name", "customer last name");
data.Add("address1", "customer address1");
data.Add("city", "customer city");
data.Add("state", "customer state");
data.Add("zip", "customer post code");

data.Add("return", "http://abc.mysite.net/catalogue/order/PayPalSuccess.aspx");
data.Add("cancel_return", "http://abc.mysite.net/catalogue/order/PayPalFailure.aspx");
data.Add("notify_url", "http://abc.mysite.net/catalogue/order/PayPalNotify.aspx");

HttpHelper.RedirectAndPOST(this.Page, "https://www.paypal.com/cgi-bin/webscr", data);


publicstaticvoid RedirectAndPOST(Page page, string destinationUrl, NameValueCollection data)
{//Prepare the Posting formstring strForm = PreparePOSTForm(destinationUrl, data);//Add a literal control the specified page holding the Post Form, this is to submit the Posting form with the request.
    page.Controls.Add(new LiteralControl(strForm));
}


i am interested to know is there any web service paypal offer as a result we can use that and we can pass user and cart data to paypal by calling their web service as a result we can stay in our web site page and do not have to push user to paypal page.

basically i am looking for a way to pass information from my web site to paypal web site internally or silently by using their web service. so just redirect me to relevant paypal page or article which guide me how to use paypal web service if any exist.

please guide me. thanks
tbhattacharjee

Extract numbers with % sign from a string

$
0
0
I need to Extract numbers with % sign from a string.
Example: "50%", "test 100%","ttest 50% test test".
thank you

Constant "from" email address

$
0
0
Hello,

Total stranger to ASP.Net here.

We have been advised by our server hosts that the code attached which is used to send a form to an email recipient should have a single constant "From" email address specified to avoid SPF related issues. At the moment the "From" is retrieved from the email form field.

thanks,
Richard



About Me:
I'm new in this forum, I am a consultant and have worked with multiple firms
You can check Accounting software videos one of my work.

Constant "from" email address

$
0
0
Hello,

Total stranger to ASP.Net here.

We have been advised by our server hosts that the code attached which is used to send a form to an email recipient should have a single constant "From" email address specified to avoid SPF related issues. At the moment the "From" is retrieved from the email form field.

thanks,
Richard



About Me:
I'm new in this forum, I am a consultant and have worked with multiple firms
You can check Accounting software videos[^] one of my work.

Windows IIS Hosting - Upgrading Options From Shared Hosting With a UK Data Centre to Something With Better Performance

$
0
0
Hi,

Hopefully correct forum.

I have been using Discount ASP to host my site for the last 6 years+.

Really pleased with them, great support and works well and they have a UK data centre option.

I was looking at their Everleap service (built on MS Azure), which looks great as it isolates you from most of the brain ache of having a VPS or MS Azure.

But they don't have a UK data centre option for this service, big disappointment!

I am worried that if I use the west coast (I think) US based Everleap service my websites page load times will increase significantly.

So I have two questions....

1 Does anyone know of a similar service to Everleap that has a UK data centre option?

2 Are my concerns regarding increased page load times of a west coast US hosted site overblown?

I already use a CDN for all my static content.

Many thanks to everyone in advance,

Will

What is the difference between integration testing, regression testing and unit testing

$
0
0
i know unit testing but not familiar with integration testing and regression testing.

it will be really helpful if some one explain what is integration testing and regression testing with sample example. thanks
tbhattacharjee

How to convert client local date and time to UTC date and time

$
0
0
suppose i have web UI from where user post issue. our web UI and db hosted in USA pc. now user can appear from any country and post issue.

from my web UI i am sending user issue details and user pc date and time to server side function.

now my question is how could i convert client pc date and time to utc date and time at server side before storing in db ?

again how could i show client date and time in his local date and time if i know client time zone.

so here i have two question how to convert client date and time. for example say i capture client date and time by javascript 25/01/2017 03:08:01 and send it to server side function. now how could i convert client date and time 25/01/2017 03:08:01 to UTC date and time ?

again how could i later convert utc date and time to client local time if i know client timezone.

please help with sample code if possible.

thanks
tbhattacharjee

What we can do with date and time offset data

$
0
0
see here we store offset. so tell me what is the importance of storing offset data along with date and time ?

what we can do with offset data if we store ?

public void DemoDateTimeOffset()
{
DateTimeOffset offsetValue = new DateTime(2017, 1, 21, 4, 34, 0);

using (SqlConnection cn = new SqlConnection(myConnection))
{
string commandText = @"
INSERT INTO DateTimeDemo (DateTimeExample,DateTimeOffsetExample)
VALUES (@DateTimeExample,@DateTimeOffsetExample)";

using (SqlCommand cmd = new SqlCommand(commandText, cn))
{
cmd.Parameters.AddWithValue("@DateTimeExample", DateTime.Now);
cmd.Parameters.AddWithValue("@DateTimeOffsetExample", offsetValue);
cn.Open();
cmd.ExecuteNonQuery();
}
}
}

[screen shot]


thanks
tbhattacharjee

<Projectname>.config in bin folder

$
0
0
Hi,

I'm new to asp.net programming and so may ask simple things - I hope you will help me anyway.

The project (a Webseite with a mix of WebForms and MVC) I have to work on shows a strange behaviour to me:
Everytime I build the project, VisualStudio creates a <projectname>.config file in the bin folder.
The config file looks very simmiler to theh web.config.

I would like to prevent this behaviour. I googled and found a solution, which does not work for me:
"Do not copy"
and
"No build"
in the "extended preferences" (? My VisualStudio is not in English) of web.config.

Does anyone of you have an idea, what I can do to change this behaviour?

All the best,
Markus

Strange behaviour .net 2/4: The object of type "System.Web.UI.WebControls.Label" can not be converted to type "System.Web.UI.WebControls.TextBox".

$
0
0
Hi,

I have a second problem, which is very hard to describe for me.

The project i have to work on was a .net2.0 project. I added MVC and so I had to re-build the whole project with .net4.

I don't know if *that* is the reason for this strange behaviour, but:

On my local development computer everything works fine.
On the productive server (same code), I get
Quote:
ErrorMessage: The object of type "System.Web.UI.WebControls.Label" can not be converted to type "System.Web.UI.WebControls.TextBox".

when a datagrid binds its data from a stored procedure.

It does not make sense to me, but I can't describe the problem better.

If anyone of you have an idea, where I could better or more information, which could lead to a solution.

All the best,
Markus

Display message to the user if no records found?

$
0
0
Greetings all

I am sure I am doing something wrong here.

We have a dropdownlist that has three values, Today, Yesterday and ALL.

There is always a record for today and All.

However, there are times when yesterday falls on Weekends and in some cases, there are no record created for that particular weekend.

In situations such as that, we would like a message to user that there are no records from yesterday.

Does anyone have any ideas why this code is not displaying that message?

Private Sub Bindgrid()
        Dim s As String = ""
        Dim reportType = ddlrpttype.SelectedValue

        conn.Open()
        If reportType = "Today" Then
            s = "SELECT * from mytble WHERE (DATEDIFF(day,CONVERT(datetime,work_request.date, 121),GETDATE()) = 0 ) "
        ElseIf reportType = "Yesterday" Then
            s = "SELECT * FROM mytble  WHERE (DateDiff(Day, Convert(DateTime, work_request.date, 121), GETDATE()) = 1 )"
        ElseIf reportType = "All" Then
            s = "select * from mytble"
        Else
            lblmsg.Text = "No  record found from yesterday.")
        End If'Response.Write(s)
        'Response.End()

        Dim cmd As New SqlCommand(s, conn)
        Dim dr As SqlDataReader = cmd.ExecuteReader()
        reportgrv.DataSource = dr
        reportgrv.DataBind()
        conn.Close()

    End Sub

.config in bin folder

$
0
0
Hi,

I'm new to asp.net programming and so may ask simple things - I hope you will help me anyway.

The project (a Webseite with a mix of WebForms and MVC) I have to work on shows a strange behaviour to me:
Everytime I build the project, VisualStudio creates a <projectname>.config file in the bin folder.
The config file looks very simmiler to theh web.config.

I would like to prevent this behaviour. I googled and found a solution, which does not work for me:
"Do not copy"
and
"No build"
in the "extended preferences" (? My VisualStudio is not in English) of web.config.

Does anyone of you have an idea, what I can do to change this behaviour?

All the best,
Markus

<Projectname>.config in bin folder

$
0
0
Hi,

I'm new to asp.net programming and so may ask simple things - I hope you will help me anyway.

The project (a Webseite with a mix of WebForms and MVC) I have to work on shows a strange behaviour to me:
Everytime I build the project, VisualStudio creates a <projectname>.config file in the bin folder.
The config file looks very simmiler to theh web.config.

I would like to prevent this behaviour. I googled and found a solution, which does not work for me:
"Do not copy"
and
"No build"
in the "extended preferences" (? My VisualStudio is not in English) of web.config.

Does anyone of you have an idea, what I can do to change this behaviour?

All the best,
Markus

Can AngularJS use only with MVC or we can use it with Asp.Net application.

$
0
0
I didnt find any AngularJS example which works with Asp.net web app. Please provide a link / Example

ASP.NET MVC identity

$
0
0
I know that there are many tutorials that explain ASP.NET MVC identity, but I still can't understand how to use it in my project!

I started with an empty template , created instructor and student models. They contain things like name, email, ID and password. I used code first entity framework to create the database. I added controllers and views to allow admin to add instructors , then instructor to add students. Now I want to add login page.

My project requires that only instructors and students added to the database can register, so at the moment they are added they'll receive an email to enter their password and complete registration.Also when a user loges in , I have to know if he is a student or instructor or admin.
Finally,I want to support password recovery and change password.

I know that implementing that might be simple and easy, but I am new to asp.net mvc (or to web development in general),and I started with an empty template so I don't have classes like startup and IdentityConfig.cs.

My question is ,Where should I start from? is there any clear steps that I can follow to implement this easily?

ASP.Net Classic Web Application Problem

$
0
0
Hi All,

I use Visual Studio 2010 to develop a Web Form Application and use the DevExpress Controls in this application, my problem is when I open the design view of a page called index2.aspx which contains many controls it takes a long time ti view the design and the html code repeated and duplicated.
Example: if I have a break line tag
<br/>
in index2.aspx it is duplicated to many lines like this
<br/><br/><br/>


Please let me know how to solve this issue.

Thank You All

i need one live chat session code for asp.net website....

$
0
0
hello..i am a computer science student and this is my final year and i am developing a website for my semester project.in my developing website i am going to implement one live chat session same as like facebook chat using asp.net..i have searched for the code for a lot of times but i didn't get any valid code.so,can you please respond to my problem?i need one live chat session code for asp.net website..please help me... Cry | :((

increment video path files

$
0
0
increment a file path if already exists using mediafire,conversion options and mega data while saving a video in c#

visual studio 2010

$
0
0
how could I scroll image for vb 2010?

Interacting with elements of target webpage

$
0
0
Hello,

I'm building a web application which involves using Google Translation.

The goal is to have the user enter the text into a text-box on my form, and then my code should take that string and enter it into Google Translate and retrieve translation. Any ideas how I can do that? Google Translator doesn't affect URL in any way when a query is entered or when a result is returned. It's completely in-page and URL independent, so I can't do anything there.

Any ideas?? I'm using VB.NEt

Thanks
Viewing all 3938 articles
Browse latest View live


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