TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Navaz
NA
96
45.1k
error
Aug 27 2013 7:07 AM
j qury-------------
<script src="js/jquery-1[1][1].8.0.js" type="text/javascript">
function detectfile() {
var btn = document.getElementById('< %=btnHidden.ClientID % >');
if (btn) {
btn.click();
}
}
file upload
<asp:FileUpload ID="FileUpload1" runat="server" on change="datafile()" />
<asp:Button runat="server" Text="Button" OnClick="Unnamed1_Click" style="display:none"
ID="btnHidden" />
button click
if (FileUpload1.HasFile)
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
string strExtension = Path.GetExtension(FileUpload1.FileName).ToLower();
if (strExtension == ".jpg" || strExtension == ".jpeg")
{
string photoName = "IMG" + DateTime.Now.Ticks + fileName;
FileUpload1.SaveAs(Server.MapPath("~\\images\\Temp\\" + photoName));
ViewState["photo"] = photoName;
Image2.ImageUrl = "~\\images\\Temp\\" + photoName;
}
but image is not visible in the image control
Reply
Answers (
4
)
CSS Design to Create Web Page
gridview