|
Hai,
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(style);
Response.Write(sw.ToString());
Response.End();
Thanks
Subbu.
|
|
|
|
|
Just put the following code:
public override void VerifyRenderingInServerForm(Control control)
{
}
And it works fine.
|
|
|
|
|
Hi..
Can any one please help me in the following,
To write an asp page for opening a file (.doc, .xls or .pdf) by clicking a link in a asp page.
The file name pattern is <currentdate>.pdf for ex.07.09.07.pdf
Thanks in advance..
|
|
|
|
|
hai..
i need to open a text file or word document in my web page if i click on one button ...hw can i do that ...plz help me out..
|
|
|
|
|
You can use file management classes.
1- StreamReader , used for reading
2- StreamWriter , used for writing
To open a text file and showing it's content, first you need to map the file using Server.MapPath() . Give the mapped file name to StreamReader object and user ReadToEnd() method. Assign the content to a Lable/Literal control. You are almost done
|
|
|
|
|
Hello Everyone,
I've taken a iframe control to provide the facilities like bold,italic and etc like provided by the "RichTextBox" and tht's working properly plz ref. the link
http://www.saamstesting.com/Rough12.aspx
But i want as i click on my "Submit" button then my all formatted text must be displayed in the at my mail. But when i'm sending this mail the mail is being received properly but the formatted text is no there but the text given below is being ther..
System.Web.UI.HtmlControls.HtmlGenericControl
Thnx
|
|
|
|
|
Have u used this "Msg.IsBodyHtml=true; "?
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
|
The Knowledge wrote: System.Web.UI.HtmlControls.HtmlGenericControl
This looks like you are doing Object.ToString() . In IFrame you won't be able to get the value directly in server side. For that assign IFrame value to serverside hidden text box when sumbit button is pressed. Then you can easily fetch the value from that hidden text box.
|
|
|
|
|
Hi again,
In my aspx page I have a table as follow:
first contain a very basic form with 4 server control elements.
second is a IFRAME.
when I click the asp:button in the form I expect to have the result in the IFRAME. (the result is displayed using a GRIDVIEW).
the code behind the button is:
protected void btnSearch_Click(object sender, EventArgs e)
{
Server.Transfer("SearchResult.aspx");
}
My Question is:
What is the syntax Or how do I redirect the SearchResult.aspx to load insinde the IFRAME (the IFRAME id is "Iframe1").
Thanks so much for your response.
Omer
|
|
|
|
|
I am just curious as to why you have decided to use an iframe - if you are just displaying a datagrid with the results why not just put the datagrid on the page. If you are re-using it then why not create the a search results control?
I realise i am not answering your question but i think sometimes its best to question the 'why'
|
|
|
|
|
You know what.... you r right!!!
It's all so new to me.....
10x anyway.
That was one of the best answers I got so far....
|
|
|
|
|
Hi all,
I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode?
Thanks,
Priyank
|
|
|
|
|
|
Thanks, But how can I get it? only thing I have is ID of the dropdownlist at that time.
Priyank
|
|
|
|
|
priyank_ldce wrote: I am creating dynamic dropdownlist in my webpage.
Are you using a content place holder ?
priyank_ldce wrote: Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode?
Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init() , it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.
|
|
|
|
|
N a v a n e e t h wrote: Are you using a content place holder ?
Yes I am using content place holder.
N a v a n e e t h wrote: Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.
I am creating dropdownlist on Page_load event. I want to use value of this dropdownlist for other control in Page_load event.
|
|
|
|
|
priyank_ldce wrote: Yes I am using content place holder.
Well, if you are using Content place holder, then what is the issue ? FindControl() is not working for you ?
|
|
|
|
|
Hey everybody
Does anyone know if its possible to use Yahoo widgets in ASP.Net 2.0??
I see that in the com tab of the Add Reference dialog box that there is a YahooWidgetEngine option....
I tried to add a reference to it and use Yahoo widgets but im not getting it right. I also cant find anything on the web?
If anyone has done it or has a reference to a tutorial on how to do it...please let me know.
Thanks
Dazz
|
|
|
|
|
|
hai all,
i want to show a particular position in aspx page when page loading...
because when i click drop down list,the page wil reload and show its top of the page...
but i want to display the bottom of the page when the page loading......
Any one know reply me....
Thanks And Regards,
vidyasankar N
pain gives gain
|
|
|
|
|
Vidyasankar,
please spacify the smart navigation true . This will resolve your problem.
jitendra
|
|
|
|
|
Hi All
In My page i have written the Server.Transfer within try catch block but whenever i am hiting this page first time it is giving me " Exception Occured at the time of server trasfer is :System.Threading.ThreadAbortException: Thread was being aborted."
i read one artilce regarding this issue but i am not confessed what they are saying.
Anyone body knows what should i do ? and whats the problem ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
This exception is not problematic use catch block with
ThreadAbortException and be continue..
Best Regards,
Chetan Patel
|
|
|
|
|
Yes i did that got information from net also thanks for reply
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|