|
take the binary of the image from database.
make a stream.
write that stream into a blank Web User Control. as Response.Write
and then assign it to your image control as
ImageURL="myPic.ascx"
I hope you understand what I mean.
Regards,
Ather Ali
Ather Ali Shaikh
Project Manager
Micromedia Computer
shaikhather@gmail.com
|
|
|
|
|
Hi Ather Ali,
I understood what you are telling but not getting how to do it. I have the following code. Picture is getting displayed. It is ok. But not in the image control. suppose if I have a imagecontrol Image1 how can i do this?
Dim ImageID As Integer = Convert.ToInt32(Request.QueryString("ImageID"))
'Connect to the database and bring back the image contents & MIME type for the specified picture
Const SQL As String = "SELECT [MIMEType], [Image] FROM [Pictures] WHERE [ImageID] = @ImageID"
Dim myCommand As New SqlCommand(SQL, myconnection)
myCommand.Parameters.AddWithValue("@ImageID", 1)
myconnection.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader
If myReader.Read Then
Response.ContentType = myReader("MIMEType").ToString()
Response.BinaryWrite(myReader("Image"))
End If
myReader.Close()
myconnection.Close()
Chaitra N
|
|
|
|
|
This Code is OK.
Put this code in a ASCX control and take the ImageID from QueryString. and there should not be any thing in HTML side.
Whereever you want to put this image on any page.
place a image control on that page and as source refere to this control
like <asp:image id="myimage" runat="server" imageurl="~/Controls/MyImage.ascx?ImageID=" <%#="" myimageid="" %="">
I hope it will sove your problem.
I have already did it in my one of the application.
Regards,
Ather Ali
Ather Ali Shaikh
Project Manager
Micromedia Computer
shaikhather@gmail.com
|
|
|
|
|
Thank you. It worked.
Chaitra N
|
|
|
|
|
HEllo Every Body .. I am Ammar and i have needed your help plese help me i will be very thankfull to you...
Can any one send to me code of EMAIL SYSTEM on API ... in C# and as well as send the code of Discussion board.... I will be very thnk full to you......
AmmAr
|
|
|
|
|
ammar_nike wrote: EMAIL SYSTEM on API
I'm not sure what you meant by "EMail system on API"
The link below are Open Source EMial System..
SharpWebMail[^] -- this is the one that I contributed the localized resources for burmese language.
OpenSmtp.Net[^]
C# Email Server[^]
OR. just use IMAP...
ammar_nike wrote: the code of Discussion board....
PhpBB? Oh. man... google a lit bit...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hello Sir,
I mean .. Use of API and create the email system. (LIke Hotmail or Yahoo Email System) ..... if you can send me the source code in C# for email system then i will be very very thankful to you......
Discussion board like this forum(codeproject discussion board) ... plzz send me this one also.... Thanks Michael Sync...takecare sir
|
|
|
|
|
|
We cannot do your work?
We can help you , what you have coded so for and what error it says?
Hereafterwards don't post a question like asking for the code?
SSK.
|
|
|
|
|
Using hyper link how to pass one parameter value from one page to another page...,
And how to retrive the value on that page...,
Plz any one hlp me to do that,
Regards,
Magi
|
|
|
|
|
just use the QueryString for that particular
<asp:HyperLink ID="hyplnk1" runat="server" Text="Associate Contacts"
NavigateUrl='<%# "~/YourPage.aspx?Code=" + Eval(Server.UrlEncode("Code").ToString()) %>' />
and get the value on YourPage.aspx on pageload
string Code= Request.QueryString["Code"].ToString();
hope this will help u
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi deepak i am getting error see this is my hyperlink:
<asp:hyperlink id="Hyperlink1" runat="server" Font-Names="Arial" ForeColor="DarkSlateGray" Width="48px"
BorderStyle="Outset" Height="18px" BorderColor="ActiveCaptionText" BackColor="ScrollBar"
Text="Associate Contacts"
NavigateUrl='<%# "FrmTempEmployeeEdit.aspx?Code=" + Eval(Server.UrlEncode("ddlcontractor.selecteditem.value").ToString()) %>'
BorderWidth="1px" Font-Bold="True">Edit</asp:hyperlink>
Regards,
Magi
|
|
|
|
|
Hi deepak i am getting error in compile time itself in that hyperlink...,
Plz help me to solve that...,
Regards,
Magi
|
|
|
|
|
Just Remove Text="AssociatesContacts"
and give ur Error too
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi deepak i remove that text..,
I am getting now compilation error,
This is the error: "Name 'Eval' is not declared" msg
Regards,
Magi
|
|
|
|
|
Hello Everyone,
I want to change the color,border and etc of the Dropdown list in ASP.NET
Thnx.......
|
|
|
|
|
Use css style.
petersgyoung
|
|
|
|
|
How can I do that without forcing the user to download anything on his pc?
BiG RaLpH
|
|
|
|
|
hi there all im trying to do is to post an XML File -which i already built-
from ASP page (C#)into Specific URL
thx
|
|
|
|
|
hi friends
i bind the array in datatable like this
Is it corrcte?
ServiceRequest [ ] requests;
if (zc!=null) requests=ServiceRequest.resortByDistance(requests,zc);
DataRow dr=dtbDataTable.NewRow();
dr(0)=requests;
dtbDataTable.Rows.Add(dr);
regards
saravanan
|
|
|
|
|
Hi,
Is there a way to check when a control receives focus in an aspx web page (Like GotFocus)?
I can only find an option for setting the focus: control.Focus()
|
|
|
|
|
I don't think your web browser would give those events to you. You should go for an ActiveX Textbox if you really need that event.
|
|
|
|
|
Ok. Where do I get that control to add it? I am using MS Visual Web Developer 2005 Express.
|
|
|
|
|
Generally i use this to associate the java scrpt with a button.
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If (Not Page.IsPostBack) Then
Me.btnSave.Attributes.Add("onclick","return validate();")
End If
End Sub
But if the button is in side a gridview's footer control how can i do this?
sanjay kumar samantaray
|
|
|
|
|
I think you can add the client-side event in design time.. Just open the design view and add the event in button in footer template.....
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|