Groups | Blog | Home
all groups > dotnet sdk > may 2006 >

dotnet sdk : link to dynamically built page


David Thielen
5/5/2006 6:31:01 PM
Hi;

I need to have a url that when the user goes to it, it builds the page
programatically. In one case the file is a blob in the database so I need to
read and return it. In the other case I create the document (a report) when
it is requested.

How can I do this? (I had this all working - and then deleted the code -
aaargh!)

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
David Thielen
5/7/2006 9:59:01 PM
Hello;

I think you misunderstood my question. Lets say I have a url
http://www.windward.net/site/page.aspx - I don't have a page.aspx file - I
have a pdf file as a blob in a sql database. I need to return that file as
the page when the user requests page.aspx.

How do I do this?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com



[quoted text, click to view]
stcheng NO[at]SPAM online.microsoft.com
5/8/2006 4:03:41 AM
Hi Dave,

Thank you for posting.

As for the clicking on a hyperlink on the web page, it is a pure
client-side operation, and the redirecting request to the server is also
sent by the client-browser, so it is hard to intercept such click and
redirecting at server-side code. IMO, you can consider use a Linkbutton
instead of hyperlink. Thus, we can put the dynamic page's creation code in
the LinkButton's postback event(server-side), and do the redirection after
the dynamic page been created.. How do you think of this?

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
David Thielen
5/8/2006 9:00:03 AM
bingo - thanks

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com



[quoted text, click to view]
stcheng NO[at]SPAM online.microsoft.com
5/8/2006 10:15:20 AM
Thanks for your quick response Dave,

Well, I understand what you're doing is actually somewhat like url resource
redirecting, redirect one kind of url to another kind of resource, correct?

I assumed that you've correctly configured the IIS server so that the url
to a non-existing document will also be forward to aspnet engine. Then, in
ASP.NET side, you can consider use httpmodule to do the redirecting work.
You can check the original url of the request and determine what to do
next, you can:

1. You can call method to creating temp file and use Rewrite API to
redirect the request context to the new created file.

or

2. you can even directly write our binary stream into the response stream
an close the response.

Here are some articles on ASP.NET url rewriting and httpmodule:


#URL Rewriting in ASP.NET
http://msdn.microsoft.com/library/en-us/dnaspp/html/urlrewriting.asp?frame=t
rue

#How to: Create and Configure an HTTP Module
http://msdn2.microsoft.com/en-us/library/tfd6k449.aspx

Also, the below article is a good one for getting the underlying
architecture of the ASP.NET (from IIS to ASP.NET pipeline):

#A low-level Look at the ASP.NET Architecture
http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



stcheng NO[at]SPAM online.microsoft.com
5/9/2006 4:45:29 AM
You're welcome Dave.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
AddThis Social Bookmark Button