Jump to content
  • Advertisement
Sign in to follow this  
sathenzar

[.net] Visual Studio 2005 seems limited

This topic is 4427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey I noticed their dataview method seems really limited. You can't make the results display an url. Example: a guestbook that displays a link of each persons name like previewMessage.aspx?guestID=1. They're all static. Is there a way around this? Without programming the whole code yourself to display the data?

Share this post


Link to post
Share on other sites
Advertisement
Which version of it are you using?


There are a few:

Express
Standard
Professional
Enterprise architect etc, but I dont bother looking at those because...price range

Share this post


Link to post
Share on other sites
It sounds like you're describing a problem with ASP not a problem with visual studio. Visual Studio is not a language, it's a tool with which you can compile/link languages like C++/VB/.NET/etc

Are you asking how to display a url with ASP?

-me

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If I understood You correctly, then this is how I do it in my datagrid:
aspx page:



' runat="server">Clicky



codebehind:

public string GetLink(object id)
{
return String.Format("mypage.aspx?id={0}", id.ToString());
}

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If I understood You correctly, then this is how I do it in my datagrid:
aspx page:

_asp:TemplateColumn_
_ItemTemplate_
_asp:HyperLink ID="link" NavigateUrl='_%# GetLink(DataBinder.Eval(Container.DataItem, "id")) %_' runat="server"_Clicky_/asp:HyperLink_
_/ItemTemplate_
_/asp:TemplateColumn_

codebehind:

public string GetLink(object id)
{
return String.Format("mypage.aspx?id={0}", id.ToString());
}

Share this post


Link to post
Share on other sites

Or...

<itemtemplate>
_ a href='mypage.aspx?id= <%# (string)Eval("id") %>'_ Clicky _/a_
</itemtemplate>

The use of Eval in stead of Databinder.Eval is recommended in .net 2.0

Edo

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
If I understood You correctly, then this is how I do it in my datagrid:
aspx page:

_asp:TemplateColumn_
_ItemTemplate_
_asp:HyperLink ID="link" NavigateUrl='_%# GetLink(DataBinder.Eval(Container.DataItem, "id")) %_' runat="server"_Clicky_/asp:HyperLink_
_/ItemTemplate_
_/asp:TemplateColumn_

codebehind:

public string GetLink(object id)
{
return String.Format("mypage.aspx?id={0}", id.ToString());
}


Are you trying to display the URL? If you are, then just set the 'Text' property of the asp:hyperlink to the same value as the 'NavigateUrl' property.

I.E.



<ItemTemplate>
<asp:HyperLink runat="server" id="linkName" NavigateUrl='<%# GetLink(DataBinder.Eval(Container.DataItem, "id")) %>' Text='<%# GetLink(DataBinder.Eval(Container.DataItem, "id")) %>'>
</ItemTemplate>



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!