Last post Dec 02, 2016 07:32 PM by PatriceSc
Dec 02, 2016 05:20 PM|nav1234|LINK
I am adding PDF file , my file is saved according to path that i gave . but link is not displaying on web page from where i can open and view file
I have two pages from one page where i am adding , other page i am displaying links.
I don't know what i am missing.
Can please somebody help me
Dec 02, 2016 05:51 PM|KathyW|LINK
Your question is not clear. If a link does not display on the page, it wasn't in the page.
I cannot tell from your post what you are doing. Please post your code and explain more fully what you are trying to do and what isn't working.
Dec 02, 2016 06:36 PM|nav1234|LINK
So here is one page whee users can see policies
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionid" href="#link12">
<div id="link12" class="collapse">
<div class="accordion-inner" style="padding-left: 10px;">
<asp:Panel ID="PoliciesPanel" runat="server">
Code behind Policy Page
protected void Page_Load(object sender, EventArgs e)
FormsCodeHandler requestDirector = new FormsCodeHandler();
List<ResourceDetail> Policies = new List<ResourceDetail>();
Policies = requestDirector.FindResourcesByCategory(" Policy");
if (Policies.Count >0)
for (int i = 0; i < Policies.Count; i++)
LinkButton btn = new LinkButton();
btn.Text = Policies[i].Title;
string ID = "Policies_" + (i + 1).ToString();
btn.ID = ID;
btn.Click += Dynamic_Click;
btn.CommandName = Policies[i].Path;
btn.CommandArgument = Policies[i].ResourceID.ToString();
Literal lit = new Literal();
lit.Text = "<br />";
On the other page managment can add or edit the policies
<asp:DropDownList ID="FileCategory" runat="server" CssClass="RequiredField form-control">
<asp:ListItem Text="Select a Category" Value="0"></asp:ListItem>
asp:ListItem Text="Policies" Value="Policies"></asp:ListItem>
<asp:Label ID="Label1" runat="server" Text="Choose a PDF file: "></asp:Label><span class="requiredField"> *</span>
<asp:FileUpload ID="ResourceUpload" runat="server" />
<asp:Button ID="Submit" runat="server" Text="Upload" CssClass="btn btn-success" OnClick="Submit_Click" />
When i add new policy from resources page , it is successfully added , it saves in my folder Policies.
I can see policies header on Policies page, but the files i am adding through Resource Page can't see on Policy Page under Policy List
Hope you understand
Dec 02, 2016 07:22 PM|KathyW|LINK
Is "(Policies.Count >0)"? What have you done to debug this? What part of the code isn't working as you expect?
Dec 02, 2016 07:32 PM|PatriceSc|LINK
As reported earlier a basic step is to see which value is found in Policies.Count.
I noticed an extra blank in FindResourcesByCategory(" Policy"); - before the word policy. Could it be that because of that you don't get any policy at all ?
If needed see
https://msdn.microsoft.com/en-us/library/mt243867.aspx. A basic step is to check that the line of code that produces the result you want actually runs.