本文介绍了单击后如何获取动态创建的链接的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:-

This is my code:-

string stringChapterno = Session["chapterno"].ToString();
          string stringAppPath = HttpContext.Current.Request.ApplicationPath;
          string stringPhysicalPath = HttpContext.Current.Request.MapPath(stringAppPath);
          stringPhysicalPath = stringPhysicalPath + "\\App_Data\\" + stringChapterno;
          //List<string> dirs = GetFilesRecursive(stringPhysicalPath);

          foreach (string p in Directory.GetDirectories(stringPhysicalPath))
          {
              LinkButton blink = new LinkButton();
              string s=Path.GetFileNameWithoutExtension(p);
              blink.Text = s;
              blink.CssClass = "hyperlink";

              Panel1.Controls.Add(blink);
              Panel1.Controls.Add(new LiteralControl("<br>"));
              Panel1.Controls.Add(new LiteralControl("<br>"));
              blink.PostBackUrl="QuestionPaper.aspx";
          }



现在我想知道如何获取眨眼的路径?



Now I want toknow How can I get the path to blink?

推荐答案

Panel1.FindControl()



Page.ResolveClientUrl("~/App_Data/ " + stringChapterno + "QuestionPaper.aspx")


这篇关于单击后如何获取动态创建的链接的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 13:33