M
mesut
Hi there,
how are you colleagues? I try to set a linkaddress in code behind for
a <asp:hyperlink> server control. but I think I have some syntax
problem. I don't know how to fix it.
What's wrong with the code below? I have put a hyperlink on the aspx
page. And I add the attributes of the hyperlink in my code-behind. I
set the attributes in code behind because I need the AddressGuid ID
value. I concattenate the value and make an URL variable. Then I add
the "onclick" event with Value "URL" in the hyperlink attribute. When
I run this code I get Systax error.
I assume it's the "less than" sign. Can someone advice what's wrong
with my code below?
The code Compiles well w/o any problem.
thanks
mesut
ASPX page code looks like:
--------------------------------------
<asp:HyperLink ID="lnkCreditLimit"
runat="server">Credit Limit</asp:HyperLink>
C# Code behind looks like:
--------------------------------------
string URL = "<script language=\'javascript\' type=\"text/javascript
\"> window.open('" + ResolveUrl
("~/Financial/CreditLimit.aspx?AddressGuid=" +
Request.QueryString["AddressGuid"].ToString())
+
"','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,
resizable=no ,modal=yes');</script>";
lnkCreditLimit.Attributes.Add("onclick",URL);
Rendering looks like:
------------------------------
<a id="ctl00_ContentPlaceHolder1_lnkCreditLimit" onclick="<script
language='javascript' type="text/javascript"> window.open('/
Art/Financial/CreditLimit.aspx?
AddressGuid=f0e10cca-9116-4b21-81cc-974c930276a4','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');</
script>">Credit Limit</a>
how are you colleagues? I try to set a linkaddress in code behind for
a <asp:hyperlink> server control. but I think I have some syntax
problem. I don't know how to fix it.
What's wrong with the code below? I have put a hyperlink on the aspx
page. And I add the attributes of the hyperlink in my code-behind. I
set the attributes in code behind because I need the AddressGuid ID
value. I concattenate the value and make an URL variable. Then I add
the "onclick" event with Value "URL" in the hyperlink attribute. When
I run this code I get Systax error.
I assume it's the "less than" sign. Can someone advice what's wrong
with my code below?
The code Compiles well w/o any problem.
thanks
mesut
ASPX page code looks like:
--------------------------------------
<asp:HyperLink ID="lnkCreditLimit"
runat="server">Credit Limit</asp:HyperLink>
C# Code behind looks like:
--------------------------------------
string URL = "<script language=\'javascript\' type=\"text/javascript
\"> window.open('" + ResolveUrl
("~/Financial/CreditLimit.aspx?AddressGuid=" +
Request.QueryString["AddressGuid"].ToString())
+
"','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,
resizable=no ,modal=yes');</script>";
lnkCreditLimit.Attributes.Add("onclick",URL);
Rendering looks like:
------------------------------
<a id="ctl00_ContentPlaceHolder1_lnkCreditLimit" onclick="<script
language='javascript' type="text/javascript"> window.open('/
Art/Financial/CreditLimit.aspx?
AddressGuid=f0e10cca-9116-4b21-81cc-974c930276a4','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');</
script>">Credit Limit</a>