Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Monday, March 26, 2012

The component ADODB.Connection cannot be created.

I'm trying to migrate some code written in ASP.NET 1.14 to ASP.NET 2.0. We need to upgrade the Trust level as well and get rid of ASPCompat=True.

When I do this, I get this error: Is there an easy way around this error?

The component 'ADODB.Connection' cannot be created. Apartment threaded components can only be created on pages with an <%@dotnet.itags.org. Page aspcompat=true %> page directive.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Web.HttpException: The component 'ADODB.Connection' cannot be created. Apartment threaded components can only be created on pages with an <%@dotnet.itags.org. Page aspcompat=true %> page directive.

Why not set the AspCompat="True" as the exception said?

Iori_Jay:

Why not set the AspCompat="True" as the exception said?

Yeh, thats a good question. Most of the ISP's in support of asp.net 2.0 are only supporting "Medium Trust". Noone will do "high trust" anymore. AspCompat requires High Trust. I realize the routine causing the problem is the generic class that processes the connections to the database. I guess this could be rewritten to use asp.net data connection algorithms, but the program code that calls the class is expecting a RecordSet.

So is my assumption that this would be a total rewrite correct to avoid aspcompat=True?

The connection is already Open (state=Open, Fetching).

Hello again.

This problem relates to a Business Object that I've created. I get the above error when I try t call a Sub within the business object that inserts into the database. I have various other Subs and Functions that Select from the database and they don't seem to have a problem. I can't see where the connection is being left open... But I've been staring at this all day now so theres a good chance I'm missing something obvious...

The VB for the business object is below. The sub in the aspx page that calls it is:

Sub Button1_Click(Source As Object, E As EventArgs)
dim objForum as New BidwellsDevelopments.PublicForum
objForum.ReplyToForum(pubThreadID, pubUser,oEdit1.Content)
End Sub

And the business object code (the sub in question is at the bottom in bold):

' VB Document
Imports System
Imports System.Data
Imports System.Data.OleDb

Namespace BidwellsDevelopments

Public Class DevelopmentDetails
public DevelopmentID as Integer
public Name' as string
public Description' as string
public Keywords' as string
'public Live' as integer
public Logo' as string
public MainImage' as string
public HomePage' as string
public PostCode' as string
public Address1' as string
public Address2'' as string
public Address3' as string
public Town' as string
public County' as string
public Country' as string
'' public ClientID' as integer
' public ManagerID' as integer
' public CreatorID' as integer
End Class

Public Class Development
Private objConn as new OleDbConnection (System.Configuration.ConfigurationSettings.AppSettings("ConnectionString"))

public function GetDevelopment(developmentID) as DevelopmentDetails


Dim objCmd As New OleDbCommand("spGetDevelopment", objConn)
objCmd.CommandType = CommandType.StoredProcedure

Dim objParam As New OleDbParameter("@dotnet.itags.org.DevelopmentID", OleDbType.Char)
objParam.Value = developmentID
objCmd.Parameters.Add(objParam)
Dim objReader as OleDbDataReader

try
objConn.Open()
objReader = objCmd.ExecuteReader
catch ex as OleDbException
throw ex
end try
dim objDetails as new DevelopmentDetails

while objReader.Read()
objDetails.DevelopmentID = developmentID
objDetails.Name = objReader(1)
objDetails.Description = objReader(2)
objDetails.Keywords = objReader(3)
'objDetails.Live = objReader.GetInt32(4)
objDetails.Logo = objReader(5)
objDetails.MainImage = objReader(6)
objDetails.HomePage = objReader(7)
objDetails.PostCode = objReader(8)
objDetails.Address1 = objReader(9)
objDetails.Address2 = objReader(10)
objDetails.Address3 = objReader(11)
objDetails.Town = objReader(12)
objDetails.County = objReader(13)
objDetails.Country = objReader(14)
'objDetails.ClientID = objReader.GetString(15)
'objDetails.ManagerID = objReader.GetString(16)
'objDetails.CreatorID = objReader.GetString(17)
end while
objReader.Close

return objDetails
End function

End Class

Public Class PublicForum
Private objConn as new OleDbConnection (System.Configuration.ConfigurationSettings.AppSettings("ConnectionString"))


Public function DisplayForum(developmentID) As OleDbDataReader

Dim objCmd As New OleDbCommand("spDisplayPFTopics", objConn)
objCmd.CommandType = CommandType.StoredProcedure

Dim objParam As New OleDbParameter("@dotnet.itags.org.DevelopmentID", OleDbType.Char)
objParam.Value = developmentID
objCmd.Parameters.Add(objParam)
Dim objReader as OleDbDataReader

try
'objCmd.Connection.Open()
objConn.Open()
return objCmd.ExecuteReader
catch ex as OleDbException
throw ex
end try
End Function

Public function DisplayThreads(topicID) As OleDbDataReader
Dim objCmd As New OleDbCommand("spDisplayPFThreads", objConn)
objCmd.CommandType = CommandType.StoredProcedure

Dim objParam As New OleDbParameter("@dotnet.itags.org.TopicID", OleDbType.Char)
objParam.Value = topicID
objCmd.Parameters.Add(objParam)
Dim objReader as OleDbDataReader

try
objConn.Open()
return objCmd.ExecuteReader
catch ex as OleDbException
throw ex
end try
End Function

Public function DisplayMessages(threadID) As OleDbDataReader
Dim objCmd As New OleDbCommand("spDisplayPFEntries", objConn)
objCmd.CommandType = CommandType.StoredProcedure

Dim objParam As New OleDbParameter("@dotnet.itags.org.ThreadID", OleDbType.Char)
objParam.Value = threadID
objCmd.Parameters.Add(objParam)
Dim objReader as OleDbDataReader

try
objConn.Open()
return objCmd.ExecuteReader
catch ex as OleDbException
throw ex
end try
End Function

Sub ReplyToForum (threadID, creatorID, entry)
Dim objCmd As New OleDbCommand("spAddPFEntry", objConn)
objCmd.CommandType = CommandType.StoredProcedure

Dim objParam As New OleDbParameter("@dotnet.itags.org.ThreadID", OleDbType.Char)
objParam.Value = threadID
objCmd.Parameters.Add(objParam)

objParam = New OleDbParameter("@dotnet.itags.org.CreatorID", OleDbType.Char)
objParam.Value = creatorID
objCmd.Parameters.Add(objParam)

objParam = New OleDbParameter("@dotnet.itags.org.Entry", OleDbType.Char)
objParam.Value = entry
objCmd.Parameters.Add(objParam)

try
objConn.Open()
objCmd.ExecuteNonQuery
objConn.Close()
catch ex as OleDbException
throw ex
end try
End Sub


End Class
End Namespace

Any hints greatly received!

Thank you for your time

Shaun

Wow.. I don't think the problem lies within the code that you have bolded but within all the functions that return DataReader objects. You're going to have to pass them as:
return objDataReader(CommandBehavior.CloseConnection)
and then in your main code that is actually calling the function and expecting a reader in return you must do:
dim dr as SqlDataReader
dr = Class.MethodReturnsDatareader
dr.close()
Also, you may want to add Finally blocks to all those Try blocks and explicitly close the connection there. Because if any of those methods error out, the connection is still open...

Thanks Optik.

I will try what you suggest. I'm a bit confused though, as I've simply adapted examples out of my Teach Yourself ASP.Net in 21 Days Book. Would you be able to shed a little light on why I need to use objDataReader(CommandBehavior.CloseConnection)? What was it that I was doing wrong?
Many thanks
Shaun


Hi Optik

I would just like to say that this did infact solve the problem. So this issue is now resolved.

It would be good if I could just understand why!?!

Many thanks for your time

Shaun


Quoted from MSDN
"While theSqlDataReader is in use, the associatedSqlConnection is busy serving theSqlDataReader. While in this state, no other operations can be performed on theSqlConnection other than closing it. This is the case until you call theSqlDataReader.Close method. If theSqlDataReader is created withCommandBehavior set toCloseConnection, closing theSqlDataReader closes the connection automatically."


Cheers me dears!

The ConnectionString property has not been initialized

Hi all,

I have developed a web page using asp.net. When testing ( debugging ) it from the VS 2005 it works properly.

In the load of the page I created a SqlConnection and specified the ConnectionString

The problem is when calling the page from a Fox Pro 9.0 application I get this message:

The ConnectionString property has not been initialized.

It seems that when calling the page from Fox Pro the ConnectionString is written incorrectly in the load method of the page

So does anyone have any suggestion?

Regards

Could you please specify the connection string over here. Also make sure that you have used new keyword while defining the connection string

Regards,

Suhas


Hi,

There is a article onconnection string here.

The continuing adventures of a ASP newb

Hi there,

OK - So I have run into a problem. I have created a shopping cart, the cart is an object that gets created when the user logs in. That all works great. My problem is this.

I have a page for viewing the cart, what I want to do is loop through the cart and show the details for all the items. I mean I could just bind it to a datagrid view (I think) but I would like a little more control over that. The problem is if I loop through my array and say print some HTML it prints it first thing on the page :( That of course doesn't work... How can I get it to put my HTML where I want it? Like inside of a DIV tag?

Being a total newb to ASP programming I am not sure what the best approach to something like this is. But there has to be a lot of cases where a web page has some sort of object of varying length and it needs to be printed to the page in some fashion.

Can anyone point me in the right direction?

ThanksPlace an asp label with runat =server within the div tag. Then send the html output to it in the code behind:

<div>
<asp:Label runat="server" id="myLabel"></asp:Label>
</div>

Then in the code behind:
myLabel.Text = ...

F
Hi there,

OK - So I have run into a problem. I have created a shopping cart, the cart is an object that gets created when the user logs in. That all works great. My problem is this.

I have a page for viewing the cart, what I want to do is loop through the cart and show the details for all the items. I mean I could just bind it to a datagrid view (I think) but I would like a little more control over that. The problem is if I loop through my array and say print some HTML it prints it first thing on the page :( That of course doesn't work... How can I get it to put my HTML where I want it? Like inside of a DIV tag?

Being a total newb to ASP programming I am not sure what the best approach to something like this is. But there has to be a lot of cases where a web page has some sort of object of varying length and it needs to be printed to the page in some fashion.

Can anyone point me in the right direction?

Thanks
That was a very fundamental ASP.NET question. Are you sure you should be creating a shopping cart? :ehh:

Because of the nature of your question, I take it you don't have a lot of knowledge of the ASP.NET controls. First thing to remember, do not use Response.Write. That's something from the classic ASP days which you should rarely ever need to use.

Tutorial:
http://www.asp.net/Tutorials/quickstart.aspx

The Controls (buttons) Are Not Displayed In Asp.net, after i ran the asp.net pro

hi pals

i have created one new asp.net web application project (with visual basic enabled not C#).

i have used two "lables" and two "textboxes". after creating that webform. i ran that asp.net project.

but it did not show the form as what i have seen before ran.

it shows onle tow lables and it did not show the textbox controls. that too lables are shown top left cornor one by one. but i have used lables at center of the form.

i have attached two jpg files. first one is before run. second one for after run.

how to solve this problem.Can you post your code?
Run aspnet_regiis -c in the Visual Studio command prompt.
hi mendhak

how to enter visula studio command prompt. i am newbie to vb.net / asp.net
Start > Programs > Microsoft VIsual Studio > Visual Studio Tools > Visual Studio Command Prompt
hi mendhak

i tried this.

now i am seeing the error message "server application unavailable" in ie after exectuing my asp.net webapplication project.

but i am able to open iis server default pager when typing "http://localhost" in ie

how to solve that problem
Did you reset IIS after running aspnet_regiis?

Thursday, March 22, 2012

The existance of session variables

Hi,
I was wondering how long the created session variables last for?
To be more clear, when are they destroyed? Do I have to set the variables to
null in Session_End()? Is the Session_End() method invoked when the browser
is closed?
I'm just not sure how it works.
Thanks in advance,
Tim.By default session variables expire 20 minutes since last page access. (You
can set this in web.config)
Session_End() is NOT invoked when the browser is closed.
Greg
"Timothy V" <tripix@.msn.com> wrote in message
news:%23vc45NEcEHA.796@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I was wondering how long the created session variables last for?
> To be more clear, when are they destroyed? Do I have to set the variables
to
> null in Session_End()? Is the Session_End() method invoked when the
browser
> is closed?
> I'm just not sure how it works.
> Thanks in advance,
> Tim.
>
Hi just started using session variables, no expert but this is what I have s
een so far.
Session variables exist from when the web application is started until it is
ended.
It is started when the browser of the user opens the start page and ends whe
n the user no longer has any page open from the application. Session variab
les are visible to all pages of the application when invoked.
--
Paul G
Software engineer.
"Timothy V" wrote:

> Hi,
> I was wondering how long the created session variables last for?
> To be more clear, when are they destroyed? Do I have to set the variables
to
> null in Session_End()? Is the Session_End() method invoked when the browse
r
> is closed?
> I'm just not sure how it works.
> Thanks in advance,
> Tim.
>
>
If only that were true!
You need to be very careful. Say you have a session variable
session("username")="greg". If the users walks away from the machine and
comes back 20+ minutes later and causes a postback on your page a new
session will start.
When you go to access your session("username") variable that you thought was
populated you'll get an exception because it will be now equal to nothing!
This scenario has caused me many many headaches. ;(
You can/should always check your session variables for nothing before using
them. Same will Cache items, cause those can be purged at any point in time.
PS: If anybody has ever figured at a full proof way of displaying a session
expired page while using forms authentication, I would love to hear it!
Greg
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:182E0A10-B76F-4EFE-9B1F-A01ED839F4E3@.microsoft.com...
> Hi just started using session variables, no expert but this is what I have
seen so far.
> Session variables exist from when the web application is started until it
is ended.
> It is started when the browser of the user opens the start page and ends
when the user no longer has any page open from the application. Session
variables are visible to all pages of the application when invoked.
> --
> Paul G
> Software engineer.
>
> "Timothy V" wrote:
>
variables to
browser
for further reading
http://support.microsoft.com/defaul...kb;en-us;555082
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:182E0A10-B76F-4EFE-9B1F-A01ED839F4E3@.microsoft.com...
> Hi just started using session variables, no expert but this is what I have
> seen so far.
> Session variables exist from when the web application is started until it
> is ended.
> It is started when the browser of the user opens the start page and ends
> when the user no longer has any page open from the application. Session
> variables are visible to all pages of the application when invoked.
> --
> Paul G
> Software engineer.
>
> "Timothy V" wrote:
>
Sounds like a good idea to check if the session information is nothing as cu
rrently not doing that with my application so would cause problems--
Paul G
Software engineer.
"Greg Burns" wrote:

> If only that were true!
> You need to be very careful. Say you have a session variable
> session("username")="greg". If the users walks away from the machine and
> comes back 20+ minutes later and causes a postback on your page a new
> session will start.
> When you go to access your session("username") variable that you thought w
as
> populated you'll get an exception because it will be now equal to nothing!
> This scenario has caused me many many headaches. ;(
> You can/should always check your session variables for nothing before usin
g
> them. Same will Cache items, cause those can be purged at any point in tim
e.
> PS: If anybody has ever figured at a full proof way of displaying a sessio
n
> expired page while using forms authentication, I would love to hear it!
> Greg
>
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:182E0A10-B76F-4EFE-9B1F-A01ED839F4E3@.microsoft.com...
> seen so far.
> is ended.
> when the user no longer has any page open from the application. Session
> variables are visible to all pages of the application when invoked.
> variables to
> browser
>
>

The existance of session variables

Hi,
I was wondering how long the created session variables last for?

To be more clear, when are they destroyed? Do I have to set the variables to
null in Session_End()? Is the Session_End() method invoked when the browser
is closed?

I'm just not sure how it works.

Thanks in advance,

Tim.By default session variables expire 20 minutes since last page access. (You
can set this in web.config)

Session_End() is NOT invoked when the browser is closed.

Greg

"Timothy V" <tripix@.msn.com> wrote in message
news:%23vc45NEcEHA.796@.TK2MSFTNGP09.phx.gbl...
> Hi,
> I was wondering how long the created session variables last for?
> To be more clear, when are they destroyed? Do I have to set the variables
to
> null in Session_End()? Is the Session_End() method invoked when the
browser
> is closed?
> I'm just not sure how it works.
> Thanks in advance,
> Tim.
Hi just started using session variables, no expert but this is what I have seen so far.
Session variables exist from when the web application is started until it is ended.
It is started when the browser of the user opens the start page and ends when the user no longer has any page open from the application. Session variables are visible to all pages of the application when invoked.
--
Paul G
Software engineer.

"Timothy V" wrote:

> Hi,
> I was wondering how long the created session variables last for?
> To be more clear, when are they destroyed? Do I have to set the variables to
> null in Session_End()? Is the Session_End() method invoked when the browser
> is closed?
> I'm just not sure how it works.
> Thanks in advance,
> Tim.
>
If only that were true!

You need to be very careful. Say you have a session variable
session("username")="greg". If the users walks away from the machine and
comes back 20+ minutes later and causes a postback on your page a new
session will start.

When you go to access your session("username") variable that you thought was
populated you'll get an exception because it will be now equal to nothing!

This scenario has caused me many many headaches. ;(

You can/should always check your session variables for nothing before using
them. Same will Cache items, cause those can be purged at any point in time.

PS: If anybody has ever figured at a full proof way of displaying a session
expired page while using forms authentication, I would love to hear it!

Greg

"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:182E0A10-B76F-4EFE-9B1F-A01ED839F4E3@.microsoft.com...
> Hi just started using session variables, no expert but this is what I have
seen so far.
> Session variables exist from when the web application is started until it
is ended.
> It is started when the browser of the user opens the start page and ends
when the user no longer has any page open from the application. Session
variables are visible to all pages of the application when invoked.
> --
> Paul G
> Software engineer.
>
> "Timothy V" wrote:
> > Hi,
> > I was wondering how long the created session variables last for?
> > To be more clear, when are they destroyed? Do I have to set the
variables to
> > null in Session_End()? Is the Session_End() method invoked when the
browser
> > is closed?
> > I'm just not sure how it works.
> > Thanks in advance,
> > Tim.
for further reading
http://support.microsoft.com/defaul...kb;en-us;555082

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:182E0A10-B76F-4EFE-9B1F-A01ED839F4E3@.microsoft.com...
> Hi just started using session variables, no expert but this is what I have
> seen so far.
> Session variables exist from when the web application is started until it
> is ended.
> It is started when the browser of the user opens the start page and ends
> when the user no longer has any page open from the application. Session
> variables are visible to all pages of the application when invoked.
> --
> Paul G
> Software engineer.
>
> "Timothy V" wrote:
>> Hi,
>> I was wondering how long the created session variables last for?
>>
>> To be more clear, when are they destroyed? Do I have to set the variables
>> to
>> null in Session_End()? Is the Session_End() method invoked when the
>> browser
>> is closed?
>>
>> I'm just not sure how it works.
>>
>> Thanks in advance,
>>
>> Tim.
>>
>>
>

The first application gives server load error

I'm new to asp.net. Started following a book, I created a FirstApplication and when i try to run it on the browser it gives me the server parse error 'firstapplication.global file not loaded'. Error line 1.
I have not changed anything except for adding a header in the global.aspx file in between the form tags. also the application did'nt create the .vsdisco file. Heard vs2003 does'nt create one. Does it have to do anything with it. Help please!!!!!!!!!!!a header in global.aspx ?
global.aspx to my knowledge isnt used for anything other than writing
applicaiton onstart... on end... session on start and on end etc...
you just write methods for each in global file.
remove the header (cause i dont know y you are adding that header)
open the code file... gloabal.aspx.cs or vb

save the project... build it... and run it...

HTH

HD

"BSL" <anonymous@.discussions.microsoft.com> wrote in message
news:C4D05D3F-F9B6-44F2-B649-A78B81844844@.microsoft.com...
> I'm new to asp.net. Started following a book, I created a FirstApplication
and when i try to run it on the browser it gives me the server parse error
'firstapplication.global file not loaded'. Error line 1.
> I have not changed anything except for adding a header in the global.aspx
file in between the form tags. also the application did'nt create the
..vsdisco file. Heard vs2003 does'nt create one. Does it have to do anything
with it. Help please!!!!!!!!!!!

The first application gives server error

> I'm new to asp.net. Started following a book, I created a FirstApplicatio
and when i try to run it on the browser it gives me the following server parse erro

----
Could not load type FirstApplication.Globa

<%@dotnet.itags.org. Application Codebehind="Global.asax.vb" Inherits="FirstApplication.Global"%

Source File :c:\inetpub\wwwroot\FirstApplication\global.asax Line: 1

-------
> I have not changed anything except for adding a header in the webform1.asp
file in between the form tags. Am I missing anything here

Help please!!!!!!!!!!It also did not create any files in the bin directory. n
..dll and .pdb files. Wondering why?
open the global.asax.vb (right click global.asax click view code...)... save
it..

do a recompile of the app... and give it a try...

--
Regards,

HD

"BSL" <anonymous@.discussions.microsoft.com> wrote in message
news:BF9D7CFC-3259-4154-ADF5-7426E52B9F87@.microsoft.com...
> It also did not create any files in the bin directory. no
> .dll and .pdb files. Wondering why?

The fun never ends...

Hey all,
I've just installed Win2003 and having no end of trouble getting my
projects(created under win2K) to load. I'm having trouble getting my
project to load from my webserver. Whenever I load it, it makes a local
copy and I "Work offline". Not ALL my projects do this, just some. Where
do I configure that within the project so that I can work "online" from my
server? MANY thanks in advance!
wardeauxThanks anyways... as soon as I posted this message I found my answer...
figures... I'm developing this intense love-hate relationship with Win2K3...
wardeaux
"Wardeaux" <wardeaux@.bellsouth.net> wrote in message
news:OSIT9%23JLEHA.1032@.tk2msftngp13.phx.gbl...
> Hey all,
> I've just installed Win2003 and having no end of trouble getting my
> projects(created under win2K) to load. I'm having trouble getting my
> project to load from my webserver. Whenever I load it, it makes a local
> copy and I "Work offline". Not ALL my projects do this, just some. Where
> do I configure that within the project so that I can work "online" from my
> server? MANY thanks in advance!
> wardeaux

The fun never ends...

Hey all,
I've just installed Win2003 and having no end of trouble getting my
projects(created under win2K) to load. I'm having trouble getting my
project to load from my webserver. Whenever I load it, it makes a local
copy and I "Work offline". Not ALL my projects do this, just some. Where
do I configure that within the project so that I can work "online" from my
server? MANY thanks in advance!
wardeauxThanks anyways... as soon as I posted this message I found my answer...
figures... I'm developing this intense love-hate relationship with Win2K3...
wardeaux
"Wardeaux" <wardeaux@.bellsouth.net> wrote in message
news:OSIT9%23JLEHA.1032@.tk2msftngp13.phx.gbl...
> Hey all,
> I've just installed Win2003 and having no end of trouble getting my
> projects(created under win2K) to load. I'm having trouble getting my
> project to load from my webserver. Whenever I load it, it makes a local
> copy and I "Work offline". Not ALL my projects do this, just some. Where
> do I configure that within the project so that I can work "online" from my
> server? MANY thanks in advance!
> wardeaux
>

Tuesday, March 13, 2012

the http reponse to file? ASP.NET 2.0

I want to generate a pdf file of "the current page".
It is a ASP.NET aspx file created partly from GET parameters, but most often
using the ASP.NET event model (i.e. clicking buttons etc).
One of the buttons is called "Generate a pdf document of the current page"
and it clicking it should create a pdf document on the server side and
returning the pdf to the user.
To my aid I have a server side component that can convert a file or the html
content of a URL to a pdf document. So if I somehow can generate the
information of the current aspx page to file, I can convert it to pdf and
change the Response.ContentType to "application/pdf".
But the question is how to generate the file that I want to convert. If I
send the current URL to the pdf component, it will point to the page and how
it looks when no interaction has been done. What I really want is the page
after all clicks, i.e. how it looks "right now".
Any ideas? Thank you,
/FredrikThus wrote Fredrik,

> I want to generate a pdf file of "the current page".
> It is a ASP.NET aspx file created partly from GET parameters, but most
> often using the ASP.NET event model (i.e. clicking buttons etc).
> One of the buttons is called "Generate a pdf document of the current
> page" and it clicking it should create a pdf document on the server
> side and returning the pdf to the user.
> To my aid I have a server side component that can convert a file or
> the html content of a URL to a pdf document. So if I somehow can
> generate the information of the current aspx page to file, I can
> convert it to pdf and change the Response.ContentType to
> "application/pdf".
> But the question is how to generate the file that I want to convert.
> If I send the current URL to the pdf component, it will point to the
> page and how it looks when no interaction has been done. What I really
> want is the page after all clicks, i.e. how it looks "right now".
> Any ideas? Thank you,
HttpResponse allows you set another stream as a filter using HttpResponse.Fi
lter.
You could use that to write the response to a temporary file, create the
PDF, and write the PDF back to the actual response stream.
Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de
Very interesting!
It seems the file isn't created until the Response ends. This seems natural
to me when thinking about it.
But when the response has ended, I per definition have lost my chance to
alter the response (remeber, I wamt to send the pdf instead). I guess I will
have to trigger another request somehow, and in the new Response show the pd
f.
Havn't still figured out the last details yet. Thanks, anyhow, for your kind
help.
Regards
/Fredrik
"Joerg Jooss" wrote:

> Thus wrote Fredrik,
>
> HttpResponse allows you set another stream as a filter using HttpResponse.
Filter.
> You could use that to write the response to a temporary file, create the
> PDF, and write the PDF back to the actual response stream.
> Cheers,
> --
> Joerg Jooss
> news-reply@.joergjooss.de
>
>
Thus wrote Fredrik,

> Very interesting!
> It seems the file isn't created until the Response ends. This seems
> natural to me when thinking about it.
Are you sure you just don't need a Response.Flush()?
Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

the http reponse to file? ASP.NET 2.0

I want to generate a pdf file of "the current page".

It is a ASP.NET aspx file created partly from GET parameters, but most often
using the ASP.NET event model (i.e. clicking buttons etc).

One of the buttons is called "Generate a pdf document of the current page"
and it clicking it should create a pdf document on the server side and
returning the pdf to the user.

To my aid I have a server side component that can convert a file or the html
content of a URL to a pdf document. So if I somehow can generate the
information of the current aspx page to file, I can convert it to pdf and
change the Response.ContentType to "application/pdf".

But the question is how to generate the file that I want to convert. If I
send the current URL to the pdf component, it will point to the page and how
it looks when no interaction has been done. What I really want is the page
after all clicks, i.e. how it looks "right now".

Any ideas? Thank you,

--
/FredrikThus wrote Fredrik,

> I want to generate a pdf file of "the current page".
> It is a ASP.NET aspx file created partly from GET parameters, but most
> often using the ASP.NET event model (i.e. clicking buttons etc).
> One of the buttons is called "Generate a pdf document of the current
> page" and it clicking it should create a pdf document on the server
> side and returning the pdf to the user.
> To my aid I have a server side component that can convert a file or
> the html content of a URL to a pdf document. So if I somehow can
> generate the information of the current aspx page to file, I can
> convert it to pdf and change the Response.ContentType to
> "application/pdf".
> But the question is how to generate the file that I want to convert.
> If I send the current URL to the pdf component, it will point to the
> page and how it looks when no interaction has been done. What I really
> want is the page after all clicks, i.e. how it looks "right now".
> Any ideas? Thank you,

HttpResponse allows you set another stream as a filter using HttpResponse.Filter.
You could use that to write the response to a temporary file, create the
PDF, and write the PDF back to the actual response stream.

Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de
Very interesting!

It seems the file isn't created until the Response ends. This seems natural
to me when thinking about it.

But when the response has ended, I per definition have lost my chance to
alter the response (remeber, I wamt to send the pdf instead). I guess I will
have to trigger another request somehow, and in the new Response show the pdf.

Havn't still figured out the last details yet. Thanks, anyhow, for your kind
help.

Regards

--
/Fredrik

"Joerg Jooss" wrote:

> Thus wrote Fredrik,
> > I want to generate a pdf file of "the current page".
> > It is a ASP.NET aspx file created partly from GET parameters, but most
> > often using the ASP.NET event model (i.e. clicking buttons etc).
> > One of the buttons is called "Generate a pdf document of the current
> > page" and it clicking it should create a pdf document on the server
> > side and returning the pdf to the user.
> > To my aid I have a server side component that can convert a file or
> > the html content of a URL to a pdf document. So if I somehow can
> > generate the information of the current aspx page to file, I can
> > convert it to pdf and change the Response.ContentType to
> > "application/pdf".
> > But the question is how to generate the file that I want to convert.
> > If I send the current URL to the pdf component, it will point to the
> > page and how it looks when no interaction has been done. What I really
> > want is the page after all clicks, i.e. how it looks "right now".
> > Any ideas? Thank you,
> HttpResponse allows you set another stream as a filter using HttpResponse.Filter.
> You could use that to write the response to a temporary file, create the
> PDF, and write the PDF back to the actual response stream.
> Cheers,
> --
> Joerg Jooss
> news-reply@.joergjooss.de
>
Thus wrote Fredrik,

> Very interesting!
> It seems the file isn't created until the Response ends. This seems
> natural to me when thinking about it.

Are you sure you just don't need a Response.Flush()?

Cheers,
--
Joerg Jooss
news-reply@.joergjooss.de

the language shown in Chinese?

Hallo guys! Nice to join this forum!!

I have a question regarding ASP.NET web control. I created "Calendar" and I wrote simple code on it. Surprisingly after I run and display in IE, all the characters were in Chinese. I doubled check the control panel and set the regional and language to be all in English but all in vain. What should I do?

My second question is only for my own curiosity: After I did some changes to the language, I restart the PC and surprisingly the code window seemed to be zoom in a bit, it is now displayed in slightly larger fonts and a bit irritating.
Do you know how I could retrieve back the original font size in code window?

Thanks =)Internet Explorer > Tools > Options > Language button.

What language do you have there?
Hi, hehehe... I checked already, it was shown English (United Kingdom)...

But still cannot display correct English Calendar! Thanks!