|
Hi there,
Image control has ImageUrl property, you can set this to an aspx page and in this page, you just write the image's stream...
<< >>
|
|
|
|
|
You are right ...
but, what about more than one image that some of them should be shown in a GridView or in a particular place ? i want to get images in Image WebControls and then place them in their correct position ....
www.behzadi.net
|
|
|
|
|
Make an aspx page to get images from the database based on it, that page then writes the stream.
so you have ImageUrl="~/GetPic.aspx?id=5 and then the next image has ImageUrl="~/GetPic.aspx?id=73" and so one.
|
|
|
|
|
Do a search for articles here. This is a common question.
only two letters away from being an asset
|
|
|
|
|
check it out this can be help full
string physicalImagePath = Server.MapPath("imagePathHere");
Response.ContentType = "image/gif";
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(physicalImagePath);
bmp.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Gif);
bmp.Dispose()
|
|
|
|
|
Dear Friends,
I want to generate controls Textbox, Checkbox, Label etc... programaticaly.. pls help me
Dear Friends.....
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
do one thing
use placeholder control where you want to display.
create conrols
ex:
TextBox txtName = new TextBox();
txtName.Name = "txtName";
Add to the placeholder conrtol.
placeholder1.Conrols.Add(txtName);
whenever u dont want remove or Hide
//Removing
placeholder1.Conrols.Remove(txtName);
regards
GV Ramana
|
|
|
|
|
Thanks for the infromation...
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
Generating controls is possible but mainting the state is tricky. If you can't use a dataRepeater (even with your own custom XML or dataset) or gridview you may have to.
<br />
TextBox txt = new TextBox();<br />
txt.Text = "Dynamically added to Page";<br />
this.Controls.Add(txt);<br />
You will find that the value in the control will disappear on each postback.
Please refer to this link for more information about the page lifecycle.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks for the information,
How we can manage this State.. pls inform me
Haridas.R
harisofttech@gmail.com
harisofttech@hotmail.com (online)
harizeenet@yahoo.co.in(online)
"Achievement is not a destination, its a journey "
|
|
|
|
|
hi there,
i'd downloaded a code for FileBroserDialog in asp.net from this site.i works fine when run under visual studio .but when i browse the app and run this utility the dialog never opens thereby giving time out error. any ideas.please
forward aternative code if possible. thanx.
current code::
Shell32.Shell picker = new Shell32.ShellClass();
Shell32.Folder folder = picker.BrowseForFolder(0, "Select Folder", 0, 0); //picker.BrowseForFolder((int)this.Handle, "Resource Updater", 0, 0);
if (folder == null)
{
return; //user hit cancel
}
Shell32.FolderItem fi = (folder as Shell32.Folder3).Self;
strDownloadPath = fi.Path;
|
|
|
|
|
Shell32 is running on your server, not in the browser. Are you wanting to allow users to upload a file via a web application? The only thing you can do is use the html file input control.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi all,
I'm trying to set up my web app so that it doesn't display error/debugging/tracing messages to visitors.
I have already tried the following but i still get the Description:, Exception Details:, Parameter name:, Source Error: etc that you get from the debugger
My Web.Config has:
<trace enabled="false" pageoutput="false"> <compilation debug="false" explicit="false">
No pages have the debug set to true.
IIS has clientside debugging disabled.
Any ideas on how i can sort this out?
Thanks in advance.
|
|
|
|
|
hi Orb1t,
If you try below code in to web.config file and check that
<trace enabled="true" requestlimit="20" pageoutput="false"
="" tracemode="SortByTime" localonly="false">It is working but incase it is not work then try to flase tracing at page level like below:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Trace.aspx.vb"
Inherits="MCSDWebAppsVB.Trace" trace="True" %>
chetan Visodiya
-- modified at 8:05 Thursday 3rd August, 2006
Chetan visodiya
|
|
|
|
|
Chetan, Thanks for your reply + suggestions. I've tried both of them but had no luck with it, the server still returns the parser errors.
Any other ideas?
Cheers
|
|
|
|
|
I think what you are trying to do is set up custom errors. Turn the <customerros mode="On" defaultredirect="YouErrorPage.aspx">
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks ToddHileHoffer, this is exactly what i want to do.
I just wondered whether there might be a way in which i could get it to use IIS' defualt script message'An error occurred on the server when processing the URL. Please contact the system administrator.' and avoid having to create customs + have the 302 redirects.
|
|
|
|
|
Turn the
<br />
customErrors mode = "On" defaultRedirect="YouErrorPage.aspx"<br />
<br />
/customErrors<br />
<br />
it appeared ok in the preview. Some wierd html thing made the tags invisible.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
i need source code to play audio files using asp.net 1.1/c#
danny
|
|
|
|
|
try this
using System.Runtime.InteropServices;<br />
<br />
public class Sound<br />
{<br />
[DllImport("winmm.dll")]<br />
protected static extern bool PlaySound(string lpszName, int hModule, int dwFlags);<br />
protected const int SND_FILENAME = 0x20000;<br />
protected const int SND_ASYNC = 0x1;<br />
<br />
public static void Play(string audioFullpath, int minSeconds)<br />
{<br />
DateTime now = DateTime.Now; <br />
TimeSpan ts = now.Subtract(lastPlayed);<br />
if (ts.TotalSeconds > minSeconds)<br />
{<br />
PlaySound(audioFullpath, 0, SND_ASYNC | SND_FILENAME);<br />
lastPlayed = now; <br />
}<br />
}<br />
}<br />
<br />
Sound.Play(@"c:\sample1.wav",30);
regards
GV Ramana
|
|
|
|
|
I have to provide download of files in ASP.NET 2.0
I am using following lines of code.
try
{
Byte [] bytes = this.ContentController.GetFileContents(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=File" + _fileExtension);
Response.AddHeader("Content-Length", bytes.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Buffer = true;
Response.BinaryWrite(bytes);
Response.Flush();
}
catch(FileNotFoundException fnfe)
{
this.ShowErrorMessage(this.GetErrorString(ResourceIdentifiers.DOCUMENT_FILE_NOT_FOUND_ERROR));
}
catch(Exception ex)
{
this.ShowErrorMessage(this.GetErrorString(ResourceIdentifiers.DOCUMENT_UNEXPECTED_ERROR));
}
Using above code, when one clicks on file link, a default download box of IE appears. If user clicks on Save, the file gets saved on disk and user can open that file. If user clicks on Open, it opens registered application with file type and says, file not found. Using same code I am able to open Word file but I cannot open Excel, PDF files.
Note: My application used Master pages, UIP Application Blocks. The code written above is inside a user control which gets loaded on view (webform) dynamically based on configration(xml) file.
Please can anyone suggest what could be going wrong in the piece of code because of which I am not able to open Excel/PDF files.
Apprciate your help.
Thanks and regards,
Ashish
|
|
|
|
|
Response.ContentType = "application/vnd.ms-excel"
Response.ContentType = "application/pdf"
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
ToddHileHoffer, thanks for your help.
I am still the same problem. Could anything else you can think of to getrid of this problem
- ashish
|
|
|
|
|
VB.NEt code that works from my old application.
' The following code writes the pdf file to the Client’s browser.
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname) 'String location of the file
Response.Flush()
Response.Close()
'delete the exported file from disk
System.IO.File.Delete(Fname)
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Seems I get the problem when I use UIPAB. Otherwise the same code works fine.
Any idea what UIPAB does different.
- ashish
|
|
|
|