Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 29th, 2007, 03:29 PM
Registered User
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Assign label or string to external html file

Hello,

I'm trying to build a bulk emailer for a client. (no not a spammer, a newsletter!) I'd like them to only have to edit an html file for the body of the email. I figured out how to do a Response.WriteFile inside a label in the pages HTML, and that displays okay, but when I reference the .Text value for the body on my button click it is empty. I have a feeling this is a code-behind vs. middle of the html problem.

Basically I want to do something like this:

string blah = myExternalFile.html;

-or-

lblBlah.Text = myExternalFile.html;

However everything I've tried .NET has not been happy with. Any other way around including external text files into strings or labels?

 
Old May 30th, 2007, 03:00 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well exactly not sure what you want, but if you want to store the contents of an HTML file into a variable, why don't you use the StreamReader class, read the contents of the HTML file and store into the local variable!!

Regards
Mike

Don't expect too much, too soon.
 
Old May 30th, 2007, 06:39 AM
Registered User
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Mike, Works like a champ!

Blake






Similar Threads
Thread Thread Starter Forum Replies Last Post
Query string to a external javascript file anujrathi ASP.NET 1.0 and 1.1 Professional 1 November 4th, 2006 01:26 AM
Assign string to what object? tranzformerz ASP.NET 1.0 and 1.1 Basics 5 August 26th, 2005 06:06 PM
How to save string value as html file? android66 Javascript 0 September 3rd, 2004 12:00 AM
Dynamically assign external js file fs22 Javascript How-To 1 May 21st, 2004 05:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.