CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_forms Tags:
Item Type: NewsGroup Date Entered: 2/16/2007 11:54:06 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 11 Views: 2 Favorited: 0 Favorite
12 Items, 1 Pages 1 |< << Go >> >|
wish_dev
Asp.Net User
i want to send gridveiw in mail2/16/2007 11:54:06 AM

0

hey sir i am using vs2005 and language c#

and i am working on a shopping cart and after checkout and on click confirm order i want to send a mail to client with mail i want to add that gridview which is display on page.

is it possible


Devendra Rathore || ASP.NET,VS 2005,C#,XML,VB.NET,AJAX,RSS
Web Developer || IFW Creations
Yani Dzhurov
Asp.Net User
Re: i want to send gridveiw in mail2/16/2007 3:10:03 PM

0

Hi,

why don't you simply get the html rendered by your grid view , and send it over the mail ?

Try sth like:

<asp:GridView ID="GridView1" runat="server">
            </asp:GridView>

public partial class _Default : System.Web.UI.Page
{

//

// it could not be the page load event here ...

//
    protected void Page_Load(object sender, EventArgs e)
    {
        StringWriter stringWriter = new StringWriter();
        HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
        GridView1.RenderControl(htmlWriter);
       
        string html = stringWriter.ToString();

//

// send the html to the mail here ....

//
    }
// you need to ovverride this fun to be able to render the control into html writter
    public override void VerifyRenderingInServerForm(Control control)
    {       
    }
}


Thanks,


Yani Dzhurov

wish_dev
Asp.Net User
Re: i want to send gridveiw in mail2/17/2007 8:56:32 AM

0

sir i am trying to implement this code but i get a erroe like this

 

System.Web.HttpException: Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server.

and i already have a form tag with runat server and gridview also have runat server then why i get like this error.


Devendra Rathore || ASP.NET,VS 2005,C#,XML,VB.NET,AJAX,RSS
Web Developer || IFW Creations
Yani Dzhurov
Asp.Net User
Re: i want to send gridveiw in mail2/17/2007 11:26:58 AM

0

it is essential to have that function in the code behind:

public override void VerifyRenderingInServerForm(Control control)
{       
}

there is no need to put any implementation there. Just place it in the cs code 


Thanks,


Yani Dzhurov

e_screw
Asp.Net User
Re: i want to send gridveiw in mail2/17/2007 1:24:42 PM

0

wish_dev:

System.Web.HttpException: Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server.

Is this not a re-post of http://forums.asp.net/thread/1583277.aspx ? You got an answer there check!

Thanks


Its not so easy to do... So you are here!

Electronic Screw
Website||Blog||[email protected]
wish_dev
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 9:20:32 AM

0

i am using ajax 1.0 and then i done this

when i mail normal datagird it will work but when i mail with image and with ajax enabled form i will get like this error

Error loading web control. ---> System.InvalidOperationException: RegisterForEventValidation can only be called during Render(); at System.Web.UI.ClientScriptManager.RegisterForEventValidation(String uniqueId, String argument) at System.Web.UI.WebControls.TextBox.AddAttributesToRender(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) at System.Web.UI.WebControls.TextBox.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.TableCell.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.WebControls.Table.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.GridView.Render(HtmlTextWriter writer, Boolean renderPanel) at System.Web.UI.WebControls.GridView.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ?.?.?(Control ) --- End of inner exception stack trace --- at ?.?.?(Control ) at aspNetEmail.EmailMessage.AppendControlToBody(Control control) at navigation_CheckOut.Button5_Click(Object sender, EventArgs e) in c:\Inetpub\wwwroot\RajasthanJewellery\User\CheckOut.aspx.cs:line 760


Devendra Rathore || ASP.NET,VS 2005,C#,XML,VB.NET,AJAX,RSS
Web Developer || IFW Creations
Yani Dzhurov
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 9:46:38 AM

0

try setting the enable event validation property of the page directive to false;

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Title="Untitled Page" EnableEventValidation="false" %> 


Thanks,


Yani Dzhurov

wish_dev
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 11:06:17 AM

0

Thanks very much sir,

now it's working good but i have one more problem realted to this.

in my gridview i have one image field in mail their is no image display.

can u help me in this also.

pls sir.

 


Devendra Rathore || ASP.NET,VS 2005,C#,XML,VB.NET,AJAX,RSS
Web Developer || IFW Creations
Yani Dzhurov
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 11:33:03 AM

0

how do you specify the src of the images?

Please, paste the asp code for the grid view, and the generated html from the mail that does not show the images.

The images src should be absolute urls in order to be visualized correctly on the mail client side.


Thanks,


Yani Dzhurov

wish_dev
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 11:43:36 AM

0

ok sir i will try it.

as soon as possible


Devendra Rathore || ASP.NET,VS 2005,C#,XML,VB.NET,AJAX,RSS
Web Developer || IFW Creations
wish_dev
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 12:15:59 PM

0

 

<

ItemTemplate>

<img id="Img10" runat="server" alt='<%# Eval ( "image1" ) %>' height="50" src='<%# Eval ("image1", "http://www.rajasthanjewellery.com/DataImages/GoldJewellery/{0}" ) %>'

width="50" />

</ItemTemplate>

like this sir

i am going right.


Devendra Rathore || ASP.NET,VS 2005,C#,XML,VB.NET,AJAX,RSS
Web Developer || IFW Creations
Yani Dzhurov
Asp.Net User
Re: i want to send gridveiw in mail2/19/2007 2:12:46 PM

0

ok, looks good

what about the html ?

view the source html of the mail.

Also what mail client do u use ?

Some mail clients (like the google web mail client) blocks automatically images and you need to allow it explicitly to show it (for example in gmail there is a button 'Display images below'). Probably this could be your case?

 


Thanks,


Yani Dzhurov

12 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0 for Dummies Authors: Bill Hatfield, Pages: 414, Published: 2005
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Beginning ASP.NET 3.5 in VB 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 956, Published: 2007
C# for programmers/ Harvey M. Deitel, Paul J. Deitel Authors: Paul J. Deitel, Pages: 1317, Published: 2006
Visual C#: how to program Authors: Harvey M. Deitel, Pages: 1591, Published: 2006
Expert ASP.NET 2.0 Advanced Application Design: Advanced Application Design Authors: Dominic Selly, Andrew Troelsen, Tom Barnaby, Pages: 459, Published: 2005
ASP.NET 2.0 Website programming: problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
ASP.NET 3.5 For Dummies Authors: Ken Cox, Pages: 404, Published: 2008
Buku Latihan : Asp.net 2.0 Dengan Visual Basic 2005 Authors: Ario Suryo Kusumo, Pages: 0, Published: -1

Web:
Send gridview in Mail - ASP.NET Forums I want to send an email through my web application and in that email I want to send the gridview contents in the same table / gridview form. ...
send email by using Gridview data You need to loop through the rows in the gridview to retrieve all the email addresses you want - use a foreach loop for this. You will need to have an email ...
DotNetSlackers: Send an e-mail with the content of a GridView Apr 3, 2007 ... Net Forum about how to expert and send an e-mail with the content of a GridView in ASP.Net 2.0. So I decided to post a short post about how ...
E-Mail a GridView Control in message body - WebDeveloper.com I am trying to send a GridView control in the body of an e-mail, System.Net. ... If I want to render all controls in a page “this.form1. ...
populate a gridview and email the gridview from a DropDownList ... Hey thanks for the advice, but i want to send the email thru the ... Anyway i figured out how to populate the gridview from the DDL. here is ...
Email GridView with an unbound input field - ASP Message Board The RenderControl allows me to send the GridView table via email and show up .... Also, I understand what you're doing, you want the grid to ...
datagrid or gridview within email : send, email, gridview, datagrid May 11, 2007 ... i want to send a datagrid or gridview by email, i have this http://aspnet. 4guysfromrolla.com/articles/091102-1.aspx i sent the code by email ...
.NET ASP.NET Gridview: embedding a texbox and button in each row ... For *each* row in the gridview, I would there to be two ... will fill in an e- mail address and press the button if they want to send that ...
Sunil Kumar Saini: One Click Grid to Email You guys know that exporting the data from the Gridview control to MS .... Moreover, these lines of code are not even needed for Send email ... thank you so much i have done work to send the mail successfully.but now i want to create an ...
Send multiple emails from a GridView, selected by checkboxes ... Send multiple emails from a GridView, selected by checkboxes CodeBank ... This code sample is useful if you want to open the user's email ...






converting web site into web application

can not find typename of objectdatasource???

adding events in code behind for controls declared in designer.cs???

user control libraries - interesting use of generics and proxy user controls

right click view in browser missing

user control libraries

constant error when opening solution after manually converting to web application project

using web application projects with objectdatasource

resource expressions work in dev, not in production

wsdl.exe schema validation bugs

with web deployment project

publishing web site from command line

install "update to support web application projects" error

single page-level assemblies not working as expected

object reference not set to an instance of an object. - in a .ascx control tag?!?!?!

name clash with 'login', 'menu' and others

working with web application and web site project

help regarding a project

remove the need to "set start page"

code behind code generator

aspnet_compiler vs. vs publish for web application projects

issue in app_code folder in asp.net web application project

problems with file upload

"find all references" no longer works in web app projects under vs 2005?

all files getting deleted from my computer during web application development...... more then 10 times untill now

element 'element name here' is not a known element. this can occur if there is a compilation error in the web

problems getting webprofile to work with custom profile

deploying sub projects

wap & tfs source control

?? can i remove the virtual directory from the development server ??

   
  Privacy | Contact Us
All Times Are GMT