Last post Jun 04, 2009 05:55 PM by wonjartran
Jun 01, 2009 09:41 PM|wonjartran|LINK
From my last post, http://forums.asp.net/t/1429219.aspx, I have learned how to transfer Textbox.Text data from one aspx to another aspx page.
Here is a new question, how can I code a hyperlink into the TextBox.Text of the first page, so that the hyperlink can be displayed in the second page?
Are there any Tollbox controls can be used to insert the Hyperlinks, then display it in the seond page? I tried Word, but the second page display the text only, no hyperlinks.
Jun 02, 2009 12:58 AM|tresto|LINK
if you capture the hyperlink address you want to use in a session variable you should be able to format it into a hyperlink wherever you want. I'm not possetive but i think it would be something like this (sorry but some of this syntax isn't exactly correct,
just trying to give you an idea)
//get session variable
string strLinkAddress = string.Empty;
strLinkAddress = Session["VarName"].ToString();
//setup the hyperlink
h = new hyperlink();
h.ID = whateverID;
h.address = "strLinkAddress";
//add hyperlink to textbox
Jun 02, 2009 02:35 AM|wonjartran|LINK
Not quite understand how to code your coding. :-) Let me try to explain my question.
1. Clicking a NewsletterSubmit link in my website will open the first aspx page where a user will type in a Title
and a Newsletter paragraph into 2 Textboxes. Inside the Newsletter Textbox, the user will height a text
string and hope to "Format" it as a hyperlink text, as we can do with HTML, ASPX, or even MS Word.
2. Then after we click the Submit button in the first aspx page, we'd like to see the second aspx page also
showing a hyperlink within the Newsletter of the TextBox. Up to now, my second page showed only
the plain text, the hyperlink was gone.
3. Are there any other Toolbox controls, other than the textbox, that I can utilize to create the hyperlink
in the first aspx paga and displaying the hyperlink in the second aspx page..
Jun 02, 2009 01:56 PM|tresto|LINK
here's a quick example i just wrote, i hope this answeres some questions for you. The session vars can be used from page to page once they are set, and you should be able to add a hyperlink to almost any similar control in the same way i added it to the
put a name for the link here:
put an address for the link here:
h.NavigateUrl = strhlAddress;
h.Font.Size = 10;
h.Text = strhlName;
Jun 02, 2009 01:58 PM|tresto|LINK
and take note: haveing text (i.e. Label1.Text = "something";) will negate the hyperlink control, so make sure it's cleared out
Jun 02, 2009 05:14 PM|wonjartran|LINK
Thank you very much. I think your code is not what I am working on.
The first aspx will be used by a web client user who will create a Word document, such as,
This is the Link
The "Link" is created with a http url address. What I am working on is, after copy and paste
this Word document into the TextBox on the first page, the http/url will be still hyperlinked to
the Link. Up to now, my textbox in the first aspx page showed only the plain tex of 'This is the link',
no http url address.
Jun 02, 2009 06:16 PM|tresto|LINK
i think i see what you're getting at, when you paste the text from the document into a textbox you want the link to remain intact instead of just copying the plain text? When you initially copy paste from a word doc, does the hyperlink show up, or is it
only after the redirect?
Jun 02, 2009 06:41 PM|wonjartran|LINK
Jun 03, 2009 01:24 PM|tresto|LINK
You're lookinh for some type of control that supports rich-text... don't think asp:textbox gives that functionality but luckily there is plenty of third party stuff. The best one i've found is the
tinyMCE FCKEditor, which has plenty of info out there to help you out (see links below). The control lets you input all sorts of information in many different ways. I don't know if there are any other controls (within .net) that you could use to accomplish
this task, but this is probably the easiest solution.
a forum for support: http://tinymce.moxiecode.com/punbb/
code examples and more info: http://codeodyssey.se/blog.aspx?id=334,
examples of other rich-text controls:
Jun 04, 2009 05:55 PM|wonjartran|LINK
Later on after talked to the manager responsible for the Newsletter, I found out what they want is a
Headline-New Newsletter.aspx page, where clicking a "More...." link will move to a specific Newsletter file.
Not a hyperlink inside a Textbox.Text.