|
Well Ersan,
I think I have told you, that you can render any control of the page using ctrl.RenderControl() .
Let me know what exactly the problem you are facing. Did you try
gridview.RenderControl from your server side ?
|
|
|
|
|
Hello Abhishek,
I remember, and this was the closest solution, and I though I solve the problem, however I realize I misunderstood you. (by the way I just learn what render does) This is the thing.
I checked your code but it is only working if you create the div. I could not find a way to get server side div (non rendered) definition and render it.
Then:
So I gave up I just tried to render the gridview with the following code where I receive another annoying error mentioning that :" Control 'dgSiparisler' of type 'GridView' must be placed inside a form tag with runat=server."
Code is:
StringBuilder str = new StringBuilder();
StringWriter strw = new StringWriter(str);
HtmlTextWriter htmlw = new HtmlTextWriter(strw);
dgSiparisler.RenderControl(htmlw);
Thanks for help...
|
|
|
|
|
Ersan Ercek wrote: Control 'dgSiparisler' of type 'GridView' must be placed inside a form tag with runat=server."
Have you not placed the Gridview inside a form tag? You need to always mention runat=server for asp Controls(one with asp tagprefix).
I have done this a lot of times, I am sure it works. Ok, show me the code.. I will help you 4 sure.
|
|
|
|
|
Dear Abhishek, here is the code.
Thanks alot...
ASPX PAGE;
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<table id="tobesent" 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>
</td>
<td>
</td>
<td id="Sutun1">
<asp:Label ID="lblAciklama" runat="server" Font-Names="Tahoma" Text=" "></asp:Label>
</td>
</tr>
<tr style="height:25px; vertical-align:top;">
<td>
</td>
<td>
</td>
<td>
<asp:Label ID="lblOnMusteri" runat="server" Font-Names="Tahoma" ForeColor="Red" Text="Sipariş Adresi: "></asp:Label>
<asp:Label ID="lblMusteri" runat="server" Font-Names="Tahoma" Text=" "></asp:Label>
</td>
</tr>
<tr style="height:25px; vertical-align:top;">
<td>
</td>
<td>
</td>
<td>
<asp:Label ID="lblOnOdeme" runat="server" Font-Names="Tahoma" ForeColor="Red" Text="Ödeme Şekli: "></asp:Label>
<asp:Label ID="lblOdeme" runat="server" Font-Names="Tahoma" Text=" "></asp:Label>
</td>
</tr>
<tr style="height:50px; vertical-align:top;">
<td>
</td>
<td>
</td>
<td>
<asp:Label ID="lblEkAciklama" runat="server" Font-Names="Tahoma" Text=" "></asp:Label>
</td>
</tr>
<tr style="height:200px; vertical-align:top;">
<td>
<asp:Image ID="Image1" runat="server" ImageUrl="http://www.salatabufesi.com/images/OK.jpg"/>
</td>
<td style="width: 30px;">
</td>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="dgSiparisler" runat="server" AutoGenerateColumns="False"
BorderStyle="None" Font-Names="Tahoma" Font-Size="11pt" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderWidth="1px" CellPadding="3" CellSpacing="2">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle Font-Names="Tahoma" BorderStyle="None" Height="25px"
VerticalAlign="Top" BackColor="#FFF7E7" ForeColor="#8C4510" />
<Columns>
<asp:TemplateField HeaderText="Adet" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblAdet" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Adet")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Salata Adı" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblMenuAdi" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SiparisName")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Tutar" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblKullaniciAdi" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Tutar")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</form>
AND CS PAGE:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["tbl_Salata"] != null)
{
dgSiparisler.DataSource = ((DataTable)Session["tbl_Salata"]);
dgSiparisler.DataMember = ((DataTable)Session["tbl_Salata"]).TableName;
dgSiparisler.DataBind();
Session["tbl_Salata"] = null;
}
StringBuilder sb = new StringBuilder();
StringWriter strw = new StringWriter(sb);
HtmlTextWriter htmlw = new HtmlTextWriter(strw);
dgSiparisler.RenderControl(htmlw);
snd.sendconMail("cinersan@hotmail.com", sb.ToString(), "Üyelik Bilgileri");
}
|
|
|
|
|
Hi Abhishek,
Any news, have you found time to test it? I know I am pain in a.., but this is what i need to finalize the site..
Thanks alot.
|
|
|
|
|
Hi Abhishek,
Are you dealing with this or shall I define an new entry, if you are no more dealing with that I need assistance from somebody else.
Thanks alot.
|
|
|
|
|
|
Hi
Does anybody know of any tools or methods for displaying a Word document in an ASP.NET application?
Our problem is that we have a library of Word documents that would be very time consuming to build into HTML pages where as the library can be maintained in Word documents easily by some somebody non technical, these items basically form a knowledge base that we wish to present to the site visitor on demand.
Regards and thanks in advance
Andy
|
|
|
|
|
You can dynamically convert the word document to Html and then, display the converted html document.
Directly displaying word document in a browser may not work properly in every browser because some browser tries to download the document instead of directly displaying it.
|
|
|
|
|
Hi
Yes we have tried this however the formatting of the documents is lost and the HTML created is too complex to make it easily alterable.
We have since found out the documents are originally in PDF so we are simply going to embed the PDF documents in the page.
Thanks anyway
Regards
Andy
|
|
|
|
|
Hi
There is one site which publishes word documents to html and displays them in Html ofcourse with nice formatting.
You can check it here www.doxtop.com
--
http://ashakthi.blogspot.com
http://kids-articles.blogspot.com
|
|
|
|
|
|
I Want PDF For asp.net tutorial c#
I Tried Google But I Did Not Find The Simplest One To Start
|
|
|
|
|
sanforjackass wrote: I Want PDF For asp.net tutorial c#
You need Books or Code for converting to pdf..
If Books..!try here[^]
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I guess those are pirated Books ...
|
|
|
|
|
|
Dear all...
I have a dataGrid control, can I split a specific row into many rows ?
Regards...
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Yes why not. Just place controls into datagrid and eval the split value using
ItemDataBound event.
Use DataBinder.Eval("YourColumn").Split(" ")
Is this what you want?
I think using Repeater will be better in this case.
|
|
|
|
|
thanks dear 4 your reply,
I put this line of code
but it does not work well
regards
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
Where did you put?
I think you need to put it under DataBound Event handler. Might be by this way :
private void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
if(e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells(1).Text = "" + DataBinder.Eval(e.Row.DataItem, "colname").ToString().Split(" ") + "";
}
}
The split logic should be placed according to what you require.
Also adjust the code according to what you need.
|
|
|
|
|
thanks alot
it works
Nour Abdel-Salam...
A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)
|
|
|
|
|
nour123 wrote: thanks alot
Glad to hear tht..!
But You Shuld mark it as answer..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi
i want to move 1 list box item to another list box.
i am using this code
http://www.codeproject.com/KB/aspnet/Listbox_or_combo_box.aspx
this is adding value to another list box , but after few seconds all the value removing automatically.
i am using content page.there no post back also happening.
plz any one tell how to solve the problem or give new idea.
|
|
|
|
|
pss.srinivasan wrote: this is adding value to another list box , but after few seconds all the value removing automatically.
I guess it is due to the page refreshment. Is it clearing automatically or after some operation performed ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Is it clearing automatically,but i given break point in page load there cursor is not coming.
|
|
|
|