16,004,647 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by JasonTsoum77 (Top 57 by date)
JasonTsoum77
11-Feb-22 7:55am
View
Hi friend thanks for your time and your help, I wrotte the code but no errors returned from json url (I aslo test the json from url and no validator errors returned I should mentioned that at firts) but still the exported content to the txt file is not passing the json validator it reurns parse errors
JasonTsoum77
3-Sep-21 11:32am
View
Thank you for your answer and your time friend , I tried it but I receive the following error message "Uncaught Error: Call to undefined function str_starts_with()" I don't why maybe my php version does not contain the function ? instad I trid (strpos($uri, $string)){.....} and it seems that it works but I dont know if this is the correct solution, Thank you again
JasonTsoum77
12-Apr-14 11:14am
View
Thnx for your help, it also work!!!
JasonTsoum77
11-Apr-14 11:41am
View
It worked!!! the first solution "http://imageresizing.net/docs/howto/upload-and-resize[^]"
I modify my code just like that and of I have to install imageresizer (very good util I did't knew it)
Thnx for your help!!!
try
{
int count = 10;
// FileUpload1.PostedFile.SaveAs(path2 + FileUpload1.FileName);
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(FileUpload1.FileName);
string fileExtension = Path.GetExtension(FileUpload1.FileName);
fileNameWithoutExtension = Convert.ToString(count);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/gallery/thumbs/" + fileNameWithoutExtension + fileExtension));
foreach (string fileKey in HttpContext.Current.Request.Files.Keys)
{
HttpPostedFile file = HttpContext.Current.Request.Files[fileKey];
if (file.ContentLength <= 0) continue;
ImageResizer.ImageJob i = new ImageResizer.ImageJob(file, "~/uploads/<guid>.<ext>", new ImageResizer.ResizeSettings("width=20;height=22;format=jpg;mode=max"));
i.CreateParentDirectory = true;
i.Build();
}
Label1.Text = "File uploaded!";
}
JasonTsoum77
11-Apr-14 11:27am
View
Hi Nilesh thnx for your response the second solution I find it too but it didn't worked,
http://stackoverflow.com/questions/254419/asp-net-image-uploading-with-resizing[^]
I have tried many codes from the internet which suppose that they resize an image but nothing,
I will try and the first one that you send and I will inform tou thnx again
JasonTsoum77
13-Feb-14 7:42am
View
Hi OriginalGriff, Thnx for your response I try it but it didn't work ,I just found the problem which is in DateTime format, I try it with your query and I change time1 and time2 to
time1=Convert.ToString(TextBox1.Text); and time2= Convert.ToString(TextBox2.Text) and when I put 1-2-2014 and 2-2-2014 it works, but I want to retrieve the date from caledar thnx again
JasonTsoum77
28-Nov-13 12:05pm
View
Hi Mike yes I see that something is going wrong , thnx to Maciej code I update my code and now it works prefect here it is
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
SqlCommand sqlCommand = new SqlCommand("UPDATE P1 SET P1.price = P2.price - (P2.price * 5/100) FROM Products AS P1 INNER JOIN Products AS P2 ON P1.Id = P2.Id WHERE DATEDIFF(m, P1.[date], GETDATE()) > 12 AND P1.var=1", conn);
conn.Open();
using (SqlDataReader read = sqlCommand.ExecuteReader())
{
while (read.Read())
{
string name = read["name"].ToString();
}
int var = 0;
read.Close();
conn.Close();
}
Thnx for your response
JasonTsoum77
27-Nov-13 13:30pm
View
It worked!!!!!!!!!!!!!!!!!!!!!!!
many many many thnx my friend Maciej for your help!!!!!!!
I try to find a solution for these many days!!!
Thnx again my friend for your valuable help!
JasonTsoum77
27-Nov-13 13:14pm
View
I must generate a new table?
or just I must import as a query the code this code?
thnx in for your help!!!!
JasonTsoum77
27-Nov-13 12:32pm
View
Yes i have it like a flag , i set it to 0 when a discount happens, in order to avoid new discound if the page loads again
JasonTsoum77
27-Nov-13 5:26am
View
thnx for your help the problem was in (trims) from textbox i receinve a string without a trim
but from my sql table i receive a string with spaces for some reason that i don't know.
Thnx for your help again!!!!
JasonTsoum77
27-Nov-13 5:24am
View
thnx for your help i will modify my code as you show me
JasonTsoum77
27-Nov-13 5:23am
View
Thnx for your response and your help my friend, your solution is also
works!!!
JasonTsoum77
27-Nov-13 5:04am
View
Perfect it works!!!
thnx my friend for your help!!!
JasonTsoum77
26-Nov-13 14:26pm
View
Thnx for your help
JasonTsoum77
26-Nov-13 14:25pm
View
Thnx for your help, Now I will try it!
JasonTsoum77
26-Nov-13 14:23pm
View
Great it works I have to change '<' compare to '>' because i want the old products but with your solution it works,
now the only think that i have is to add a discount for the products in column price.
Thnx again for your help my friend
JasonTsoum77
19-Nov-13 17:39pm
View
I have read the documentation tried it but they didn't work in string price, I don't know where is the wrong because I tried with simple strings like
string s = "0123456";
s.remove(0,3);
e.t.c.
and they work properly, I thing that here because I retreiving html is something going wrong and these functions that you refer in your reply (trim,regax) they didn't work.
Anyway thnx for your response.
JasonTsoum77
8-Nov-13 10:24am
View
Thaks again for your help!
JasonTsoum77
8-Nov-13 6:38am
View
Hi Tadit, yes from the toolbox I add the labels but they didn't work I added protected global::System.Web.UI.WebControls.Label L1; because in .cs
I use "namespace FurSiteMs.PDT".
But Finally it worked I delete the whole form and I import every item step by step and once a time.
It is very stupid because the is exactly the same with the previous one (i compare it with beyond compare to see if there are any differences).
Anyway the problem solved with this anorthodox way.
Thnx for your time and your help!
JasonTsoum77
6-Nov-13 10:58am
View
Hi Tadit sorry for my late response I try it, I delete the current labels from aspx,cs and designer.cs and I create news like:
protected global::System.Web.UI.WebControls.Label L1;
but still nothing vs returns "L1 does not exist to the current context".
today I will try to delete the whole form and recreate it step by step to see where is the wrong.
Iam not very experince developer with vs and asp.net/c# but i see that vs has a little problem on handling namespaces...
I will late you know what will be happened.
Thnx for your help
JasonTsoum77
5-Nov-13 12:16pm
View
Hi Sergey first of all thnx for your time and your response!
I know that my code is for a simple file and not for the whole folder i think i mention it at the beginning of my question.
I need somenthing like that in order to upload pictures for specific items in a website where i implement but I see from your post that is very difficult, i sarch in the internet but i didn't find anything to help me, so i decided to change strategy I will try to upload multiple files and create a folder(where the pictures will be upload it) at the same time on my site, I will let you now if this will be work.
Thanks again for your help
JasonTsoum77
5-Nov-13 4:56am
View
Hey! Tadit still nothing with my issue i clean my project i rebuid it but "label.text" still not recognised, in another project where i have similar issue it worked with clean and rebuild it. The final solution which i will try is to recreate the whole project
JasonTsoum77
3-Nov-13 14:00pm
View
Ok I will try it and I will inform you
thnx for your help and your time Tadit
JasonTsoum77
3-Nov-13 13:43pm
View
Oh i'm sorry here it is
StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());
strResponse = stIn.ReadToEnd();
stIn.Close();
// sanity check
Label2.Text = strResponse;
// If response was SUCCESS, parse response string and output details
if (strResponse.StartsWith("SUCCESS"))
{
PDTHolder pdt = PDTHolder.Parse(strResponse);
Label1.Text = string.Format("Thank you {0} {1} [{2}] for your payment of {3} {4}!",
pdt.PayerFirstName, pdt.PayerLastName, pdt.PayerEmail, pdt.GrossTotal, pdt.Currency);
}
else
{
Label1.Text = "please retry";
}
JasonTsoum77
3-Nov-13 13:42pm
View
Yes I'm using but I also try it without membership to see why it's not working but
is not working
JasonTsoum77
3-Nov-13 13:11pm
View
<%@Page Language="C#" AutoEventWireup="true" CodeBehind="PDTSuccess.aspx.cs" Inherits="FurSiteMs.PDT.PDTSuccess" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Thanks for choosing our products , we will be huppy to visit one of our shops!
<br />
<asp:Label ID="Label1" runat="server" Text="Label">
<br /><br />
PDT Response
<br />
<asp:Label ID="Label2" runat="server" Text="Label">
</div>
</form>
</body>
</html>
JasonTsoum77
2-Nov-13 9:06am
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace FurSiteMs.PDT
{
public partial class PDTSuccess
{
///
/// form1 control.
///
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
///
/// Label1 control.
///
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Label Label1;
///
/// Label2 control.
///
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Label Label2;
}
}
JasonTsoum77
1-Nov-13 15:45pm
View
Hi Tradit I tried it but still nothing (in the designer.cs it already have it)
I delete it and I create it again but still nothing.
JasonTsoum77
1-Nov-13 9:42am
View
Hi I don'y know if i'm doing something wrong but i can't find the option with right click on aspx file convert to web application . I'm using Visual studio 2012 so i thing there is the problem.
Any idea how can i do this in vs2012
JasonTsoum77
1-Nov-13 9:13am
View
Hi I don'y know if i'm doing something wrong but i can't find the option with right click on aspx file convert to web application . I'm using Visual studio 2012 so i thing there is the problem.
Any idea how can i do this in vs2012
JasonTsoum77
1-Nov-13 6:05am
View
It works properly now thnx for your help and your response
JasonTsoum77
30-Oct-13 17:29pm
View
Thnx for your response and your help ..it's really annoying-brute force the language localization in asp web site i thought it will be easier but....
JasonTsoum77
22-Oct-13 7:14am
View
thnx for your response and your help it worked
JasonTsoum77
22-Oct-13 7:13am
View
It worked thnx for your resonse and your help,
I will try the second solution you gave me in order to avoid sql injection
thnx
JasonTsoum77
15-Oct-13 16:13pm
View
Exactly.
JasonTsoum77
15-Oct-13 15:56pm
View
I remove ToUpper() but still nothing
it seems that it makes a refresh but still remains in login page without redirect to admin.aspx
JasonTsoum77
15-Oct-13 15:41pm
View
I have try with many senarions like
1)
<allow users="Admin">
<deny users="?">
2)
<deny users="?">
3)
<allow users="Administrator">
<deny users="*">
and many many others but it didn't worked I don't know what else i should try.
JasonTsoum77
15-Oct-13 15:38pm
View
How i should modify the web.config?
JasonTsoum77
15-Oct-13 15:28pm
View
Yes I have set,
thnx for your response
JasonTsoum77
11-Oct-13 17:42pm
View
Yes, alternative is any way to handle this html controls behind with c# code
I mean is any way to set value="product1" and value="100" with c# code?
(These are html controls)
Thnx for your response
JasonTsoum77
4-Oct-13 15:16pm
View
It worked thank you very much for your help and your response!!! Azee
JasonTsoum77
4-Oct-13 15:15pm
View
It worked!!! Thank you very much for your help
JasonTsoum77
3-Oct-13 15:11pm
View
Hi Azee thank you for your response and your help
I remove (while loop) but now it didn't send nothing!
what else i shooul try?
thank you again for your help!
JasonTsoum77
3-Oct-13 13:17pm
View
it workded!!!! Thank you for your help
JasonTsoum77
3-Oct-13 11:25am
View
well i try it but i receive null reference exception
here is my whole code
----------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using System.Net;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using System.Text;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Btn_SendMail_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
string asql = "SELECT quantity from products";
int val = Convert.ToInt32(Request.QueryString["quantity"]);
try
{
con.Open();
SqlCommand query = new SqlCommand(asql, con);
foreach (ListViewDataItem item in ListView1.Items)
{
int quantity = Convert.ToInt32(ListView1.DataKeys[item.DisplayIndex]["quantity"].ToString());
if (quantity < 5)
{
MailMessage mailObj = new MailMessage(
"from", "to", "Product low quantity", "your product has low quantity");
SmtpClient SMTPServer = new SmtpClient("localhost");
try
{
SMTPServer.UseDefaultCredentials = false;
SMTPServer.Host = "smtp.gmail.com";
SMTPServer.Port = 587;
SMTPServer.Credentials = new NetworkCredential("email", "password");
SMTPServer.EnableSsl = true;
SMTPServer.Send(mailObj);
}
catch (Exception ex)
{
// Label1.Text = ex.ToString();
}
}
}
}
finally
{
con.Close();
}//end of reduce quantity
}
}
----------------------------------------------------
JasonTsoum77
3-Oct-13 9:00am
View
yes but how can i retrieve it to c# from asp
JasonTsoum77
3-Oct-13 8:59am
View
yes
JasonTsoum77
1-Oct-13 15:21pm
View
i try but it is very confusing
how can i parse my data frpm my shopping cart (id,name,price) to paypal checkout
JasonTsoum77
1-Oct-13 15:21pm
View
i try but it is very confusing
how can i parse my data frpm my shopping cart (id,name,price) to paypal checkout
JasonTsoum77
26-Sep-13 8:10am
View
yes i have tried because i suspend something like that but all the variables had the correct values.
I tried the following solution from Karn Singh and that solved the problem.
It was very strange problem because when i tried it seperetally my code worked properly.
Thnx for your response
JasonTsoum77
26-Sep-13 3:03am
View
It works!!!! thank you very much Karn for your help and your response!!!
JasonTsoum77
25-Sep-13 12:22pm
View
well here is the whole project i have a shopping cart (cart.aspx) where i collect the products for selling when the customer push the button finish i redirect to another form (finish.aspx) where the customer choose the pay method and the (product quantity must be reduced).
My problem is I import the code that i post in finish.aspx and for some reason the product quantity reduces two times , for example if the customer select quantity 2 in my database it reduces quantity 4.
It is very strange problem and i haven't see anything else like this...thnx for your resoinse
JasonTsoum77
25-Sep-13 11:21am
View
for example in infoproducts.aspx
when i prees the button next then :
Response.Redirect("finish.aspx?ID=" + Request.QueryString["Id"] + "&quant=" + Request.QueryString["quant"]);
JasonTsoum77
25-Sep-13 11:17am
View
No i'm retrievig it from another form (inforproduct.aspx) where the page send
"id" and "quantity" from the product.
i try debug mode with brakes and quantity has the correct value, but always reduses x2
thnx! for your response
JasonTsoum77
24-Sep-13 9:50am
View
Thank you for your help
JasonTsoum77
24-Sep-13 9:50am
View
Thank you for your help
Show More