|
krishnavaradharajan wrote: ");
Where is your Image Path?
set ID and runat server to htmlImage control in source and access that image and set src property to image path
if you want to display that image in datagrid try following code in itemtemplate
<img src='foldername/<%# Eval("ImagePathField")%>' />
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
He said that the images are stored in database. Not in the folder.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Michael Sync wrote: He said that the images are stored in database. Not in the folder.
please read my post again.I am fetching it from database not folder.He just save image path in database but image must be in the some folder thats why i am giving that foldername.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Imran Khan Pathan wrote: please read my post again.I am fetching it from database not folder.He just save image path in database but image must be in the some folder thats why i am giving that foldername
haha.. Yeah.. My mistake...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
|
In db iam stored like 9.jpg so iam retrieving like 9.jpg
But the image was in the folder(9.jpg) in the server.
This 9.jpg file name has to link with that folder to retrive the image.
krishna
|
|
|
|
|
Okay. so, Like that?
while (dr10.Read())<br />
{<br />
Response.Write("<img src=\"\images\\" + dr10("imgFileName").ToString() + "\" width=\"39\" border=\"0\" height=\"40\">");<br />
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Hi Krishna,
did u try the process that i have post in with your last post. that use a "~" sign infront of folder . means
~\Upload\image1.jpg
it will surely work !!!
|
|
|
|
|
Abhijit Jana wrote: ~\Upload\image1.jpg
it will surely work !!!
I don't think putting ~ will make much difference. This will force ASP.NET to take this path as the root only for server controls. But in this case he is writing image directly. So it won't matter I guess.
|
|
|
|
|
krishnavaradharajan wrote: Response.Write("");
This won't display the image on a datagrid. Response.Write() prints the output on top of the page. Use a label control and assign this to there. Or use a server side image control and set image URL.
krishnavaradharajan wrote: But i couldt able to retrive the image.
As you are trying to display images on a DataGrid, you should look into ItemDatabound event. This will be fired when each rows are binded. Create a template column in your datagrid which contains either a Label or Image control. In ItemDataBound, find this control and assign the image file name to there. Make sure the image exist in the specified path.
|
|
|
|
|
I have given begindcode
while(dr10.Read())
{
Response.Write("<img src=~\"uploads\" width=\"39\" border=\"1\" height=\"40\">");
}
HTML CODE
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lbl4" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"picture") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Its not retrieving
krishna
|
|
|
|
|
Hi fellows, I am really stuck into this thing. I declared an iframe in a usercontrol control and this usercontrol resides in a form. So now,i am getting an error that says document is null or an object.<br />
<br />
This is how I am calling from form.aspx to javascript to get the text from the usercontrol<br />
Form.aspx<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
ScriptManager.RegisterStartupScript(this, GetType(), "get", "javascript:getText();", true);<br />
<br />
}<br />
<br />
usercontrol.ascx<br />
<iframe id="iframe" enableviewstate="true" runat="server"></iframe> <br />
<script language="JavaScript" type="text/javascript" ><br />
<br />
function getText()<br />
{ <br />
alert(window.frames["usercontrol1_iframe"].contentWindow.document.body.innerHTML);--->and am getting error on this line.<br />
<br />
}<br />
<br />
</script>
|
|
|
|
|
netJP12L wrote: alert(window.frames["usercontrol1_iframe"].contentWindow.document.body.innerHTML)
"usercontrol1" is something generated by ASP.NET engine so it might change it to something else sometimes.. You should check whether window.frames["usercontrol1_iframe"] has some values or not.. If you are using Firebug, it's so easy for you to debug this kinda scenario.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Hi Everyone,
I need help on my asp:menu which is bind to hierarchichal data source. It has no error but it's not displaying anything. This is my first time to use asp.net and I have spent a lot of time on this task. I know there are glitches in my classes and interfaces but just don't know what code I should write on it. Please help me. See discussion below.
Thanks,
Neil
I have a class called menuClass and class collection called menuCollection. menuCollection is populated correctly through a stored procedure. I could bind this to a datalist for testing purposes and it would display its content. The menuclass has String members menuid, parentid and title. The fourth member is a list type IList. Am not sure of the last member if it's necessary but based on my research it will be used for the GetChildren function.
To bind my menu item, I used the logic as follows:
dsView = New SQLDataSourceControlView(mnuTempItems)
mnuItems.DataSource = dsView.Select()
mnuItems.DataBind()
where mnuTempItems is an instance of class menuCollection.
See my other classes and interfaces needed for HierarchicalDataSource:
Imports System
Imports System.Collections
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Namespace DrinksWebSite.Menu
<aspnethostingpermission(securityaction.demand,
level:=aspnethostingpermissionlevel.minimal)> _
Public MustInherit Class SQLDataSourceControl
Inherits HierarchicalDataSourceControl
Public Sub New()
End Sub
' Return a strongly typed view for the current data source control.
Private view As SQLDataSourceControlView = Nothing
Protected Overloads Function GetHierarchicalView(ByVal viewPath
As Menu.MenuCollection) As HierarchicalDataSourceView
If view Is Nothing Then
view = New SQLDataSourceControlView(viewPath)
End If
Return view
End Function 'GetHierarchicalView
Protected Overrides Function CreateControlCollection() As ControlCollection
Return (New ControlCollection(Me))
End Function 'CreateControlCollection
End Class 'SQLDataSourceControl
' The SQLDataSourceControlView class encapsulates the
' capabilities of the FileSystemDataSource data source control.
Public Class SQLDataSourceControlView
Inherits HierarchicalDataSourceView
Private _sqlCollection As MenuCollection
Public Sub New(ByVal viewPath As MenuCollection)
_sqlCollection = viewPath
End Sub 'New
Public Overrides Function [Select]() As IHierarchicalEnumerable
Dim fshe As New HierarchicalData(_sqlCollection)
Dim fsi As menuClass
For Each fsi In fshe
fshe.Add(New HierarchicalDataElement(fsi))
Next fsi
Return fshe
End Function 'Select
End Class 'FileSystemDataSourceView
Public Class HierarchicalData
Inherits ArrayList
Implements IHierarchicalEnumerable
Private data As MenuCollection
Public Sub New(ByVal values As MenuCollection)
data = New MenuCollection
For Each value As menuClass In values
data.Add(New HierarchicalDataElement(value))
Next
End Sub
Public Overridable Function GetHierarchyData(ByVal
enumeratedItem As
Object) As IHierarchyData _
Implements IHierarchicalEnumerable.GetHierarchyData
Return CType(enumeratedItem, IHierarchyData)
End Function 'GetHierarchyData
End Class 'HierarchicalData
Public Class HierarchicalDataElement
Implements IHierarchyData
Public _data As menuClass = Nothing
Public Sub New(ByVal obj As menuClass)
_data = obj
End Sub 'New
Public Overrides Function ToString() As String
Return _data.title
End Function 'ToString
' IHierarchyData implementation.
Public Overridable ReadOnly Property HasChildren() As Boolean _
Implements IHierarchyData.HasChildren
Get
Dim children As Menu.MenuCollection
children = GetChildren()
Return children.Count > 0
End Get
End Property
' returns the title of the menu
Public Overridable ReadOnly Property Path() As String _
Implements IHierarchyData.Path
Get
Return ToString()
End Get
End Property
Public Overridable ReadOnly Property Item() As Object _
Implements IHierarchyData.Item
Get
Return _data
End Get
End Property
Public Overridable ReadOnly Property Type() As String _
Implements IHierarchyData.Type
Get
Return _data.GetType().ToString()
End Get
End Property
Public Overridable Function GetChildren() As
IHierarchicalEnumerable_
Implements IHierarchyData.GetChildren
Dim parentContainer As New HierarchicalData(_data.List)
Dim children As New MenuCollection
Dim objMenu As menuClass
For Each objMenu In parentContainer
children.Add(objMenu)
Next objMenu
Return children
End Function 'GetChildren
Public Overridable Function GetParent() As IHierarchyData _
Implements IHierarchyData.GetParent
Return New HierarchicalDataElement(_data)
End Function 'GetParent
End Class 'HierarchicalDataElement
End Namespace
Cheers,
Neil
|
|
|
|
|
hi.
how can I encrypt my password? what type must I select in sqlserver?
how can I encrypt & decrypt QuesryString ?
some times I see a QuesryString like this : zHtkKwwebwYoekpwner43
mehran asghari
|
|
|
|
|
|
mohandesmehran wrote: how can I encrypt & decrypt QuesryString ?
Encryption password and "encrypt & decrypt QuesryString" are two different questions. As the first question is already answered, I will tell you about second question.. You can use URL-rewriting with encryption class for encrypting /decrypting the querystring...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
|
Hello,
I made a Calculator usercontrol and a Time custom control and added them to a DeclarativeCatalogPart.When I run the application if I try to switch to the Catalog display mode using the web part manager I get an Argument Exception:
"The specified display mode is currently disabled on this page. Make sure personalization is enabled for the current user.
Parameter name: value".
Every thing looks correct to me .Could any one help me to solve this problem?.
I am too late but i will never give up
|
|
|
|
|
Please help!!
I saw the C# code on your page for
pagebreakrender. I'd like to
redisplay the header row of my gridview on
the top of each page when I print.
How do I do this in VB?
|
|
|
|
|
I am developing a web application of which I am scanning all computers in our intranet. During the scan of each computer, I am attempting to determine if they have certain services installed or running so I will need to execute these as an administrator. I am trying to impersonate the domain administrator in the web.config and not having much luck. Here is what I put in the web.config file:
<system.web>
<identity impersonate ="true" userName ="DOMAIN\Admin" password ="password"/>
during my initialization of the web app, I am connecting to a SQL Server 2005 express database file and deleting records in case there were any left from the previous run. My code is as follows:
Dim conn As New System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim strDate As String = Now.AddHours(-3).ToString
With conn
.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("NetworkConnectionString").ConnectionString
.Open() 'Failed Line
End With
When I have the line in the web config shown above, I get an error on the failed line in code that says:
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Based on this message, I would assume that I need to have a profile for the domain admin on the machine running the web server, which it has. Right now, the web server is on my local machine but will be eventually installed on our company's web server but I want to get this working before copying it up. All code in the web app is written in VB.NET.
If anyone has any suggestions, I would appreciate it very much. This is my first attempt at impersonation and the code I've tried to implement was from web sites specific in ASP.NET/VB.NET.
Thanks for any help!
David
|
|
|
|
|
Just for clarification, the code above:
Dim conn As New System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim strDate As String = Now.AddHours(-3).ToString
With conn
.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("NetworkConnectionString").ConnectionString
.Open() 'Failed Line
End With
works when there is NO impersonation line in the web.config file. It only fails when I have the "identity" in the web config file.
David
|
|
|
|
|
You have remembered to switch off Enable anonymous logins on the website haven't you?
|
|
|
|
|
i want to validate data first. if the data is valid then i want ConfirmButtonExtender message like ARE YOU SURE YOU WANT TO ADD?
HOW CAN I DO IT?
ANY HELP WILL BE GREATFUL
Sarfarj Ahmed
|
|
|
|
|
Hi Sarfarj
Try this.
If you are using Ajax, it will work for you.
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScript", "alert(\"The record can not be deleted\");", true);
Write any Javascript you want in it.
I believe you need for Confirm, so use Confirm("Are you sure?") instead of Alert. Should work for you.
Cheers
Menon
|
|
|
|