freelanceprogrammers.org Forum Index » ASP
HyperLinkField not rendering URL with JS
Joined: 06 Dec 2005
Posts: 6
HyperLinkField not rendering URL with JS
In the DataGrid, I was able to do the following, and it rendered a HyperLink
correctly:
<asp:HyperLinkColumn DataTextField="SomeField"
DataNavigateUrlField="SomeField"
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
}`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
However, the GridView version doesn`t render the href part of the link in
the GridView.
<asp:HyperLinkField DataTextField="SomeField"
DataNavigateUrlFields="SomeField"
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
}`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
If I change it to the below, then it will render the href part of the link:
<asp:HyperLinkField DataTextField="SomeField"
DataNavigateUrlFields="SomeField"
DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
Any ideas? Thanks.
Thank you,
Ryan Olshan
Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
Group - http://groups.yahoo.com/group/StrongTypes
Blog - http://blogs.dirteam.com/blogs/ryan/
[Non-text portions of this message have been removed]
Joined: 11 Jan 2006
Posts: 46
HyperLinkField not rendering URL with JS
Ryan,
It seems to be the colon (:) causing the problem. Anytime I enter it
in the format string the href returns nothing.
Meanwhile, I can create a hyperlink contatining a colon using
String.Format without issue.
Sounds like a bug. Might need to do it yourself in the RowDataBound event.
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> In the DataGrid, I was able to do the following, and it rendered a HyperLink
> correctly:
>
> <asp:HyperLinkColumn DataTextField="SomeField"
> DataNavigateUrlField="SomeField"
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
>
> However, the GridView version doesn`t render the href part of the link in
> the GridView.
>
> <asp:HyperLinkField DataTextField="SomeField"
> DataNavigateUrlFields="SomeField"
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
>
> If I change it to the below, then it will render the href part of the link:
>
> <asp:HyperLinkField DataTextField="SomeField"
> DataNavigateUrlFields="SomeField"
> DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
>
> Any ideas? Thanks.
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Joined: 06 Dec 2005
Posts: 6
HyperLinkField not rendering URL with JS
Thanks Dean. I was trying to avoid doing it in code-behind as that defeats
one of the purposes of .NET 2.0 which is to reduce the amount of code you
have to write, but if it is a bug then I`ll work around that. I also posted
on the ASP.NET forums hoping for it to catch the eye of a member of the
ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
report it as a bug on the MSDN site.
Thank you,
Ryan Olshan
Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
Group - http://groups.yahoo.com/group/StrongTypes
Blog - http://blogs.dirteam.com/blogs/ryan/
_____
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
Sent: Monday, January 23, 2006 9:14 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
JS
Ryan,
It seems to be the colon (:) causing the problem. Anytime I enter it
in the format string the href returns nothing.
Meanwhile, I can create a hyperlink contatining a colon using
String.Format without issue.
Sounds like a bug. Might need to do it yourself in the RowDataBound event.
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> In the DataGrid, I was able to do the following, and it rendered a
HyperLink
> correctly:
>
> <asp:HyperLinkColumn DataTextField="SomeField"
> DataNavigateUrlField="SomeField"
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
>
> However, the GridView version doesn`t render the href part of the link in
> the GridView.
>
> <asp:HyperLinkField DataTextField="SomeField"
> DataNavigateUrlFields="SomeField"
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
>
> If I change it to the below, then it will render the href part of the
link:
>
> <asp:HyperLinkField DataTextField="SomeField"
> DataNavigateUrlFields="SomeField"
> DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
>
> Any ideas? Thanks.
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
_____
YAHOO! GROUPS LINKS
* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]
Joined: 06 Dec 2005
Posts: 6
HyperLinkField not rendering URL with JS
It appears that this may be a security thing, in which case there should be
an option to allow it.
So, I`ve switched to an ItemTemplate. It`s a bit messy compared to the
HyperLinkField, but it does the job.
<asp:TemplateField SortExpression="AnimalID">
<ItemTemplate>
<asp:HyperLink Text=`<%#
((System.Data.DataRowView)Container.DataItem)["AnimalID"] %>`
NavigateUrl=`<%# FormatViewUrl(Resources.Resource.ViewAnimalUrl,
((System.Data.DataRowView)Container.DataItem)["AnimalID"] as string) %>`
runat="server" />
</ItemTemplate>
</asp:TemplateField>
public string FormatViewUrl(string url, string replacementString)
{
return (replacementString != null ? String.Format(url,
replacementString) : String.Empty);
}
Thank you,
Ryan Olshan
Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
Group - http://groups.yahoo.com/group/StrongTypes
Blog - http://blogs.dirteam.com/blogs/ryan/
_____
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Ryan Olshan
Sent: Monday, January 23, 2006 11:17 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: RE: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
JS
Thanks Dean. I was trying to avoid doing it in code-behind as that defeats
one of the purposes of .NET 2.0 which is to reduce the amount of code you
have to write, but if it is a bug then I`ll work around that. I also posted
on the ASP.NET forums hoping for it to catch the eye of a member of the
ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
report it as a bug on the MSDN site.
Thank you,
Ryan Olshan
Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
Group - http://groups.yahoo.com/group/StrongTypes
Blog - http://blogs.dirteam.com/blogs/ryan/
_____
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
Sent: Monday, January 23, 2006 9:14 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
JS
Ryan,
It seems to be the colon (:) causing the problem. Anytime I enter it
in the format string the href returns nothing.
Meanwhile, I can create a hyperlink contatining a colon using
String.Format without issue.
Sounds like a bug. Might need to do it yourself in the RowDataBound event.
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> In the DataGrid, I was able to do the following, and it rendered a
HyperLink
> correctly:
>
> <asp:HyperLinkColumn DataTextField="SomeField"
> DataNavigateUrlField="SomeField"
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
>
> However, the GridView version doesn`t render the href part of the link in
> the GridView.
>
> <asp:HyperLinkField DataTextField="SomeField"
> DataNavigateUrlFields="SomeField"
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
>
> If I change it to the below, then it will render the href part of the
link:
>
> <asp:HyperLinkField DataTextField="SomeField"
> DataNavigateUrlFields="SomeField"
> DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
>
> Any ideas? Thanks.
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
_____
YAHOO! GROUPS LINKS
* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]
_____
YAHOO! GROUPS LINKS
* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]
Joined: 11 Jan 2006
Posts: 46
HyperLinkField not rendering URL with JS
Ryan,
Understand completely. If it is a bug post back here so we all know it.
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> Thanks Dean. I was trying to avoid doing it in code-behind as that defeats
> one of the purposes of .NET 2.0 which is to reduce the amount of code you
> have to write, but if it is a bug then I`ll work around that. I also posted
> on the ASP.NET forums hoping for it to catch the eye of a member of the
> ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
> report it as a bug on the MSDN site.
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> Sent: Monday, January 23, 2006 9:14 AM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> Ryan,
> It seems to be the colon (:) causing the problem. Anytime I enter it
> in the format string the href returns nothing.
>
> Meanwhile, I can create a hyperlink contatining a colon using
> String.Format without issue.
>
> Sounds like a bug. Might need to do it yourself in the RowDataBound event.
>
>
>
> On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > In the DataGrid, I was able to do the following, and it rendered a
> HyperLink
> > correctly:
> >
> > <asp:HyperLinkColumn DataTextField="SomeField"
> > DataNavigateUrlField="SomeField"
> >
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> >
> > However, the GridView version doesn`t render the href part of the link in
> > the GridView.
> >
> > <asp:HyperLinkField DataTextField="SomeField"
> > DataNavigateUrlFields="SomeField"
> >
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> >
> > If I change it to the below, then it will render the href part of the
> link:
> >
> > <asp:HyperLinkField DataTextField="SomeField"
> > DataNavigateUrlFields="SomeField"
> > DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
> >
> > Any ideas? Thanks.
> >
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Joined: 11 Jan 2006
Posts: 46
HyperLinkField not rendering URL with JS
That was my first take too, but I was able to render a hyperlink with
javascript on the same page using String.Format to produce a working
href. Can`t imagine the gridview would have a separate security
mechanism, but then again I can`t believe that they didn`t just use
the String.Format code for the DataNavigateUrlFormatString processing.
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> It appears that this may be a security thing, in which case there should be
> an option to allow it.
>
> So, I`ve switched to an ItemTemplate. It`s a bit messy compared to the
> HyperLinkField, but it does the job.
>
> <asp:TemplateField SortExpression="AnimalID">
> <ItemTemplate>
> <asp:HyperLink Text=`<%#
> ((System.Data.DataRowView)Container.DataItem)["AnimalID"] %>`
> NavigateUrl=`<%# FormatViewUrl(Resources.Resource.ViewAnimalUrl,
> ((System.Data.DataRowView)Container.DataItem)["AnimalID"] as string) %>`
> runat="server" />
> </ItemTemplate>
> </asp:TemplateField>
>
> public string FormatViewUrl(string url, string replacementString)
> {
> return (replacementString != null ? String.Format(url,
> replacementString) : String.Empty);
> }
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Ryan Olshan
> Sent: Monday, January 23, 2006 11:17 AM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: RE: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> Thanks Dean. I was trying to avoid doing it in code-behind as that defeats
> one of the purposes of .NET 2.0 which is to reduce the amount of code you
> have to write, but if it is a bug then I`ll work around that. I also posted
> on the ASP.NET forums hoping for it to catch the eye of a member of the
> ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
> report it as a bug on the MSDN site.
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> Sent: Monday, January 23, 2006 9:14 AM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> Ryan,
> It seems to be the colon (:) causing the problem. Anytime I enter it
> in the format string the href returns nothing.
>
> Meanwhile, I can create a hyperlink contatining a colon using
> String.Format without issue.
>
> Sounds like a bug. Might need to do it yourself in the RowDataBound event.
>
>
>
> On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > In the DataGrid, I was able to do the following, and it rendered a
> HyperLink
> > correctly:
> >
> > <asp:HyperLinkColumn DataTextField="SomeField"
> > DataNavigateUrlField="SomeField"
> >
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> >
> > However, the GridView version doesn`t render the href part of the link in
> > the GridView.
> >
> > <asp:HyperLinkField DataTextField="SomeField"
> > DataNavigateUrlFields="SomeField"
> >
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> >
> > If I change it to the below, then it will render the href part of the
> link:
> >
> > <asp:HyperLinkField DataTextField="SomeField"
> > DataNavigateUrlFields="SomeField"
> > DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
> >
> > Any ideas? Thanks.
> >
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Joined: 06 Dec 2005
Posts: 6
HyperLinkField not rendering URL with JS
I just got a little creative and changed the code FormatViewUrl function to
the following to enforce some type safety. Since I need to do this on a
couple of pages in the same format, I figured a function would be best.
public string FormatViewUrl<T>(string url, T replacement)
{
return (default(T) != null ? String.Format(url, replacement) :
String.Empty);
}
Thank you,
Ryan Olshan
Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
Group - http://groups.yahoo.com/group/StrongTypes
Blog - http://blogs.dirteam.com/blogs/ryan/
_____
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
Sent: Monday, January 23, 2006 12:16 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
JS
That was my first take too, but I was able to render a hyperlink with
javascript on the same page using String.Format to produce a working
href. Can`t imagine the gridview would have a separate security
mechanism, but then again I can`t believe that they didn`t just use
the String.Format code for the DataNavigateUrlFormatString processing.
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> It appears that this may be a security thing, in which case there should
be
> an option to allow it.
>
> So, I`ve switched to an ItemTemplate. It`s a bit messy compared to the
> HyperLinkField, but it does the job.
>
> <asp:TemplateField SortExpression="AnimalID">
> <ItemTemplate>
> <asp:HyperLink Text=`<%#
> ((System.Data.DataRowView)Container.DataItem)["AnimalID"] %>`
> NavigateUrl=`<%# FormatViewUrl(Resources.Resource.ViewAnimalUrl,
> ((System.Data.DataRowView)Container.DataItem)["AnimalID"] as string) %>`
> runat="server" />
> </ItemTemplate>
> </asp:TemplateField>
>
> public string FormatViewUrl(string url, string replacementString)
> {
> return (replacementString != null ? String.Format(url,
> replacementString) : String.Empty);
> }
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Ryan Olshan
> Sent: Monday, January 23, 2006 11:17 AM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: RE: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> Thanks Dean. I was trying to avoid doing it in code-behind as that defeats
> one of the purposes of .NET 2.0 which is to reduce the amount of code you
> have to write, but if it is a bug then I`ll work around that. I also
posted
> on the ASP.NET forums hoping for it to catch the eye of a member of the
> ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
> report it as a bug on the MSDN site.
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> Sent: Monday, January 23, 2006 9:14 AM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> Ryan,
> It seems to be the colon (:) causing the problem. Anytime I enter it
> in the format string the href returns nothing.
>
> Meanwhile, I can create a hyperlink contatining a colon using
> String.Format without issue.
>
> Sounds like a bug. Might need to do it yourself in the RowDataBound
event.
>
>
>
> On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > In the DataGrid, I was able to do the following, and it rendered a
> HyperLink
> > correctly:
> >
> > <asp:HyperLinkColumn DataTextField="SomeField"
> > DataNavigateUrlField="SomeField"
> >
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> >
> > However, the GridView version doesn`t render the href part of the link
in
> > the GridView.
> >
> > <asp:HyperLinkField DataTextField="SomeField"
> > DataNavigateUrlFields="SomeField"
> >
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> >
> > If I change it to the below, then it will render the href part of the
> link:
> >
> > <asp:HyperLinkField DataTextField="SomeField"
> > DataNavigateUrlFields="SomeField"
> > DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
> >
> > Any ideas? Thanks.
> >
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
_____
YAHOO! GROUPS LINKS
* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]
Joined: 11 Jan 2006
Posts: 46
HyperLinkField not rendering URL with JS
Nice use of generics. ;)
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> I just got a little creative and changed the code FormatViewUrl function to
> the following to enforce some type safety. Since I need to do this on a
> couple of pages in the same format, I figured a function would be best.
> public string FormatViewUrl<T>(string url, T replacement)
> {
> return (default(T) != null ? String.Format(url, replacement) :
> String.Empty);
> }
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> Sent: Monday, January 23, 2006 12:16 PM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> That was my first take too, but I was able to render a hyperlink with
> javascript on the same page using String.Format to produce a working
> href. Can`t imagine the gridview would have a separate security
> mechanism, but then again I can`t believe that they didn`t just use
> the String.Format code for the DataNavigateUrlFormatString processing.
>
> On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > It appears that this may be a security thing, in which case there should
> be
> > an option to allow it.
> >
> > So, I`ve switched to an ItemTemplate. It`s a bit messy compared to the
> > HyperLinkField, but it does the job.
> >
> > <asp:TemplateField SortExpression="AnimalID">
> > <ItemTemplate>
> > <asp:HyperLink Text=`<%#
> > ((System.Data.DataRowView)Container.DataItem)["AnimalID"] %>`
> > NavigateUrl=`<%# FormatViewUrl(Resources.Resource.ViewAnimalUrl,
> > ((System.Data.DataRowView)Container.DataItem)["AnimalID"] as string) %>`
> > runat="server" />
> > </ItemTemplate>
> > </asp:TemplateField>
> >
> > public string FormatViewUrl(string url, string replacementString)
> > {
> > return (replacementString != null ? String.Format(url,
> > replacementString) : String.Empty);
> > }
> >
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Ryan Olshan
> > Sent: Monday, January 23, 2006 11:17 AM
> > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > Subject: RE: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> > JS
> >
> >
> > Thanks Dean. I was trying to avoid doing it in code-behind as that defeats
> > one of the purposes of .NET 2.0 which is to reduce the amount of code you
> > have to write, but if it is a bug then I`ll work around that. I also
> posted
> > on the ASP.NET forums hoping for it to catch the eye of a member of the
> > ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
> > report it as a bug on the MSDN site.
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> > Sent: Monday, January 23, 2006 9:14 AM
> > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> > JS
> >
> >
> > Ryan,
> > It seems to be the colon (:) causing the problem. Anytime I enter it
> > in the format string the href returns nothing.
> >
> > Meanwhile, I can create a hyperlink contatining a colon using
> > String.Format without issue.
> >
> > Sounds like a bug. Might need to do it yourself in the RowDataBound
> event.
> >
> >
> >
> > On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > > In the DataGrid, I was able to do the following, and it rendered a
> > HyperLink
> > > correctly:
> > >
> > > <asp:HyperLinkColumn DataTextField="SomeField"
> > > DataNavigateUrlField="SomeField"
> > >
> >
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> > >
> > > However, the GridView version doesn`t render the href part of the link
> in
> > > the GridView.
> > >
> > > <asp:HyperLinkField DataTextField="SomeField"
> > > DataNavigateUrlFields="SomeField"
> > >
> >
> DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> > >
> > > If I change it to the below, then it will render the href part of the
> > link:
> > >
> > > <asp:HyperLinkField DataTextField="SomeField"
> > > DataNavigateUrlFields="SomeField"
> > > DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
> > >
> > > Any ideas? Thanks.
> > >
> > >
> > > Thank you,
> > > Ryan Olshan
> > > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > > Group - http://groups.yahoo.com/group/StrongTypes
> > > Blog - http://blogs.dirteam.com/blogs/ryan/
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Dean Fiala
> > Very Practical Software, Inc
> > http://www.vpsw.com
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AspNetAnyQuestionIsOk
> > <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
> >
> >
> > * To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> > e>
> >
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> > <http://docs.yahoo.com/info/terms/> .
> >
> >
> > _____
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AspNetAnyQuestionIsOk
> > <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
> >
> >
> > * To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> > e>
> >
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> > <http://docs.yahoo.com/info/terms/> .
> >
> >
> > _____
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Joined: 10 Jan 2006
Posts: 3
HyperLinkField not rendering URL with JS
I can`t figure out why this DropDownList isn`t being populated. I can
execute the stored proc and Name, ID, and Abbriv are returned. When I put a
break point in it says that is is not reachable. GetStates returns a
datatable.
codebehind:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using com.HelpfulBureaucrats.SQL;
namespace com.HelpfulBureaucrats.Pages
{
public partial class _InputContacts : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e){
if (Page.IsPostBack) {
}
else {
States.DataSource = SQLDataAccessLayer.GetStates();
States.DataTextField = "Name";
States.DataValueField = "ID";
States.DataBind();
}
}
}
}
This is the aspx page
<%@ Page MasterPageFile="~/MasterPage.master" Language="C#"
AutoEventWireup="true" CodeFile="InputContacts.aspx.cs"
Inherits="com.HelpfulBureaucrats.Pages._InputContacts" %>
<asp:content id="InputContacts" contentplaceholderid="Center"
runat="server">
First Name: <asp:TextBox ID="FirstName" runat="server"></asp:TextBox>
<br />
First Name: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br
/>
State:<asp:DropDownList ID="States" runat="server"> </asp:DropDownList>
</asp:content>
SQLDataAccessLayer:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace com.HelpfulBureaucrats.SQL{
public class SQLDataAccessLayer:IDataAccessLayer{
public SQLDataAccessLayer(){
}
public static DataTable GetStates() {
IDataHelper MyDataHelper = new SQLDataHelper();
String StoredProc =
ConfigurationManager.AppSettings["GetStates_SP"];
SP_Parameters MyParams = new SP_Parameters();
DataTable States = MyDataHelper.getDataTable(ref StoredProc, ref
MyParams);
return States;
}
public override string ToString()
{
return "SQLDataAccessLayer";
}
}
}
[Non-text portions of this message have been removed]
Joined: 06 Dec 2005
Posts: 6
HyperLinkField not rendering URL with JS
Woops... made an error. And I`ve renamed some stuff it so I can use it
generally throughout my app.
Should be:
public static string FormatString<T>(string originalString, T replacement)
{
return (!replacement.Equals(default(T)) ? String.Format(originalString,
replacement) : String.Empty);
}
Thank you,
Ryan Olshan
Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
Group - http://groups.yahoo.com/group/StrongTypes
Blog - http://blogs.dirteam.com/blogs/ryan/
_____
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
Sent: Monday, January 23, 2006 12:39 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
JS
Nice use of generics. ;)
On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> I just got a little creative and changed the code FormatViewUrl function
to
> the following to enforce some type safety. Since I need to do this on a
> couple of pages in the same format, I figured a function would be best.
> public string FormatViewUrl<T>(string url, T replacement)
> {
> return (default(T) != null ? String.Format(url, replacement) :
> String.Empty);
> }
>
>
> Thank you,
> Ryan Olshan
> Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> Group - http://groups.yahoo.com/group/StrongTypes
> Blog - http://blogs.dirteam.com/blogs/ryan/
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> Sent: Monday, January 23, 2006 12:16 PM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL with
> JS
>
>
> That was my first take too, but I was able to render a hyperlink with
> javascript on the same page using String.Format to produce a working
> href. Can`t imagine the gridview would have a separate security
> mechanism, but then again I can`t believe that they didn`t just use
> the String.Format code for the DataNavigateUrlFormatString processing.
>
> On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > It appears that this may be a security thing, in which case there should
> be
> > an option to allow it.
> >
> > So, I`ve switched to an ItemTemplate. It`s a bit messy compared to the
> > HyperLinkField, but it does the job.
> >
> > <asp:TemplateField SortExpression="AnimalID">
> > <ItemTemplate>
> > <asp:HyperLink Text=`<%#
> > ((System.Data.DataRowView)Container.DataItem)["AnimalID"] %>`
> > NavigateUrl=`<%# FormatViewUrl(Resources.Resource.ViewAnimalUrl,
> > ((System.Data.DataRowView)Container.DataItem)["AnimalID"] as string) %>`
> > runat="server" />
> > </ItemTemplate>
> > </asp:TemplateField>
> >
> > public string FormatViewUrl(string url, string replacementString)
> > {
> > return (replacementString != null ? String.Format(url,
> > replacementString) : String.Empty);
> > }
> >
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Ryan Olshan
> > Sent: Monday, January 23, 2006 11:17 AM
> > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > Subject: RE: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL
with
> > JS
> >
> >
> > Thanks Dean. I was trying to avoid doing it in code-behind as that
defeats
> > one of the purposes of .NET 2.0 which is to reduce the amount of code
you
> > have to write, but if it is a bug then I`ll work around that. I also
> posted
> > on the ASP.NET forums hoping for it to catch the eye of a member of the
> > ASP.NET team, but no luck so far. If I don`t get a response soon, I`ll
> > report it as a bug on the MSDN site.
> >
> > Thank you,
> > Ryan Olshan
> > Website - http://www.StrongTypes.com <http://www.strongtypes.com/>
> > Group - http://groups.yahoo.com/group/StrongTypes
> > Blog - http://blogs.dirteam.com/blogs/ryan/
> >
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Dean Fiala
> > Sent: Monday, January 23, 2006 9:14 AM
> > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > Subject: Re: [AspNetAnyQuestionIsOk] HyperLinkField not rendering URL
with
> > JS
> >
> >
> > Ryan,
> > It seems to be the colon (:) causing the problem. Anytime I enter it
> > in the format string the href returns nothing.
> >
> > Meanwhile, I can create a hyperlink contatining a colon using
> > String.Format without issue.
> >
> > Sounds like a bug. Might need to do it yourself in the RowDataBound
> event.
> >
> >
> >
> > On 1/23/06, Ryan Olshan <teranetlists@...> wrote:
> > > In the DataGrid, I was able to do the following, and it rendered a
> > HyperLink
> > > correctly:
> > >
> > > <asp:HyperLinkColumn DataTextField="SomeField"
> > > DataNavigateUrlField="SomeField"
> > >
> >
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> > >
> > > However, the GridView version doesn`t render the href part of the link
> in
> > > the GridView.
> > >
> > > <asp:HyperLinkField DataTextField="SomeField"
> > > DataNavigateUrlFields="SomeField"
> > >
> >
>
DataNavigateUrlFormatString="javascript:openWindow(`/SomePage.aspx?SomeID={0
> > > }`,`SomeDescription`,`scrollbars=yes,width=442,height=500`);" />
> > >
> > > If I change it to the below, then it will render the href part of the
> > link:
> > >
> > > <asp:HyperLinkField DataTextField="SomeField"
> > > DataNavigateUrlFields="SomeField"
> > > DataNavigateUrlFormatString="/SomePage.aspx?SomeID={0}" />
> > >
> > > Any ideas? Thanks.
> > >
> > >
> > > Thank you,
> > > Ryan Olshan
> > > Website - http://www.StrongTypes.com
<http://www.strongtypes.com/>
> > > Group - http://groups.yahoo.com/group/StrongTypes
> > > Blog - http://blogs.dirteam.com/blogs/ryan/
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Dean Fiala
> > Very Practical Software, Inc
> > http://www.vpsw.com
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AspNetAnyQuestionIsOk
> > <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
> >
> >
> > * To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
>
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> > e>
> >
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> > <http://docs.yahoo.com/info/terms/> .
> >
> >
> > _____
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AspNetAnyQuestionIsOk
> > <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
> >
> >
> > * To unsubscribe from this group, send an email to:
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
>
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> > e>
> >
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> > <http://docs.yahoo.com/info/terms/> .
> >
> >
> > _____
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
_____
YAHOO! GROUPS LINKS
* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .
_____
[Non-text portions of this message have been removed]
Joined: 11 Jan 2006
Posts: 46
HyperLinkField not rendering URL with JS
Travis, where is the unreachable breakpoint? in the data access class
or the page?
On 1/23/06, Travis D. Falls <travis_falls2@...> wrote:
> I can`t figure out why this DropDownList isn`t being populated. I can
> execute the stored proc and Name, ID, and Abbriv are returned. When I put a
> break point in it says that is is not reachable. GetStates returns a
> datatable.
>
>
>
>
>
> codebehind:
>
>
>
> using System;
>
> using System.Data;
>
> using System.Configuration;
>
> using System.Web;
>
> using System.Web.Security;
>
> using System.Web.UI;
>
> using System.Web.UI.WebControls;
>
> using System.Web.UI.WebControls.WebParts;
>
> using System.Web.UI.HtmlControls;
>
> using com.HelpfulBureaucrats.SQL;
>
>
>
> namespace com.HelpfulBureaucrats.Pages
>
> {
>
> public partial class _InputContacts : System.Web.UI.Page
>
> {
>
> protected void Page_Load(object sender, EventArgs e){
>
>
>
> if (Page.IsPostBack) {
>
> }
>
>
>
> else {
>
> States.DataSource = SQLDataAccessLayer.GetStates();
>
> States.DataTextField = "Name";
>
> States.DataValueField = "ID";
>
> States.DataBind();
>
> }
>
>
>
>
>
> }
>
> }
>
> }
>
>
>
> This is the aspx page
>
> <%@ Page MasterPageFile="~/MasterPage.master" Language="C#"
> AutoEventWireup="true" CodeFile="InputContacts.aspx.cs"
> Inherits="com.HelpfulBureaucrats.Pages._InputContacts" %>
>
>
>
> <asp:content id="InputContacts" contentplaceholderid="Center"
> runat="server">
>
> First Name: <asp:TextBox ID="FirstName" runat="server"></asp:TextBox>
> <br />
>
> First Name: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br
> />
>
> State:<asp:DropDownList ID="States" runat="server"> </asp:DropDownList>
>
> </asp:content>
>
>
>
>
>
>
>
> SQLDataAccessLayer:
>
>
>
> using System;
>
> using System.Data;
>
> using System.Configuration;
>
> using System.Web;
>
> using System.Web.Security;
>
> using System.Web.UI;
>
> using System.Web.UI.WebControls;
>
> using System.Web.UI.WebControls.WebParts;
>
> using System.Web.UI.HtmlControls;
>
>
>
> namespace com.HelpfulBureaucrats.SQL{
>
> public class SQLDataAccessLayer:IDataAccessLayer{
>
> public SQLDataAccessLayer(){
>
> }
>
>
>
> public static DataTable GetStates() {
>
> IDataHelper MyDataHelper = new SQLDataHelper();
>
> String StoredProc =
> ConfigurationManager.AppSettings["GetStates_SP"];
>
> SP_Parameters MyParams = new SP_Parameters();
>
> DataTable States = MyDataHelper.getDataTable(ref StoredProc, ref
> MyParams);
>
> return States;
>
> }
>
>
>
> public override string ToString()
>
> {
>
> return "SQLDataAccessLayer";
>
> }
>
> }
>
> }
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Joined: 10 Jan 2006
Posts: 33
HyperLinkField not rendering URL with JS
Bacially my break was in the States.DataSource = SQLDataAccessLayer.GetStates();
method. I figured out though... I wasn`t opening my connection in my SQL Helper
class so it was causing an error that wan`t being tossed up. Thanks Dean.
Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 |
travis.falls@...
-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of Dean Fiala
Sent: Tuesday, January 24, 2006 9:28 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] 2.0 MasterPages
Travis, where is the unreachable breakpoint? in the data access class
or the page?
On 1/23/06, Travis D. Falls <travis_falls2@...> wrote:
> I can`t figure out why this DropDownList isn`t being populated. I can
> execute the stored proc and Name, ID, and Abbriv are returned. When I put a
> break point in it says that is is not reachable. GetStates returns a
> datatable.
>
>
>
>
>
> codebehind:
>
>
>
> using System;
>
> using System.Data;
>
> using System.Configuration;
>
> using System.Web;
>
> using System.Web.Security;
>
> using System.Web.UI;
>
> using System.Web.UI.WebControls;
>
> using System.Web.UI.WebControls.WebParts;
>
> using System.Web.UI.HtmlControls;
>
> using com.HelpfulBureaucrats.SQL;
>
>
>
> namespace com.HelpfulBureaucrats.Pages
>
> {
>
> public partial class _InputContacts : System.Web.UI.Page
>
> {
>
> protected void Page_Load(object sender, EventArgs e){
>
>
>
> if (Page.IsPostBack) {
>
> }
>
>
>
> else {
>
> States.DataSource = SQLDataAccessLayer.GetStates();
>
> States.DataTextField = "Name";
>
> States.DataValueField = "ID";
>
> States.DataBind();
>
> }
>
>
>
>
>
> }
>
> }
>
> }
>
>
>
> This is the aspx page
>
> <%@ Page MasterPageFile="~/MasterPage.master" Language="C#"
> AutoEventWireup="true" CodeFile="InputContacts.aspx.cs"
> Inherits="com.HelpfulBureaucrats.Pages._InputContacts" %>
>
>
>
> <asp:content id="InputContacts" contentplaceholderid="Center"
> runat="server">
>
> First Name: <asp:TextBox ID="FirstName" runat="server"></asp:TextBox>
> <br />
>
> First Name: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br
> />
>
> State:<asp:DropDownList ID="States" runat="server"> </asp:DropDownList>
>
> </asp:content>
>
>
>
>
>
>
>
> SQLDataAccessLayer:
>
>
>
> using System;
>
> using System.Data;
>
> using System.Configuration;
>
> using System.Web;
>
> using System.Web.Security;
>
> using System.Web.UI;
>
> using System.Web.UI.WebControls;
>
> using System.Web.UI.WebControls.WebParts;
>
> using System.Web.UI.HtmlControls;
>
>
>
> namespace com.HelpfulBureaucrats.SQL{
>
> public class SQLDataAccessLayer:IDataAccessLayer{
>
> public SQLDataAccessLayer(){
>
> }
>
>
>
> public static DataTable GetStates() {
>
> IDataHelper MyDataHelper = new SQLDataHelper();
>
> String StoredProc =
> ConfigurationManager.AppSettings["GetStates_SP"];
>
> SP_Parameters MyParams = new SP_Parameters();
>
> DataTable States = MyDataHelper.getDataTable(ref StoredProc, ref
> MyParams);
>
> return States;
>
> }
>
>
>
> public override string ToString()
>
> {
>
> return "SQLDataAccessLayer";
>
> }
>
> }
>
> }
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Yahoo! Groups Links
*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







