|
How are you setting the image? Setting the src property for the image tag is all that is necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I am using <asp:image> control and I am setting the image URL to the web address like this:
String webURL = System.Net.HttpWebRequest.Create(Title.ImageUri.OriginalString).GetResponse().GetResponseStream().ToString()
Image1.ImageURL = webURL;
if i view the source then the src is set to this which is wrong:
img id="ctl00_ContentPlaceHolder1_Image1" src="System.Net.ConnectStream" alt="DVD" style="height:122px;width:122px;border-width:0px;margin-left: 73px" />
Any advice on the above?
Thanks,
|
|
|
|
|
What you are doing is assigning the ImageUrl property the type name, System.Net.ConnectStream, because you are calling ToString() on the Stream object returned from GetResponseStream(). Why did you even think this was necessary or the proper way?
Title.ImageUri.OriginalString is all you need.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
Yes your right, i only need to specify the OriginalString part. I solved the problem by using the debugger after i replied to your previous message.
When i was developing a Windows Form application I was using HTTpRequests etc and assigning the values to a picture box.
Thanks for the help.
|
|
|
|
|
SALAM,
i use C# with ASP.NET.
I CREATE A TABLE IN MY PAGE ASP AND WHEN A USER INSERT DATA (int num,smalldate date,varbinary fichier)ON THE TABLE AND CLICK A BUTTON "DEPOT DOSSIER",so data will add to database.
my problem how to insert image and date and num from table in asp page to databse sqlserver .
and this what exactly i want to do with 2 photo: link to first photo http://pics.imagup.com/ano1/1274640272.jpg
and when the folder is created it must be like this: link to second photo
http://img62.imageshack.us/img62/5113/administrateurcert.png
Note: images show like a url in the ASP page.
can i use gridview in some case?
SALAM .
modified on Sunday, May 23, 2010 2:38 AM
|
|
|
|
|
This[^] shows how to insert images to database.
ihbos wrote: can i use gridview in some case?
GridView is for display. Manipulating the data and inserting or retrieving from a database is separate.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
thank you for your help
but i want to know how i can add data (string or date or int) which user insert into my table page ASP to my database table sqlserver .
Thanks and Salam.
|
|
|
|
|
There are so many examples of how to insert data into a database in books, articles, online, etc. Are you saying you have never seen any example? If so, then you need more help than we can give you here.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi,
i wish to create a menu like this Site: http://www.dhgate.com .
are there component to make it?
please help me .thanks a lot.
|
|
|
|
|
farasat.mohammad wrote: are there component to make it?
Yes. They can be done using Javascript, HTML !
There are lots of menu's (not exactly the same though, a simpler version) article in CodeProject itself. Search it, try to use the one looks fine to you. You can use, Javascript, jQuery, AJAX based menus to get it. Suit your requirement and knowledge!
|
|
|
|
|
thanks .
but can u give me a link about that?
my search haven't good result
|
|
|
|
|
Hi,
I am trying to use an External Web Service in my Web Site application i am developing. The problem occurs when declaring the namespace such as this:
using namespace.classname
Error: The type or namespace cannot be found.
Does this mean i have to put the C# class file into App_Code folder?
I was wondering if somebody could help me please in terms of replicating the problem i am facing? I am trying to use the following web service:
IMDB Web Service
I have followed the instructions but it still doesnt work. I have even copied the following code from the generated output file which you will see when you access the above URL into my global WebConfig file and it still doesnt work.
I am using .NET Framework 3.5 and VS 2008.
Thanks & Regards,
|
|
|
|
|
Hi I am using a gridview to display data from my table at runtime. I am new to ASP.NET.
I am not using boundfields but I am using Template fields. I specify the HeaderText and DataKeys
I am using a web service to provide me a DataSet of the chosen table and bind it to the GridView in page_load event.
I would like to count the number of records from a chosen table and display that in the Gridview.
I have written a method to return number of records by passing in a string parameter product name
but i am not sure of how to invoke the method so the value is shown in the GridView.
How could i go about doing this?
Do i need to invoke the method using Eval like this:
<asp:TemplateField HeaderText="ProductName" SortExpression="ProductName">
<ItemTemplate>
<%#GetRowCount(Eval(ProductName))%>
</ItemTemplate>
</asp:TemplateField>
Would the above work?
Thanks,
|
|
|
|
|
Why to hit performance(and extra code!) so much when you can get the same information in the dataset of gridview along with other data?
Using webservice when you are getting data, also retrieve the count of rows in it.
Or, if you cannot do that, then before using it as a source to grid, append the count of rows to dataset and use the modified dataset as datasource of your grid. You are all set!
|
|
|
|
|
Can you provide me an example please if you dont mind?
Thanks,
|
|
|
|
|
Hi.
I have this updatepanel, with some fields that are getting filled from an ObjectDataSource.
One of the fiels are a date, and i want this date to be marked as red (and maybe in bold) if the date is one day from today or later.
Problem is, I have no clue on how to do this, since I am new to asp.net!
So is there a way to add a method that changes this specific ItemStyle-ForeColor based on the content i get from my datalayer?
This is my updatepanel:
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView Width="1200" ID="gvTasks" runat="server" OnRowCreated="gvTasks_RowCreated"
DataSourceID="odsTaskList" GridLines="None" AutoGenerateColumns="false" CssClass="mGrid"
PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" OnSelectedIndexChanged="GvTasks_SelectedIndexChanged"
DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="Enddate2" HeaderText="Enddate" ItemStyle-ForeColor=RED-IF-OVERDUE-EXCEEDED ItemStyle-HorizontalAlign=Center>
<HeaderStyle Width="80px" HorizontalAlign="Center" />
<asp:BoundField>
<Columns>
<asp:GridView>
<ContentTemplate>
<asp:UpdatePanel>
Thanks alot!
|
|
|
|
|
lvq684 wrote: I have this updatepanel
It does not matter in your case.
lvq684 wrote: i want this date to be marked as red (and maybe in bold) if the date is one day from today or later
You need to use RowDataBound of GridView for this.
protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
DataControlRowType rtype = e.Row.RowType;
if (rtype == DataControlRowType.DataRow && rtype != DataControlRowType.Footer
&& rtype != DataControlRowType.Separator && rtype != DataControlRowType.Header
&& rtype != DataControlRowType.Pager)
{
Calendar cd = e.Row.FindControl("myCal") as Calendar;
cd.ForeColor = Color.Red;
}
}
|
|
|
|
|
Thanks alot for your answer, but I dont quite follow the code.
Whats up with the
Calendar cd = e.Row.FindControl("myCal") as Calendar;
And could you please paste the corresponding .aspx code for the Gridview please?
I am very grateful!
|
|
|
|
|
I believe what i have provided is more than enough.
lvq684 wrote: could you please paste the corresponding .aspx code
No! i wouldn't
lvq684 wrote: but I dont quite follow the code
You said you have a calendar inside the grid, so that line gets the calendar control to you.
Looks like you are a fresher. Would suggest you to read book first.
|
|
|
|
|
Yes, as stated in the first post, I am new to asp.net.
It´s not a calendar but a simple string which holds the date. The date sorting is being issued elsewhere. But I´ll try changing the calendar to a string and fiddle with it.
Question is just how the page control calls this method. I will google some more.
Thanks.
|
|
|
|
|
hi, iam using asp.net with c#,
in my page there are many images in top ,left , right,bottom i want to draw verticle line and horizontal lines like this as showed in below example .can you give example which helps me
||
image1 || || image9
|| ||
|| ||
image2 || || image9
|| ||
|| ||
|| ||
image3 || || image10
|| ||
||====================================||
image4 image5 image6 image7 image8
|
|
|
|
|
|
|
Hello all!
I'm new to asp.net and i'm trying to bind some XML data to a gridview.
abviously I'm not understanding how to do it properly because that my code doesn't seem to
work...Can anyone could help me please?
this is my xml:
#########################################
<?xml version "1.0" encoding "utf-8"?>
<dictionary>
<item>
<key>
<string> hello world </string>
</key>
<value> <anytype xmlns:q1="http://www.w3.org/2001/XMLSchame" d4p1:type="q1:int"
xmlns:d4p1="http-instance">45</anytype>
</value>
</item>
</dictionary>
and this is my code:
########################################
string path = "D:\\myXmlFile.xml";
DataSet oDs = new DataSet();
oDs.ReadXml(path);
GridView1.DataSource = oDs;
GridView1.DataBind();
thanks
Tom
|
|
|
|
|