|
Im working on Webapplication in Visual C# .Net and have database Table for CategoryId,Category and CategoryImage...
i want to display when the user Add any Item in the Database and Choose anyCategory From Dropdown list it display the Respective picture for that Category
sheeba
|
|
|
|
|
Sheeba,
First make sure that your images are inside the application folder.
In your table which information on your categories have a column added with Path and add the path of the images only.
Now iam assuming you are using datagrid.
In your datagrid add a template column and in that add an image control,
datagrid
columns
templatecolumn
itemtemplate
image......
now in your image you can bind the name of the image which is in your database accordingly.
like: imagesource=<%#DataBinder.Eval(Container.DataItem, "path")%>
Try out, and it works for sure
Gautham
|
|
|
|
|
Sheeba,
First make sure that your images are inside the application folder.
In your table which information on your categories have a column added with Path and add the path of the images only.
Now iam assuming you are using datagrid.
In your datagrid add a template column and in that add an image control,
<datagrid>
<columns> <templatecolumn>
<itemtemplate>
<image......>
now in your image you can bind the name of the image which is in your database accordingly.
like: imagesource=<%#DataBinder.Eval(Container.DataItem, "path")%>
Try out, and it works for sure
Gautham
|
|
|
|
|
You can do one more thing inorder to show the images for the particular item.
In the databse table insert the name of the pic which you are uploading. I am assuming that you are uploading the pic in particular folder.
Make the datagrid as item template column as gauthee has told u and call the image by providing the path & the name from databse table.
I m sure it helps u
|
|
|
|
|
Thanks alot for the Reply , this is only to insert 1 Image, But i want to display images on DataGrid with respect to Every Category...
etc
Category_ID = 1 Display image1
Category_ID = 2 Display image2
But How to do I dont knwo...'
im trying if someone knwo abt it...?
sheeba
|
|
|
|
|
send me ur table structure, i.e. category id, desc, path etc
and the requirement how you want to display the details in the datagrid
i might give the code then!!
Gautham
|
|
|
|
|
CREATE TABLE MARKETPLACE_CATEGORY
(
CATEGORY_ID NUMBER NOT NULL,
CATEGORY VARCHAR2(500) NOT NULL,
CATEGORY_EMAIL VARCHAR2(500),
CATEGORY_PIC VARCHAR2(500)
)
this is grid code
|
<asp:label id="lblError" runat="server" forecolor="White">
|
<asp:label id="lblUserName" runat="server" forecolor="Maroon" font-bold="True">
<asp:label id="lblDisplayText" runat="server" forecolor="#2F7ED0" font-bold="True" font-size="Small"> the following are Your Items
<asp:button id="btnSearch" runat="server" width="56px" text="Search">
<asp:datagrid id="DataGrid1" runat="server" width="750px" cellpadding="2" autogeneratecolumns="False" allowsorting="True">
<footerstyle backcolor="#04528D">
<alternatingitemstyle borderwidth="0px" backcolor="#F7F7EE">
<itemstyle backcolor="#E4E7EC">
<headerstyle font-bold="True" forecolor="White" backcolor="#04528D">
<columns>
<asp:templatecolumn><headerstyle horizontalalign="Center" width="50px" verticalalign="Middle">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:hyperlinkcolumn datanavigateurlfield="RECORD_ID" datanavigateurlformatstring="View_Item.aspx?RecordID={0}"
="" datatextfield="ITEM">
<headerstyle width="100px">
<asp:templatecolumn headertext="Type">
<itemtemplate>
<asp:label runat="server" text="<%# DataBinder.Eval(Container, "DataItem.TYPE") %>">
<edititemtemplate>
<asp:textbox runat="server" text="<%# DataBinder.Eval(Container, "DataItem.TYPE") %>">
<asp:boundcolumn datafield="ITEM" headertext="Item">
<headerstyle width="150px">
<asp:boundcolumn datafield="ITEM_PRICE" headertext="Item Price">
<headerstyle width="100px">
<asp:boundcolumn datafield="DESCRIPTION" headertext="Description">
<headerstyle width="250px">
<asp:boundcolumn visible="False" datafield="RECORD_ID" headertext="RECORD_ID">
<headerstyle width="100px">
<pagerstyle backcolor="#04528D">
|
sheeba
|
|
|
|
|
Can you tell me how to perform Edit, Update & Sorting in DataGrid at code behind.
pls give me full code
With best regards
|
|
|
|
|
Why didnt you try google first b4 posting such questions?
I just search for sorting and get my stuff in first record. Try the following for sorting and search remaining yourself.
Datagrid Sorting
Every job is a self portrait of the person who did it.
|
|
|
|
|
|
Hii
I am using asp.net 2005 grid view and a sqldatasource with it. When I try to delete a row I got an error like "Specified argument was out of the range of valid values.
Parameter name: value "...
anybody..plz help!!!!
Ranjith
|
|
|
|
|
why don't you post some code what you written inside delete command ?
|
|
|
|
|
I am just giving a direct query like "DELETE FROM [T_BL_CHARGE_SELLING] WHERE [CHARGEID] = @original_CHARGEID" in the sqldatasource's delete query property...
Ranjith
|
|
|
|
|
Hi,
I have this Data Grid which I drag and drop from the Database Explorer. It works well and I did some editing to it. And the problem is some of my fields are storing id which point to another table that store the description of the id.
Let say titleId in my 'staff' table is '1', so it point to 'title' table where '1' is 'Manager'. When the Grid show on the web page, I don't want it to show the id '1' when I select from 'staff' table, I want it to show 'Manager'.
How can I add another sql query in this Grid to make it select the name of the title and show it in the Grid?
Thanks
J Liang
|
|
|
|
|
J Liang wrote: How can I add another sql query in this Grid to make it select the name of the title and show it in the Grid?
I think no need of adding one more SQL query for solving this problem.
J Liang wrote: I don't want it to show the id '1' when I select from 'staff' table, I want it to show 'Manager'
What you can do is fetch the type from your second table for that id and show it. Use single query. That could be something like
SELECT
T.YourColumnName,
S.OtherColumn
FROM
Staff S,
Title T
WHERE
T.titleId = S.titleId
|
|
|
|
|
Hi,
Thanks for the suggestion, it works just fine and the data grid is showing the description instead of the id.
J Liang
|
|
|
|
|
Hi all , Just wanted to know if there is a color picker control available in ASP.Net..
I want to use it in one of my projects...
I want to know if there are some add-ons available so that the color picker control can be directly accessed from the toolbox in Visual Studio 2005
Thanks in advace
|
|
|
|
|
you can surely get it from Here[^]
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks Apurva...The code link provided by u is known to me ...I just wanted to know , isn't there some build in control in asp.net to provide the color picker control.
Like in VC++ , there is a build in control control , SO how can .NET miss such a useful control
|
|
|
|
|
Hi,
I have page where an excel file would be imported, while importing there are certain validations would be done, once through insertion operation would be performed in the database.
This whole process works fine and takes little time, now the requirement is that while we click the button 'Start Processing' a taskbar sort of thing should be displayed.
Like loading... 1% 2% etc etc.
Once the operation is done this should not be visible
Typical website stuff which shows the loading msg when being loaded.
How to implement this???
Gautham
|
|
|
|
|
when i tried to get the address in asp.net it is displayed the address "fe80::5efe:192..... like this.
How to get IPv4 Address in VISTA?
PLZ solve this Prob
Thanks in advance
|
|
|
|
|
http://aspnet.4guysfromrolla.com/demos/IsPrime.aspx[^]
the code link above does it looks wrong as i tryed testing it however does not work it keep telling me :
Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control that has CausesValidation=True and initiated the postback, or after a call to Page.Validate.
p.s: i am using asp.net2
|
|
|
|
|
Not sure...but you may try setting CausesValidation=False for other controls
<< >>
|
|
|
|
|
i want to add a mouseout event to a hyperlink.how can i do that
|
|
|
|
|
Use the Attributes collection of the control.
---
single minded; short sighted; long gone;
|
|
|
|