ASP.NET C#:如何调用web.config中的App#u代码函数
这是我在web.config中使用的代码:ASP.NET C#:如何调用web.config中的App#u代码函数,c#,asp.net,web-config,global,app-code,C#,Asp.net,Web Config,Global,App Code,这是我在web.config中使用的代码: <add name="MainRule" virtualUrl="^~/Pages/([\w-_]+).html" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/page.aspx?pid=${PageTitleToId.ConvertPageTitleToPageId($1)}" ignoreCase="true" /> 在App
<add name="MainRule" virtualUrl="^~/Pages/([\w-_]+).html"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/page.aspx?pid=${PageTitleToId.ConvertPageTitleToPageId($1)}"
ignoreCase="true" />
在App_Code文件夹中,我有一个“PageTitleToId.cs”类,其中包含ConvertPageTitleToPageId函数,该函数采用字符串参数
运行页面时未调用ConvertPageTitleToPageId函数,我是否遗漏了什么
感谢您的帮助
Simplecode您不能在web.config中执行代码。我会更新
page.aspx
来处理title
查询字符串参数,它会调用ConvertPageTitleToPageId()
来获取您的pid您不能在web.config中执行代码。我会更新page.aspx
来处理title
查询字符串参数,它会调用ConvertPageTitleToPageId()
来获取您的pid