F
Froefel
Hi all,
I have a curious thing that I can't figure out.
I have an aspx page with associated code-behind file; the aspx page
has the following code:
<asp:LinkButton ID="lnkShowMyProjects" runat="server" PostBackUrl="~/
SelectProject.aspx?show=<%= User.Identity.Name %>">Show only my
projects</asp:LinkButton>
When I run this project and I look at the Page Source after the page
has been rendered, the above statement was translated into:
<a id="ctl00_pageContent_lnkShowAllProjects"
href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl00$pageContent
$lnkShowAllProjects", "", false, "",
"SelectProject.aspx?show=", false, true))">Show all
projects</a>
As you can see, instead of replacing <%= User.Identity.Name %> with
the actual value of User.Identity.Name, it included the statement as a
literal string. Consequently, the Querystring doesn't look the way I
intended it.
Can anyone tell me what the reason is for this behavior? Also can you
tell me how I should fix it?
Thanks
-- Hans
I have a curious thing that I can't figure out.
I have an aspx page with associated code-behind file; the aspx page
has the following code:
<asp:LinkButton ID="lnkShowMyProjects" runat="server" PostBackUrl="~/
SelectProject.aspx?show=<%= User.Identity.Name %>">Show only my
projects</asp:LinkButton>
When I run this project and I look at the Page Source after the page
has been rendered, the above statement was translated into:
<a id="ctl00_pageContent_lnkShowAllProjects"
href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl00$pageContent
$lnkShowAllProjects", "", false, "",
"SelectProject.aspx?show=", false, true))">Show all
projects</a>
As you can see, instead of replacing <%= User.Identity.Name %> with
the actual value of User.Identity.Name, it included the statement as a
literal string. Consequently, the Querystring doesn't look the way I
intended it.
Can anyone tell me what the reason is for this behavior? Also can you
tell me how I should fix it?
Thanks
-- Hans