Building Urls!

  • Thread starter Thread starter Adam Knight
  • Start date Start date
A

Adam Knight

Hi all,

In my webforms i am building urls in the following way.

<a href="#"
onClick="OpenWindow('Document.aspx?action=edit&aid=<%=intAreaID%>&did=<%#
Container.DataItem("document_id")%><%=IIF(Request.QueryString("pid") Is
Nothing, "", "&pid=" &
Request.QueryString("pid"))%>&sid=<%=intStandardID%>&type=<%=Request.QueryString("type")%>','550','300','no','no');
return false;" target="_blank">Edit</a>

Can anyone make any suggestions of a better way!!!!

Cheers,
Adam
 
I'd do this in the codebehind...

<a runat="server" id="mystuff"></a>

In the c#...

mystuff.Attributes.Add("onClick", ..............);

Much cleaner...
 
Or use HyperLinkColumn like so
<asp:HyperLinkColumn Text="View Details"
DataNavigateUrlField="ID"
DataNavigateUrlFormatString="ds.aspx?ID={0}"
Hope that helps
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top