16,013,322 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 brighteyes24 (Top 39 by date)
brighteyes24
26-Sep-13 7:45am
View
thank you.. I got it now.. you given me idea.. the correct codes is String imgPath="~/Albums" + subfolder + "/" + imgName; you lack positive(+) operator..but anyway (Y) thank you..I can proceed now to my project..You save my life..you solve my problem..thank you once again.. your'e my idol..more power to you..
brighteyes24
25-Sep-13 14:41pm
View
my complete codes is below..I write the complete codes In solution 2. I stuck in this part. "string imgPath = "~/Albums/" + subfolder + imgName;"
likewise check my codes under private void StartUpLoad()...I stuck there..tnx..need help badly.
brighteyes24
25-Sep-13 8:36am
View
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Upload Image</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br /><br />
<asp:Button ID="Button1" runat="server" Text="Create New Directory"
onclick="Button1_Click" />
<br /><br />
<asp:Label ID="Label1" runat="server" Text=""> <br /> <br />
<asp:Label ID="lblFolderName" runat="server" Text="Folder Name">
<asp:TextBox ID="txtFolderName" runat="server"> <br /><br />
<asp:Label ID="lblUploadPhoto" runat="server" Text="Upload Photo" style="margin-left:80px"> <br />
<asp:Image ID="imgPhoto" runat="server" Width="100px" Height="80px" style="margin-left:80px"/> <br />
<asp:FileUpload ID="fileUpload" runat="server" style="margin-left:80px"/> <br /> <br />
<asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" style="margin-left:80px" /> <br /> <br />
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.IO; //additional namespace is required for io operations
using System.Data.SqlClient;
using System.Data.SqlTypes;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lblFolderName.Visible = false;
txtFolderName.Visible = false;
btnSave.Visible = false;
}
private void CreateDirectoryIfNotExists(string NewDirectory)
{
try
{
// Checking the existance of directory
if (!Directory.Exists(NewDirectory))
{
//If No any such directory then creates the new one
Directory.CreateDirectory(NewDirectory);
Label1.Text = "Directory Created";
}
else
{
Label1.Text = "Directory Exist";
}
}
catch (IOException _err)
{
Response.Write(_err.Message);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
lblFolderName.Visible = true;
txtFolderName.Visible = true;
btnSave.Visible=true;
Label1.Visible = false;
}
protected void btnSave_Click(object sender, EventArgs e)
{
string NewDirectory = Server.MapPath("~/Albums/" + txtFolderName.Text);
//New Directory Name in string variable
CreateDirectoryIfNotExists(NewDirectory);
//Calling the function to create new directory
Label1.Visible = true;
FileUpload img = (FileUpload)fileUpload;
Byte[] imgByte = null;
if (img.HasFile && img.PostedFile != null)
{
//To create a PostedFile
HttpPostedFile File = fileUpload.PostedFile;
//Create byte Array with file len
imgByte = new Byte[File.ContentLength];
//force the control to load data in array
File.InputStream.Read(imgByte, 0, File.ContentLength);
// Insert the profile records into db
string conn = ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString;
//string conn = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Coldwind.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
SqlConnection connection = new SqlConnection(conn);
// SqlDataReader dr = new SqlDataReader();
string fname = fileUpload.FileName.ToString();
string FolderName = txtFolderName.Text.Replace("'", "''");
brighteyes24
25-Sep-13 7:52am
View
ok..i will send the codes..complete..
brighteyes24
25-Sep-13 7:34am
View
yah your right. the codes show creating directory and sub-directory..the image also save into main directory (Albums directory).My question is how to save the image into sub-directory..maybe there is lack in my codes..need to modified or whatever..
brighteyes24
24-Sep-13 16:43pm
View
i tried that already. I had read already that article..but still not working..
brighteyes24
16-Sep-13 12:34pm
View
yes by id..for example i want to delete an item inside the listview using command button..
brighteyes24
19-Aug-13 11:42am
View
can you give me the codes for an idea of this..just a sample codes..and let me modify it..so that i may be enlighten..i am just newbe of asp.net and c#..thanks..
brighteyes24
18-Aug-13 10:01am
View
what do you mean? whats this link..?
cannot be open..
brighteyes24
17-Aug-13 15:14pm
View
the scenario is this..lets say we have 2 accounts name john and mark..if john log-in he can upload photos and view as well..but if mark log-in to upload a photos, still the photos of john appear..what i mean is that if john log-in, only john can view his photos and likewise with mark..I mean there should be a privacy..how to do that..?
brighteyes24
17-Aug-13 12:53pm
View
not facebook or twitter..the website i make..i make a website where in you can create an account..you can log-in to your account and upload photos...
brighteyes24
17-Jul-13 15:22pm
View
i tried this code but doesnt work..thank u murali0195
brighteyes24
9-Jul-13 7:55am
View
do you have article for this? i have an article about this but when i play it wont work..it saves only in database...
brighteyes24
29-Jun-13 7:54am
View
i tried this link.but doesnt work...i want to get the value of image from the gridview..
brighteyes24
26-May-13 13:46pm
View
its not my intention to spam..im not expert about this forum style..im still learning..dont you have manners?
brighteyes24
26-May-13 13:36pm
View
who are you?are you an admin here?
brighteyes24
26-May-13 13:36pm
View
they dont get my question.they dont get my codes. that is why i simplify my question.in order to understand..
brighteyes24
26-May-13 13:26pm
View
i just want an idea..it is a forum..i need only idea..if u have an idea pls share..if none just ignore..its none of ur business..i am only concern to those who have a good heart that willing to share thier knowledge
brighteyes24
26-May-13 12:30pm
View
how to remove the above code?
brighteyes24
26-May-13 12:29pm
View
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<HeaderTemplate >
<table style="border-left-color:#75A4A4; border-left-style: solid; border-left-width: 2.5px; border-top-style: solid; border-top-width: 2.5px; border-top-color:#75A4A4;" width="570" >
</HeaderTemplate>
<itemtemplate>
<tr style="border-right-color:#669999">
<td>
<asp:Label ID="lblDate" runat="server" style="border-bottom-color :#719F9F; border-bottom-style: solid; border-bottom-width: 2.5px;" Font-Size="11" Font-Bold="true" ForeColor="white" TextMode="MultiLine" Rows="0" Enabled="False" ReadOnly="True" BackColor="#669999" Wrap="True" Height="18px" Width="570px" BorderWidth="0px" Text='<%#Eval("Date") %>' /> <br />
<asp:Label ID="lblTime" runat="server" style="border-bottom-color :#719F9F; border-bottom-style: solid; border-bottom-width: 2.5px;" Font-Size="11" Font-Bold="true" ForeColor="white" TextMode="MultiLine" Rows="0" Enabled="False" ReadOnly="True" BackColor="#669999" Wrap="True" Height="18px" Width="570px" BorderWidth="0px" Text='<%#Eval("Time") %>'/> <br /> <br /> <br />
<asp:TextBox ID="txtTitle" runat="server" Font-Names="Times New Roman" Font-Size="25px" ForeColor="white" Font-Bold="true" Rows="0" TextMode="MultiLine" Enabled="False" ReadOnly="True" BackColor="#669999" Wrap="True" Height="70px" Width="570px" BorderWidth="0px" style="text-align:center" CssClass="NoresizeTextBox" Text='<%#Eval("Title") %>'/> <br />
<asp:ImageButton ID="ImageButton1" runat="server" BackColor="#669999" ImageUrl='<%#Eval("ImageName", "~/NewsFeedImages/{0}") %>' Height="150px" Width="150px" style="margin-left:210px; cursor:pointer" OnClientClick="return LoadDiv(this.src);" Title="View Image" />
</td>
</tr>
<tr style="border-right-color:#669999;" >
<td class=" comment more" <asp:TextBox ID="txtArticle" runat="server" style="text-align:left;" ForeColor="white" Font-Size="13" Wrap="true" TextMode="MultiLine" Enabled="true" ReadOnly="True" BackColor="#669999" Width="570px" Height="100px" BorderWidth="0px" CssClass="NoresizeTextBox" Text='<%#DataBinder.Eval(Container.DataItem,"Articles").ToString() %>'>
</td>
</tr>
<tr>
<td style="border-bottom-style: solid; border-bottom-width:2px; border-bottom-color: #75A4A4;">
<br />
</td>
</tr>
<footertemplate>
</table>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString25 %>"
SelectCommand="SELECT [Title], [Articles], [Date], [Time], [ImageName] FROM [NewsFeedTbl] ORDER BY [id] DESC">
<div style="margin-left:200px; width: 756px;">
<br />
<asp:Label ID="lblNewsFeed" runat="server"
brighteyes24
23-May-13 16:14pm
View
thank you sir..it helps a lot on me..
brighteyes24
23-May-13 15:59pm
View
yes i store..but i dont know the codes for this..can you give me idea sir..
brighteyes24
23-May-13 15:46pm
View
I have folder name Images.all photo or images uploaded will store in the Images folder..of course different filename are uploaded..now if i want to delete that particular account and remove also the photo that save in Images folder..how can it be?
brighteyes24
23-May-13 15:35pm
View
Deleted
can you give me a codes for this sir..
brighteyes24
23-May-13 15:34pm
View
can you give me codes for this sir?
brighteyes24
23-May-13 15:21pm
View
SomeFile.txt is a fix file that to be deleted..what if the user upload another image file, another filename..?and i want to delete the new image filename that has been uploaded..
brighteyes24
23-May-13 15:20pm
View
Deleted
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string FileToDelete;
// Set full path to file
FileToDelete = Server.MapPath("~/Files/SomeFile.txt");
// Delete a file
File.Delete(FileToDelete);
}
}
SomeFile.txt is a fix file that to be deleted..what if the user upload another image file, another filename..?
brighteyes24
12-May-13 15:46pm
View
yah..you got it..thank you phantom
brighteyes24
9-May-13 10:25am
View
thanks pallavi waikar...it helps.
brighteyes24
9-May-13 10:09am
View
yeah search from database..when i search john no problem..i can search i can see the profile information..but when i search john' there is a runtime error..my question is how to bypass the single quote..?
brighteyes24
23-Apr-13 14:06pm
View
its just a log in form i mean..when i log in my pfofile will display..just like a facebook..it display the item in a label form...
brighteyes24
23-Apr-13 13:38pm
View
ok just give me your idea..thats why im not sure of my codes..in your own understanding..ok forget the codes above..just give me your idea..how to display item from database as a label text..
brighteyes24
23-Apr-13 12:20pm
View
how to display data from database into label..?
My table data I already mention show it from above..
what im trying to clarify is that, my codes is not enough to function..pleas modify my codes if you understand my codes..
brighteyes24
16-Apr-13 8:27am
View
pls help me.give me idea pls..i voted you already..your excellent..
brighteyes24
15-Apr-13 15:00pm
View
vinodkumarnie thank you very much for your idea.it helps a lot for me..i got your sample codes..you haave a minus.jpg ang plus.jpg..when i click the plus.jpg which is an image button it shows the minus.jpg and the description..but what i want to be happen is that,when i click the plus.jpg it enlarge the photos and still plus.jpg will display in an image window...can you help me pls whats the code behind of it..thank very much..
brighteyes24
14-Apr-13 13:11pm
View
i have the database record name DevelopTbl and the gridview for displaying the record..
in the gridview display the P_no,Model (of a product),the Price and the Images..in the images column it is an image display..but small image..it is clickable because I use image button..the problem is i dont know how to enlarge it when i clik the image..i dont know what is codes of this..can you give me an idea?
i have also created Images folder where in I save the image in that folder.
brighteyes24
14-Apr-13 12:44pm
View
actually this is working..but the problem is how to enlarge the image when i click it..give me idea pls..
brighteyes24
22-Mar-13 13:07pm
View
ok thanks...
brighteyes24
21-Mar-13 13:11pm
View
where do i put this codes? is this in a command button event?
Show More