|
Thanks So Much. It works!!!
|
|
|
|
|
I need to delete a PDF file after it’s opened in browser. The following code give me “Page can not be found error”. How can I make sure that the file has been open in browser before deleting it?
If File.Exists(fileName) = True Then
Dim sScript As New System.Text.StringBuilder
sScript.Append("" & vbCrLf)
sScript.Append("Report = window.open('" & fileName & "','Report', '');" & vbCrLf)
sScript.Append("if (parseInt(navigator.appVersion) >= 4) Report.window.focus();" & vbCrLf)
sScript.Append("" & vbCrLf)
Page.ClientScript.RegisterStartupScript(GetType(Page), "winReport", sScript.ToString)
page.Response.Clear()
File.Delete(fileName)
End If
|
|
|
|
|
I could be wrong here but I think if you attempt to delete a file thats currently open you're going to get an error as you cannot delete somethings that opened (being used)
"Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean."
Tom Welch
|
|
|
|
|
The error message “Page can not be found” indicates that the file has been deleted when browser try to open the file. When I comment out the code File.Delete(fileName) the new browser window will open the file. And also I can manually delete the file without any error when the browser still open.
|
|
|
|
|
the core question is, what are you trying to do ? You really cannot tell when this code has finished reading the file, perhaps if it's a temporary report, your code should delete then in batches. If you're using the same filename over and over, then you risk collisions if you have more than one user, so I assume you're creating unique filenames. Perhaps a service that deletes files that are more than an hour old ?
The other way is to create a popup that calls an aspx, which reads the PDF and pushes it down in the code behind, setting the mime type, etc. That way, you'll know it's gone and can delete it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What I'm trying to do is to create a PDF file from a local report viewer and open the file from IE browser. In this way, client have full control on the report, like to print selected page. (I know that the server side report viewer can do the same but we're not ready to use it yet.) I use session ID as file name so it should no problem for other session user.
Can you show me some examples on popup and mime type?
Thanks in advance.
|
|
|
|
|
Hey guys, I don't really have a problem, I'm just looking for the best way to do something.
I have an entry form where some information needs to be entered into a SQL database, but it's in a (Two of these fields, actually) Varchar(MAX) field. So the information entered could be one line, or a paragraph. There's really no way for me to know.
I need to display several fields from three different databases into a gridview (that's already done) including the two varchar(MAX) fields.
So my question is, what would be the best way to go about this? I know I could just let it all just display in the gridview as is, but that would probably really make things look untidy and unorganized if there were paragraph style enteries for all 10 records displaying on a page.
Any suggestions would help.
Thanks,
aqzman
|
|
|
|
|
Have you tried looking into Master-Detail view? You could have a DetailView created and on the select event display the two fields in the DetailView rather than the gridview.
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
|
|
|
|
|
I have used a multi-line textbox. So then I can set the width and there is a scroll bar. The only issue is when you only have one line or no data at all then it looks a little weird to have a fixed multi-line textbox. I have written some code that checks the length and then decides which control to so. When there is big enough string I use the multi-line textbox if it is smaller then I just a label.
Hope that helps.
Ben
|
|
|
|
|
Thanks for both of your replies! I'll try your method, kubben.
|
|
|
|
|
Hi guys!
I am very new to this AJAX, I am performing certain functionlity with AUTOCOMPLETE.
eg: I am displaying Employee Fullname in autocomplete List, on mouse over on FullName's in List Automatically i need to display their Details like Dept, Manager, Salary, HRA etc.,
How can i perform this action ? folks Please help me on this
|
|
|
|
|
you have to add some event handler for 'onhover' then you have to write the functionality in the javascript.
In that code, you have to call the xmlHttp object. This object will be used to retrieve the data from the server.
refer the following article
http://www.codeproject.com/Ajax/dropdown_box_using_ajax.asp[^]
All The Best
Sathesh Pandian
|
|
|
|
|
Hi sathish,
You mean to say onMouseover function can help me ?
I am very new to this technology, can you help me more on this. appreciate your concerns.
My work around is similar to the in following link >
AutoComplete_From_Database < when results are populated in the list. Upon mouse over on any name i need to display details.
Thanks & regards,
Krishnamenon
|
|
|
|
|
I have a report in Crystal Report that has parameter. when the report is loaded in ASP.NET doesn't show the prompt to enter the value for the report. Any suggestion ? I appreciate your help.
|
|
|
|
|
Why not have the parameter in code and just have the user enter the parameter through a webform?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I don't have any idea how to write the parameter in code.
|
|
|
|
|
I am looking for the code or the codes of like works to the parameters of Crystal Report in C#. I need help about it. I appreciate your help..
|
|
|
|
|
Hi all,
I used the following code when the page used normal html tables, now that I changed it to asp tables it is no longer valid, how can I loop that row using asp table?
<%for (int i = 0; i << MenuItems.Tables[0].Rows.Count; i++)
{
%>
<asp:TableRow style="height:26px">
<asp:TableCell style="background-image:url(<%=navigationImage %>); text-align:center; vertical-align:middle"><a href="<%=MenuItems.Tables[0].Rows[i]["menu_url"].ToString() %>"><%=MenuItems.Tables[0].Rows[i]["menu_text"].ToString() >></a>
</asp:TableCell>
</asp:TableRow>
<%
}
%>
thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Are you adding TableRow in asp Table ?
I Love SQL
|
|
|
|
|
Yes, that is all Client side within the asp:Table.
Basically what happens is that I load the menu items from the db, then for each link I want to add a row. I first used a normal html for that and it worked, now I changed it to an asp:Table and it tells me that "Code Blocks in this context is not supported"
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
|
Thanks, I changed the asp Table back to a normal html table and got it working.
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Can anyone please explain the difference between these two different version.
Please give some article or your answer as soon as possible.What are the advantages of 2.0 over 1.1
adil kazmi
|
|
|
|
|
|