Hi
In below code I want to display image but it is not displayed. Image is saved in LMS/Upload/Student/ProfilePic folder
C#
Data in database is - VIV_ST_0003_18_01_2023_15_06_39.png
BALStudents bALStudents = new BALStudents();
StudentDetail Result = bALStudents.GetStudentDetailByLoginID(Convert.ToInt32(hdfStudentID.Value));
if (Result != null)
{
imgProfile.ImageUrl = Result.ProfilePic;
}Thanks

Sachin SinghRank #66 · 26.2K reputationPosted Jan 19, 2023, 1:10 AM EST
it should be
imgProfile.ImageUrl = "/LMS/Upload/Student/ProfilePic/" + Result.ProfilePic;Pasang TamangRank #449 · 5.6K reputationPosted Jan 19, 2023, 1:06 AM EST
Hi,
You have to append folder path also when assigning value to ImageUrl. Change your code as in below code.
imgProfile.ImageUrl = "/LMS/Upload/Student/ProfilePic/" + Result.ProfilePic;Regards,
Pasang
Kip Hackman61 reputationPosted Jan 19, 2023, 2:14 PM EST
private void InitDocumentViewer() { // Add a panel on the left for the document viewer thumbnails var thumbPanel = new Panel(); thumbPanel.Name = "thumbPanel"; thumbPanel.Width = 200; thumbPanel.Dock = DockStyle.Left; thumbPanel.BackColor = Color.Gray; thumbPanel.BorderStyle = BorderStyle.FixedSingle; this.Controls.Add(thumbPanel); // Add a panel to fill the rest, for the document viewer var docViewerPanel = new Panel(); docViewerPanel.Name = "docViewerPanel"; docViewerPanel.BackColor = Color.DarkGray; docViewerPanel.BorderStyle = BorderStyle.None; docViewerPanel.Dock = DockStyle.Fill; this.Controls.Add(docViewerPanel); // Add a top panel to host our application controls var topPanel = new Panel(); topPanel.Name = "topPanel"; topPanel.Height = 30; topPanel.Dock = DockStyle.Top; topPanel.BorderStyle = BorderStyle.FixedSingle; this.Controls.Add(topPanel); docViewerPanel.BringToFront(); var loadButton = new Button(); loadButton.Name = "loadButton"; loadButton.Text = "&Load"; loadButton.Click += (sender, e) => LoadDocument(loadButton); topPanel.Controls.Add(loadButton); var createOptions = new DocumentViewerCreateOptions(); // Set the UI part where the Document Viewer is displayed createOptions.ViewContainer = this.Controls.Find("docViewerPanel", false)[0]; // Set the UI part where the Thumbnails are displayed createOptions.ThumbnailsContainer = this.Controls.Find("thumbPanel", false)[0]; // Not using annotations for now createOptions.UseAnnotations = false; // Now create the viewer documentViewer = DocumentViewerFactory.CreateDocumentViewer(createOptions); documentViewer.View.ImageViewer.Zoom(ControlSizeMode.FitAlways, 1.0, documentViewer.View.ImageViewer.DefaultZoomOrigin); cache = new FileCache { CacheDirectory = Path.GetFullPath(@".\CacheDir"), }; virtualDocument = DocumentFactory.Create(new CreateDocumentOptions() { Cache = cache, UseCache = true }); LEADDocument leadDocument = DocumentFactory.LoadFromUri(// file uri, new LoadDocumentOptions { UseCache = true, Cache = cache, LoadEmbeddedAnnotations = true }); virtualDocument.Pages.Clear(); for(int i = 0; i < leadDocument.Pages.Count; i++) { virtualDocument.Pages.Add(leadDocument.Pages[i]); } documentViewer.BeginUpdate(); documentViewer.SetDocument(virtualDocument); documentViewer.View.Invalidate(); if (documentViewer.Thumbnails != null) documentViewer.Thumbnails.Invalidate(); documentViewer.EndUpdate(); }You can use LEADTOOLS Document SDK technology in your application. You can leverage the DocumentViewer and DocumentFactory classes. The DocumentFactory class allows you to load any LEADTOOLS supported file format and the DocumentViewer class allows you to view the loaded document.
See the code snippet above for example.