?
Solved

.NET C# - CS page

Posted on 2008-06-11
2
Medium Priority
?
260 Views
Last Modified: 2013-12-17
I have a Web site that has this code of the CS page

 {
                string title = user.getResourceTitle(file.Substring(file.LastIndexOf("\\") + 1));
                plcLinks.Controls.Add(new LiteralControl("<h2>" + title + "</h2>"));
                i++;
                HyperLink lnk = new HyperLink();
                lnk.Text = file.Substring(file.LastIndexOf("\\") + 1);
                lnk.NavigateUrl = "../secure/Uploads/" + file.Substring(file.LastIndexOf("\\")+1);
                lnk.Visible = true;
                lnk.ID = "lnk" + i.ToString();
                plcLinks.Controls.Add(lnk);
                plcLinks.Controls.Add(new LiteralControl("<br />"));
            }

I have the <h2> tag going to my title... I want the <p> tag to go to my links... I can't figure out how to incorporate the <p> tag to my links... I did not write this code... I am a dummy beginner.

Thank you...
0
Comment
Question by:DMcGown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
NIMTUG_Simon earned 1000 total points
ID: 21764301
So what it looks like you are getting is

<h2>Some Title</h2>
<a href="someurl"/><br/>

If you are wanting

<h2>Some tiitle</h2>
<p><a href="someurl" /></p>

Then change

plcLinks.Controls.Add(lnk);
plcLinks.Controls.Add(new LiteralControl("<br />"));

to

plcLinks.Controls.Add(new LiteralControl("<p>"));
plcLinks.Controls.Add(lnk);
plcLinks.Controls.Add(new LiteralControl("</p>"));

0
 

Author Closing Comment

by:DMcGown
ID: 31466352
Perfect... That did the trick! - Thank you!
0

Featured Post

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question