Sorry for the confusion. I may have used the wrong verbiage to describe
what I am doing, so my apology. Like I said, I’m fairly new to .Net.
Your response is close to what I attempting to accomplish, but I do not
want to dynamically create my hyperlink on an ASP page, but rather a
behind the scenes link that a user can paste into a Word document or
Email as an embedded link that points to a particular file. For
example, the link might be something like:
http://www.testweb.com/DocumentView.aspx?x=2
where x=2 (DocTest.doc) is the reference to the document ID on my
database table and the embedded link name is called Document Test with
the above URL as the linked.
I want my function to capture the document ID and create this link
dynamically when the selects the document they want to embed. This
user then can paste this into a Word document or email seeing only the
*Document Name*. Whoever clicks that Document Name will be directed to
that page, which verifies the document id, and open that document up
with the correct program the document is formated in (i.e. Word, Adobe,
Excel, etc.).
DKode Wrote:
ok,
your description is a little fuzzy there, but if i read it correctly,
you want to dynamically generate a HyperLink control on an asp.net
page.
For this, from your code behind, simply create the new control:
Dim myLink as New System.Web.UI.WebControls.HyperLink;
then set the Navigation URL to whatever address you want to navigate
them to, this could be another page within your app, with a
querystring
that does something specific:
myLink.NavigateURL = "somepage.aspx?id=" & someClass.Property;
then you need to add the control to a placeholder or some other form
of
container control to be placed on the page:
myPlaceHolder.Controls.Add(myLink);
Here is a link on the MSDN to the HyperLink control:
http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx
Note: I code in CSharp so I have not tested tha above code, but you
get
the idea.
--
sloesch
------------------------------------------------------------------------
sloesch's Profile:
http://www.hightechtalks.com/m905
View this thread:
http://www.hightechtalks.com/t2353539