Saturday, March 31, 2012

There is an invalid sequence in the string. Error problem

I have this below in a Datalist:-
<asp:HyperLink id="Hyperlink1" Cssclass="MenuUnselected" Text='<%#
DataBinder.Eval(Container.DataItem, "cat_cities")%>'
NavigateUrl='<%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'
runat="server" />

But i get error:- Invalid URI: There is an invalid sequence in the string. "
What could be the problem!!!You should replace <%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'

with

<%#
String.Format(".../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
((DataRowView)Container.DataItem)["mcatid"],
((DataRowView)Container.DataItem)["cat_cities"],
Container.ItemIndex) %>

Regards,
Tasos

Patrick.O.Ige wrote:

Quote:

Originally Posted by

I have this below in a Datalist:-
<asp:HyperLink id="Hyperlink1" Cssclass="MenuUnselected" Text='<%#
DataBinder.Eval(Container.DataItem, "cat_cities")%>'
NavigateUrl='<%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'
runat="server" />
>
But i get error:- Invalid URI: There is an invalid sequence in the string. "
What could be the problem!!!


I'm getting frustrated with this error i'm using :-
Dim link As String =
String.Format("../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
e.Item.DataItem("mcatid"), e.Item.DataItem("cat_cities"), e.Item.ItemIndex)
Still getting the same error
What could be wrong!!!!!!!!!!!!!!!

"Tasos Vogiatzoglou" <tvoglou@.gmail.comwrote in message
news:1151847930.414392.191900@.b68g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

You should replace <%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'
>
with
>
<%#
String.Format(".../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
((DataRowView)Container.DataItem)["mcatid"],
((DataRowView)Container.DataItem)["cat_cities"],
Container.ItemIndex) %>
>
Regards,
Tasos
>
Patrick.O.Ige wrote:

Quote:

Originally Posted by

>I have this below in a Datalist:-
><asp:HyperLink id="Hyperlink1" Cssclass="MenuUnselected" Text='<%#
>DataBinder.Eval(Container.DataItem, "cat_cities")%>'
>NavigateUrl='<%# "../Showcrete.aspx?CategoryID=" &
>DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
>DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
>Container.ItemIndex %>'
>runat="server" />
>>
>But i get error:- Invalid URI: There is an invalid sequence in the
>string. "
>What could be the problem!!!


>


Could you provide a stacktrace ?
(Btw... the code was in C#, I don't know if it's applicable to VB.NET)

Regards,
Tasos

Patrick.O.Ige wrote:

Quote:

Originally Posted by

I'm getting frustrated with this error i'm using :-
Dim link As String =
String.Format("../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
e.Item.DataItem("mcatid"), e.Item.DataItem("cat_cities"), e.Item.ItemIndex)
Still getting the same error
What could be wrong!!!!!!!!!!!!!!!
>
>
"Tasos Vogiatzoglou" <tvoglou@.gmail.comwrote in message
news:1151847930.414392.191900@.b68g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

You should replace <%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'

with

<%#
String.Format(".../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
((DataRowView)Container.DataItem)["mcatid"],
((DataRowView)Container.DataItem)["cat_cities"],
Container.ItemIndex) %>

Regards,
Tasos

Patrick.O.Ige wrote:

Quote:

Originally Posted by

I have this below in a Datalist:-
<asp:HyperLink id="Hyperlink1" Cssclass="MenuUnselected" Text='<%#
DataBinder.Eval(Container.DataItem, "cat_cities")%>'
NavigateUrl='<%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'
runat="server" />
>
But i get error:- Invalid URI: There is an invalid sequence in the
string. "
What could be the problem!!!



Tasos thanks i converted it to VB.NET
Actually i had to use ToString() and then used Server.UrlEncode
before i could get some positive result.

"Tasos Vogiatzoglou" <tvoglou@.gmail.comwrote in message
news:1152030342.063452.287830@.h44g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Could you provide a stacktrace ?
(Btw... the code was in C#, I don't know if it's applicable to VB.NET)
>
Regards,
Tasos
>
>
Patrick.O.Ige wrote:

Quote:

Originally Posted by

>I'm getting frustrated with this error i'm using :-
> Dim link As String =
>String.Format("../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
>e.Item.DataItem("mcatid"), e.Item.DataItem("cat_cities"),
>e.Item.ItemIndex)
>Still getting the same error
>What could be wrong!!!!!!!!!!!!!!!
>>
>>
>"Tasos Vogiatzoglou" <tvoglou@.gmail.comwrote in message
>news:1151847930.414392.191900@.b68g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

You should replace <%# "../Showcrete.aspx?CategoryID=" &
DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
Container.ItemIndex %>'
>
with
>
<%#
String.Format(".../Showcrete.aspx?CategoryID={0}&CitName={1}&s={2}",
((DataRowView)Container.DataItem)["mcatid"],
((DataRowView)Container.DataItem)["cat_cities"],
Container.ItemIndex) %>
>
Regards,
Tasos
>
Patrick.O.Ige wrote:
>I have this below in a Datalist:-
><asp:HyperLink id="Hyperlink1" Cssclass="MenuUnselected" Text='<%#
>DataBinder.Eval(Container.DataItem, "cat_cities")%>'
>NavigateUrl='<%# "../Showcrete.aspx?CategoryID=" &
>DataBinder.Eval(Container.DataItem, "mcatid")& "&CitName=" &
>DataBinder.Eval(Container.DataItem, "cat_cities") & "&s=" &
>Container.ItemIndex %>'
>runat="server" />
>>
>But i get error:- Invalid URI: There is an invalid sequence in the
>string. "
>What could be the problem!!!
>


>

0 comments:

Post a Comment