|
|
|
Hi i have an html report in asp.net
I want to export html report to word ..
I am able to do that by following code ..but i want to have predefined header and footer in exported word document...
so how to set header/footer of ms-word document from asp.net code.
------------------------------------------CODE-----------
string strHTMLContent = reader.ReadToEnd();
strHTMLContent = strHTMLContent.Replace("#Education#", "BE");
strHTMLContent = strHTMLContent.Replace("#Position#", "Software Engineer");
lblmsg.Text = strHTMLContent;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/ms-word";
string strFileName = "new1" + ".doc";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + strFileName);
HttpContext.Current.Response.Write(strHTMLContent);
HttpContext.Current.Response.End();
HttpContext.Current.Response.Flush();
|
|
|
|
|
I am new to this .net world.
I like to know how we can run .exe files with asp.net page
plz help me.........
|
|
|
|
|
Just for performing background operations u can use it since server side process are not visible to end users
MSDN[^]
|
|
|
|
|
Anjani Poornima wrote: I am new to this .net world.
I like to know how we can run .exe files with asp.net page
Asp.Net does not build for that. if you use process start exe it will start in Server not in client side.
If you want to really do that, use ActivX and It will work only in IE.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Thank you.....
I tried using system.diagoistics.process.start(".exe");
But it just works in the development side not the webserver. that means. when I click run in the VS.net, it can open a .exe . when i publish it to our web server. I just can see the .exe running under the task manager in the server side, but I can not see any .exe any input will be greatly appreciated.
|
|
|
|
|
Anjani Poornima wrote: I tried using system.diagoistics.process.start(".exe");
But it just works in the development side not the webserver. that means. when I click run in the VS.net, it can open a .exe . when i publish it to our web server. I just can see the .exe running under the task manager in the server side, but I can not see any .exe any input will be greatly appreciated.
As, I have already told you, Process.Start will execute process in Server not in Client. So This will not do the job for you.
First of all think why you need to execute the exe in Asp.net? Any alternative option to solve this.
If you need it then Go for ActiveX control and I have already suggested you it will work only in IE.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
|
Sreekumar P P wrote: Forum: ASP.NET
Subject: Re: How to run an .exe from asp.net page
Sender: Sreekumar P P
Date: Wednesday, April 29, 2009 7:01 PM
--
What was that ?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
hi;
i can't solve this error.This become a headache to me.i have no problem in source code.plz anyone help me. .
i am getting following from disassemble.
--- d:\E\AjaxTk-AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs
00000000 push edi
00000001 push esi
00000002 mov esi,ecx
00000004 mov edi,edx
00000006 cmp dword ptr ds:[04DA4CC0h],0
0000000d je 00000014
0000000f call 72DF2227
00000014 cmp byte ptr [esi+55h],0
00000018 jne 00000021
0000001a mov ecx,esi
0000001c call FFFFF390
00000021 mov edx,66468A58h
00000026 mov ecx,6DF85B0h
0000002b call 72DF3DB8
00000030 mov edx,edi
00000032 mov ecx,esi
00000034 call 5EE06980
00000039 mov ecx,esi
0000003b call dword ptr ds:[07041FF8h]
00000041 nop
00000042 pop esi
00000043 pop edi
00000044 ret
|
|
|
|
|
Hope you have put the Ajax ControlToolkit Dll in the wrong place.
Please check whether your Ajax extensions installation what correct?
CodingRocks
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
Question Bank
Question 1 This is your first Question?
Option A aaaaa
Option B bbbbb
Option C ccccc
Question 2 This is your Second Question?
Option A aaaaa
Option B bbbbb
Option C ccccc
Question 3 This is your third Question?
Option A aaaaa
Option B bbbbb
Option C ccccc
Question 4 This is your fourth Question?
Option A aaaaa
Option B bbbbb
Option C ccccc
I would like to create a gridView like the above format.
Table name QuestionBank
Fields
questioned
question
optionA
optionB
optionC
Any one can help me.
Email ID cujuno@gmail.com
I am a programmer
|
|
|
|
|
Hi,
First You create Gridview with the Item Template.
I think you need 5 Item Template for the Gridview For Question Id, Question, Option1, Option2, Option3.
Use Option button within the Gridview for Options.
Use Button at the Bottom of the Gridview and when the button is pressed check the Answer with the Correct Answer and Calculate the Marks.
Bye
|
|
|
|
|
I have a datalist which is not bound to any table. There is one texbox and one dropdown in the <itemtemplate> of the datalist. There is a button "Add New Row" on the page.
The requirement:
When I click on the New Button, a new row which has the same textbox and the same dropdown, needs to be displayed. Every time the button is clicked, this should take place.
I have been hunting for this since a long time. Please Help. Thanks.
|
|
|
|
|
hai..i am dng a project on software updation..
for that i need to collect the installed software information in a remote computer, from the server system.i need to store the information in a notepad in the server system..fields i want are
name of software,version,install date,etc..
for collecting information abt the remote system softwares,i want a valid vb code..pls..its urgent
thank you
|
|
|
|
|
Hi,
I just want to know how to show a message box in c#
in vb.net i was using like this;
MessageBox.Show("Data Saved ...", "Test", MessageBoxButtons.OK, MessageBoxIcon.Warning) for to get such a message what i have to use in asp.net with C#
Thanks&Regards
Princy
|
|
|
|
|
ASP.Net is a server side code and u wanted to show any message to end user on web based application then u go with javascript alert method or try to have new web page just for showing messages alone.
|
|
|
|
|
Hi,
You can use any one of the Following Syntax in Code Behind.
string Msg = "Hai";
string jv = "alert('" + (Msg) + "');";
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", jv, false);
(or)
Page.RegisterStartupScript("Error", "alert('Hai')");
bye
|
|
|
|
|
See this
http://vuyiswamaseko.blogspot.com/2009/04/how-to-show-mesage-box-in-aspnet.html[^]
Hope it Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa,
I saw your post. its cool. Will it work if we have ScriptManager in that page?
In that case you have to use ScriptManager insted of ClientScript. You may add this section also on that post.
Thanks !
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Yes it will work. Will add it
Thanks !
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Good Morning All
I have a Menu Control
<asp:menu id="Menu2" runat="server" backcolor="AliceBlue" bordercolor="SteelBlue" xmlns:asp="#unknown">
BorderStyle="Solid" BorderWidth="1px" DynamicHorizontalOffset="2" Font-Names="Verdana"
Font-Size="8pt" ForeColor="Black" Height="20px" OnMenuItemClick="menureplace_MenuItemClick"
StaticSubMenuIndent="10px" Width="87px">
< dynamichoverstyle backcolor="#7C6F57" forecolor="White" />
< dynamicmenustyle backcolor="White" bordercolor="Black" borderstyle="Solid" borderwidth="1px" />
< staticselectedstyle backcolor="#5D7B9D" />
< dynamicselectedstyle backcolor="#5D7B9D" />
< dynamicmenuitemstyle font-names="Verdana" font-size="10pt" forecolor="#C00000" horizontalpadding="5px">
VerticalPadding="2px" />
< items>
< asp:menuitem text="Replace selected" value="Replace selected">
<asp:menuitem text="Confirm Replace" value="Replace Selected"></asp:menuitem>
< /asp:menuitem>
< /items>
< statichoverstyle backcolor="#7C6F57" forecolor="White" />
< /dynamicmenuitemstyle></asp:menu>
And This Menu Control works Fine outside the View Control. How can i make it work inside the View Control ?
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi,
Am having textbox in Gridview.I need to set the focus(i.e. the cursor should place inside textbox) when add link button is clicked. For this i have used java scipt.
function Click_Enter(CID,event)
{
var key;
key=(event.which) ? event.which : event.keyCode;
if(key==13)
{
document.getElementById(CID).focus();
}
return true;
}
And in code behind of link button click event
ImageButton ibtnSave = (ImageButton)gvBillingType.FooterRow.FindControl("ibtnSave");
TextBox txtAddcontrol = (TextBox)gvBillingType.FooterRow.FindControl("txtFooterBillingType");
Page.RegisterStartupScript("SetFocus", "document.getElementById('" + txtAddcontrol.ClientID + "').focus();");
txtAddcontrol.Attributes.Add("onkeydown", "javascript : return Click_Enter('" + ibtnSave.ClientID + "',event);");
this code is Wkg in Mozila.. but in IE it is not WKG.. Pls anyone help me fast.
|
|
|
|
|
Hai,
I don't know about it.
|
|
|
|