|
I tried this this but this is not working.
Thanks and regards,
Amit Patel
|
|
|
|
|
Google can. There are loads of examples.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Dear All,
I would like to send emails to the clients in accordance with their choice (shopping), I would like it to be formatted, so I thought of HTML body however, it seems difficult to convert gridview datasource to HTML, Is there any easy way to reach the HTML source of a page and assign it to an HTML Text.
Thanks alot.
Below you may see a samle page to be sent.
<table style="margin-left:auto; margin-right:auto; position:relative;">
<tr>
<td>
<div id="centrallarge">
<h1 style="height:85px; width:900px;"><img src='http://www.salatabufesi.com/images/SalataPage.jpg' alt="Salata"/> </h1>
<h1 style="height:45px; width:900px;"><img src='http://www.salatabufesi.com/images/SalataBufesi.jpg' alt="Salata Büfesi"/> </h1>
</div>
</td>
</tr>
<tr>
<td>
<div id="central" style="height:400px; margin-top:30px;">
<table id="Tablo" style="margin-left:auto; margin-right:auto; position:relative;">
<tr id="Satir1" style="height:25px; vertical-align:top;">
<td width="901" id="Sutun1">
<span id="lblAciklama" style="color:Red;font-family:Tahoma;">Siparişiniz elimize ulaşmıştır</span> </td>
</tr>
<tr style="height:25px; vertical-align:top;">
<td>
<span id="lblOnMusteri" style="color:Red;font-family:Tahoma;">Sipariş Adresi: </span>
<span id="lblMusteri" style="font-family:Tahoma;">İstasyon Cad Nuriye Hnm Apt No:17/14 .</span>
</td>
</tr>
<tr style="height:25px; vertical-align:top;">
<td>
<span id="lblOnOdeme" style="color:Red;font-family:Tahoma;">Ödeme Şekli: </span>
<span id="lblOdeme" style="font-family:Tahoma;">Banka Kartı/Kredi Kartı.</span>
</td>
</tr>
<tr style="height:50px; vertical-align:top;">
<td>
<span id="lblEkAciklama" style="font-family:Tahoma;">Eğer görevli kişi ilgili POS makinesini getirmeyi unutmuşsa, lütfen geri gönderip, POS makinesini getirmesini talep ediniz.</span>
</td>
</tr>
<tr style="height:200px; vertical-align:top;">
<td>
<div id="UpdatePanel1">
<div>
<table width="897" border="1" cellpadding="3" cellspacing="2" rules="all" id="dgSiparisler" style="background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;font-family:Tahoma;font-size:11pt;">
<tr style="color:White;background-color:#A55129;font-weight:bold;">
<th width="67" align="left" scope="col">Adet</th>
<th width="683" align="left" scope="col">Salata Adı</th>
<th width="106" align="left" scope="col">Tutar</th>
</tr><tr valign="top" style="color:#8C4510;background-color:#FFF7E7;border-style:None;font-family:Tahoma;height:25px;">
<td>
<span id="dgSiparisler_ctl02_lblAdet">1</span>
</td><td>
<span id="dgSiparisler_ctl02_lblMenuAdi">Ton Balıklı</span>
</td><td>
<span id="dgSiparisler_ctl02_lblKullaniciAdi">8,00</span>
</td>
</tr><tr valign="top" style="color:#8C4510;background-color:#FFF7E7;border-style:None;font-family:Tahoma;height:25px;">
<td>
<span id="dgSiparisler_ctl03_lblAdet">1</span>
</td><td>
<span id="dgSiparisler_ctl03_lblMenuAdi">(Cherry Domates, Domates, Loloroso (Kırmızı Marul), Marul, Mısır, Renkli Biber, Salatalık, Salatalık Turşusu, Soya Filizi, Ton Balığı, Limon, Zeytin Yağı)</span>
</td><td>
<span id="dgSiparisler_ctl03_lblKullaniciAdi">8,00</span>
</td>
</tr><tr valign="top" style="color:#8C4510;background-color:#FFF7E7;border-style:None;font-family:Tahoma;height:25px;">
<td>
<span id="dgSiparisler_ctl04_lblAdet">1</span>
</td><td>
<span id="dgSiparisler_ctl04_lblMenuAdi">Coca Cola Light 33ml</span>
</td><td>
<span id="dgSiparisler_ctl04_lblKullaniciAdi">2,00</span>
</td>
</tr><tr valign="top" style="color:#8C4510;background-color:#FFF7E7;border-style:None;font-family:Tahoma;height:25px;">
<td>
<span id="dgSiparisler_ctl05_lblAdet">1</span>
</td><td>
<span id="dgSiparisler_ctl05_lblMenuAdi">Ayran</span>
</td><td>
<span id="dgSiparisler_ctl05_lblKullaniciAdi">2,00</span>
</td>
</tr><tr valign="top" style="color:#8C4510;background-color:#FFF7E7;border-style:None;font-family:Tahoma;height:25px;">
<td>
<span id="dgSiparisler_ctl06_lblAdet">1</span>
</td><td>
<span id="dgSiparisler_ctl06_lblMenuAdi">Fanta 33 ml</span>
</td><td>
<span id="dgSiparisler_ctl06_lblKullaniciAdi">2,00</span>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
|
|
|
|
|
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);
This might help.
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
good answer it seems exactly what I need.
thanks
|
|
|
|
|
hello..I create project online exam with database sql server ...
For multiple question there are many answers for each one questions.
Example: question A have 5 answer
question B have 18 answer
I want to loop answers of question of A(id=1) to textBox: Ans1,Ans2,Ans3,...Ans10 according to number of answers..
Please help me..
thanks
|
|
|
|
|
Use a group by query to get your data and use them accordingly.
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Thank to reply..
can u give me some example?
|
|
|
|
|
what exactly you've done up til now?
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
i'm not reach any result.
|
|
|
|
|
CREATE TABLE Questions
(
QuestionID int IDENTITY(1,1),
QuestionText varchar(1000)
)
CREATE TABLE Answers
(
AnswerID int IDENTITY(1,1),
AnswerText varchar(1000),
IsCorrectAnswer bit DEFAULT(0),
QuestionID int
)
SELECT AnswerID, AnswerText
FROM Answers
WHERE (QuestionID = 1234)
|
|
|
|
|
thanks for reply...
I don't need this TSQL.. but i want to apply this data that have selected to TextFields in webform...
I have 10 textfield of answer for the maximum 10 answers ,but the answer of question that we sellect could be 2,3,4,5,8...
|
|
|
|
|
Please correct your question, it's not clear.
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
How to convert a string to stream and pass that stream to XMLElement function call
|
|
|
|
|
Please be more specific. Your question is vague.
|
|
|
|
|
Respected,
How we attached Multiple file for send mail.
Thanks.
|
|
|
|
|
|
Hello everyone,
I want to put streaming video files(.wmv) on my server and want to access them from client computers. Also don't know how to access these videos from my web application.
Please help me on this
thanks in advance
Regards
Yrisi
|
|
|
|
|
hiii m using datatable.i want to get the row by its id.
for this i have coded:
public decimal GetItemTotal()
{
int intcounter = 0;
decimal decRunningTotal = default(decimal);
DataTable dt = Session("Cart");
DataRow dr = default(DataRow);
for (intcounter = 0; intcounter <= dt.Rows.Count - 1; intcounter++) {
dr = dt.Rows(intcounter);
decRunningTotal += (dr("ItemPrice") * dr("ItemQty"));
}
return decRunningTotal;
}
its gives error on line:
dr=dt.Rows(intcounter)
error:rows is property but is used like method.
tell me hw can i retrive row by its id.
|
|
|
|
|
mylogics wrote: dr = dt.Rows(intcounter);
try using like this,
dr = dt.Rows[intcounter];
|
|
|
|
|
I m adding columns in gridview at runtime ,but these get lost at postbask,I have to reload all at postback ,how should i add columns that it donot disappear at postback.
|
|
|
|
|
Are you binding to your data source in postback ? If you are, you'll lose your columns. If not, I'd have thought not.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
if i do like
if(!ispostback)
{
gridview.datasource=datasource;
}
all the columns disappear,I have to reload/bind with datasource at postback.
I m adding columns in grid like this
private void AddColumns()
{
TemplateField bfield = new TemplateField();
try
{
HeaderText = GetGlobalResourceObject("ViewQuotations", col.ColumnName).ToString(); //Assigns the name of the column in the lable.
}
catch (Exception e)
{
HeaderText = col.ColumnName;
}
//Initalize the DataField value.
bfield.HeaderTemplate = new GridViewTemplate(ListItemType.Header, col.ColumnName, HeaderText);
//Initialize the HeaderText field value.
bfield.ItemTemplate = new GridViewTemplate(ListItemType.Item, col.ColumnName);
//Add the newly created bound field to the GridView.
grdViewEqpCard.Columns.Add(bfield);
}
|
|
|
|
|
Your datasource should be dynamic. Make your datasourse (datatable, dataset) at runtime and bind it to the grid (grid should've it's property AutoGeneratedColumns to True)
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
I need to add some links and radiobuttons in gridview columns at gridview row bound event ,that 's the reason i myself adding fields in gridview,not setting its autogenerate columns ot true
|
|
|
|