Click here to Skip to main content
15,914,016 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: mail sending problem Pin
GDMFSOB28-Oct-08 21:12
GDMFSOB28-Oct-08 21:12 
GeneralRe: mail sending problem Pin
raghvendrapanda28-Oct-08 21:26
raghvendrapanda28-Oct-08 21:26 
GeneralRe: mail sending problem Pin
Himanshu Manjarawala23-Apr-12 19:49
Himanshu Manjarawala23-Apr-12 19:49 
AnswerRe: how to issue STARTTLS command Pin
GDMFSOB28-Oct-08 21:35
GDMFSOB28-Oct-08 21:35 
QuestionHow do I restrict IPv6 IP Address Ranges? Pin
GDMFSOB28-Oct-08 20:42
GDMFSOB28-Oct-08 20:42 
QuestionRegular Expression Pin
varsh1228-Oct-08 20:24
varsh1228-Oct-08 20:24 
AnswerRe: Regular Expression Pin
Christian Graus28-Oct-08 20:42
protectorChristian Graus28-Oct-08 20:42 
AnswerRe: Regular Expression Pin
Eduard Keilholz28-Oct-08 21:57
Eduard Keilholz28-Oct-08 21:57 
GeneralRe: Regular Expression Pin
varsh1228-Oct-08 23:33
varsh1228-Oct-08 23:33 
GeneralRe: Regular Expression Pin
Eduard Keilholz29-Oct-08 0:31
Eduard Keilholz29-Oct-08 0:31 
QuestionHow to get the Gridview data into DataTable [modified] Pin
K V Sekhar28-Oct-08 20:08
K V Sekhar28-Oct-08 20:08 
AnswerRe: How to get the Gridview data into DataTable Pin
meeram39528-Oct-08 21:18
meeram39528-Oct-08 21:18 
GeneralRe: How to get the Gridview data into DataTable Pin
K V Sekhar28-Oct-08 21:28
K V Sekhar28-Oct-08 21:28 
GeneralRe: How to get the Gridview data into DataTable Pin
K V Sekhar28-Oct-08 21:47
K V Sekhar28-Oct-08 21:47 
GeneralRe: How to get the Gridview data into DataTable Pin
K V Sekhar28-Oct-08 22:12
K V Sekhar28-Oct-08 22:12 
GeneralRe: How to get the Gridview data into DataTable Pin
meeram39529-Oct-08 1:02
meeram39529-Oct-08 1:02 
AnswerRe: How to get the Gridview data into DataTable Pin
S.Dhanasekaran28-Oct-08 21:36
S.Dhanasekaran28-Oct-08 21:36 
QuestionUsers Loose Sessions Pin
Vimalsoft(Pty) Ltd28-Oct-08 19:51
professionalVimalsoft(Pty) Ltd28-Oct-08 19:51 
AnswerRe: Users Loose Sessions Pin
Christian Graus28-Oct-08 20:40
protectorChristian Graus28-Oct-08 20:40 
GeneralRe: Users Loose Sessions Pin
Vimalsoft(Pty) Ltd28-Oct-08 21:05
professionalVimalsoft(Pty) Ltd28-Oct-08 21:05 
GeneralRe: Users Loose Sessions Pin
LloydA11129-Oct-08 5:33
LloydA11129-Oct-08 5:33 
QuestionGetting Error when exporting Gridview data to excel Pin
Satish - Developer28-Oct-08 19:41
Satish - Developer28-Oct-08 19:41 
Hi, when i am exporting gridview data to excel file, i am facing following error.. can any one give idea..why it so like this?

"Control 'GVExcel' of type 'GridView' must be placed inside a form tag with runat=server."

My code is as follows
mypage.aspx
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GVExcel" runat="server">
        </asp:GridView>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
    </form>
</body>


Mypage.aspx.cs

string connstr = "Data Source=ORG33;Initial Catalog=MYDatabase;User ID=sa;Password=miller";
SqlConnection sqlcon = new SqlConnection(connstr);
sqlcon.Open();

string cmdcnt = "Select top 10 * from ORG_TBL_INDSEEDFirst";
SqlDataAdapter sqlda = new SqlDataAdapter(cmdcnt, sqlcon);
sqlda.Fill(ds);
dt = ds.Tables[0];

GVExcel.DataSource = dt;
GVExcel.DataBind();

StringWriter stringWrite = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GVExcel.RenderControl(htmlWrite); ---Getting Error here

sqlcon.Close();

G. Satish

QuestionCalling java script Pin
alok_2k328-Oct-08 19:14
alok_2k328-Oct-08 19:14 
QuestionCrystal Report (PDF Format) Pin
LishaDamian28-Oct-08 18:52
LishaDamian28-Oct-08 18:52 
Questionasp.net ebooks Pin
open your mind28-Oct-08 18:22
open your mind28-Oct-08 18:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.